Communicate early about mutual responsibilities.
To be on the safe side, do so in writing - e-mailing key points after important meetings is an option for recording oral agreements. Especially if you end up re-negotiating something, like you have.
Now, I have done what you did on several occasions, and was not met with malicious intent, so - anecdotally - do not start with assuming something bad (but do not write it off, either!). The major concern here comes from
The colleague then said they would be taking over the rest of the analysis and I wouldn't be able to look at the data.
There is a big difference between the hostile "I would not give you access to this data" and "I want to handle it myself and do not need your involvement any more". I would certainly pry. Better late than never - you have already done some work, and have not reached any agreements about publications yet: time to arrange that. Ideally, this should have been done at least prior to handing the pipeline over.
First authorship dispute is more delicate. In my field, for the first author claim one typically has to play a key role in the experiment design or take more responsibilities regarding data analysis and writing than you have described so far. It is possible to take a potential paper over like that (and I have done so very recently, actually, but certainly not by scheming about "how do I get a first authorship paper"), however, this is certainly not something to be coming at on full blast.
A common parlance in academia is that the ideas are cheap. This is not entirely true - once some preliminary work is done, it is clear that some ideas are more equal than the others. People get understandably defensive when others try to ride 10% of their ideas that were promising to success, and the perspective of "but I did all the work here" too often neglects the amount of work poured in pursuing the other 90% of ideas which ended up in the trash bin. I agree with Roland here: as the situation is presented, you do not have a strong claim on the first authorship, but you could push for the further collaboration explaining how your expertise with the method would be valuable, and propose leading the next paper with significantly more in-depth analysis. Overall contribution evaluation would still depend on the method and experiment complexity and a lot of other factors, so just talk it through.
To sum it up, first steps would be:
- Get a clear picture of your agreements with said colleague. If they do not exist in writing, make sure they do.
- Discuss the current authorship situation ASAP.
- If needed, get the more senior PI involved.
- If you get an authorship out of the current paper, but it is unsatisfactory for you (and, crucially, you are not required to do any more work on it beyond revising), pitch a new one where your part is the centerpiece.
Your negotiating power is tied directly with the work you perform. Use it well.