proseg icon indicating copy to clipboard operation
proseg copied to clipboard

CosMx flat file changes?

Open kescobo opened this issue 1 year ago • 2 comments

I do not disagree with the descriptor "shambolic" - that said, I think the output format has changed, or I'm not understanding what https://github.com/dcjones/proseg/blob/main/extra/stitch-cosmx.jl is doing.

The current _tx flatfile has the following structure:

❯ gunzip -c ~/Downloads/20240909_TLR78_kinetics_rerun/flatFiles/mw_mus_p1_09/mw_mus_p1_09_tx_file.csv.gz | head
fov,cell_ID,cell,x_local_px,y_local_px,x_global_px,y_global_px,z,target,CellComp
1,0,c_2_1_0,4256,2290,5180.32098155471,106920.441576382,2,Syk,None
1,0,c_2_1_0,4255,2305,5179.49094334709,106905.472147023,3,B2m,None
1,0,c_2_1_0,4255,2314,5179.8006590962,106896.449260048,3,Pfn1,None
1,0,c_2_1_0,4255,2581,5179.96072019534,106629.409863437,0,Pdgfrb,None
1,0,c_2_1_0,4255,2575,5179.47062599395,106634.698321796,2,Fgf1,None
1,0,c_2_1_0,4256,2619,5180.64060820779,106590.860411349,5,Gsn,None
1,0,c_2_1_0,4256,2996,5180.33089245868,106214.261917875,2,TLR9,None
1,0,c_2_1_0,4255,2973,5180.0107702604,106237.041139563,0,Actg2,None
1,0,c_2_1_0,4255,2975,5180.19065316748,106235.518824713,0,Fau,None

And there's just one file for a whole slide. If I understand correctly, you were previously trying to get the global px positions from the individual FOV positions?

This was recently changed - I had some code operating on a previous format that did not have these global positions. Let me know if a more complete example would be helpful.

kescobo avatar Oct 08 '24 20:10 kescobo

I need to update the documentation, but you shouldn't need to deal with stitch-cosmx.jl anymore. Previously they were not generating these flat files, so I had to figure out how to do that myself. Now you should be able to run it on this _tx_file.csv.gz file directly with just the --cosmx option.

Though that may have changed in the mean time, because everyone is frequently silently changing their formats.

dcjones avatar Oct 08 '24 21:10 dcjones

For what it's worth, we have assurances from CosMx that they have no further changes planned... I suppose we'll see.

Feel free to close, or if you'd like to leave it open to remind you to update the docs, that's totally fine too :+1: thanks!

kescobo avatar Oct 09 '24 13:10 kescobo