theislab / moscot

Multi-omic single-cell optimal transport tools
https://moscot-tools.org
BSD 3-Clause "New" or "Revised" License
112 stars 9 forks source link

Extract the cells in the trace #709

Closed dawangran closed 2 months ago

dawangran commented 3 months ago

Hello, I finished the trajectory analysis, the command line is ct_desc = tp.cell_transition(1, 2, "seurat_clusters", "seurat_clusters", forward=True, key_added="transitions_1_2")

image

What are the cells that I want to extract from group 6 at time point 1 going to group 5 at time point 2?

Looking forward to your reply

MUCDK commented 3 months ago

Hi,

What do you mean by "what are the cells"?, do you mean how you get their barcode? or how you visualize them?

dawangran commented 3 months ago

Hello, I want get their barcode.I'm not trying to visualize them. I need to know the specific cells of each lineage (barcode), such as 6-5(0.86), 5-3(0.82).

MUCDK commented 3 months ago

Please use aggregation_mode="cell", and source_groups=None in cell_transition.

This gives you a map from each single cell to a cluster. Then you can identify for each single cell what the most likely cluster is and thus select all cells in the source distribution which are most likely mapped to cluster 5.

@ArinaDanilina I just realized we don't have an example for this, could you please add the aggregation_mode="cell" to the cell transition example and keep @dawangran updated? https://moscot.readthedocs.io/en/latest/notebooks/examples/plotting/200_cell_transitions.html

MUCDK commented 2 months ago

Hi @dawangran ,

You might have noticed that we added an example here: https://moscot.readthedocs.io/en/latest/notebooks/examples/plotting/200_cell_transitions.html

I am closing this for now, please feel free to reopen if you have more questions.