scverse / scirpy

A scanpy extension to analyse single-cell TCR and BCR data.
https://scirpy.scverse.org/en/latest/
BSD 3-Clause "New" or "Revised" License
215 stars 34 forks source link

Why `clonotype_imbalance` is deprecated? #330

Open naity2 opened 2 years ago

naity2 commented 2 years ago

Hi @grst,

I was wondering why clonotype_imbalance is deprecated because of clonotype_modularity?

clonotype_imbalance seems to me still a very useful tool if one wants to compare how the clonal compositions differ between two populations of interest, whereas clonotype_modularity reveals how similar cells belonging to the same clone_id are in terms of their gene expression profiles.

Am I missing something?

Thanks very much, Yuan

grst commented 2 years ago

Hi @naity2,

thanks for raising this issue. I felt the "populations of interest" would usually be clusters, and, therefore somewhat similar to "similarity in terms of gene expression".

I'm interested to learn more about your use-case! How are the populations you want to compare defined? And how do you use the results downstream? I'm not particularly happy about the current visualization options of clonotype_imbalance which is another reason why I considered removing it at some point.

Best, Gregor

naity2 commented 2 years ago

Hi @naity2,

thanks for raising this issue. I felt the "populations of interest" would usually be clusters, and, therefore somewhat similar to "similarity in terms of gene expression".

I'm interested to learn more about your use-case! How are the populations you want to compare defined? And how do you use the results downstream? I'm not particularly happy about the current visualization options of clonotype_imbalance which is another reason why I considered removing it at some point.

Best, Gregor

Thank you for your response!

I think the example you gave in the tutorial where you compared CD8_Teff and CD8_Trm is a perfect case where the function clonotype_imbalance could be useful.

Another example could be that I have before and after culture samples and want to use clonotype_imbalance to identify expanded clonotypes after culture by comparing after vs. before without relying on clustering. In this case, I don't care too much about whether cells from the same clonotype cluster together on the UMAP, but rather which clonotypes are different between after and before samples.

I hope this makes sense and please let me know if my understanding is incorrect.

Thank you again!

grst commented 2 years ago

Thanks for the response, especially the comparison by conditions that are independent of gene expression is a use-case I have overlooked.

Do you have any thoughts on how to best visualize the results? I'm not particularly fond of neither the volcano plot nor the strip plot for this use-case...

naity2 commented 2 years ago

I think volcano plots can actually be useful in addition to visualizing "DE" clonotypes on UMAP plots. It would be helpful to label highly differentially expressed clonotypes on volcano plots and potentially use size of the dots to indicate the # of cells that express a particular clonotype.

We could also burrow ideas from Scanpy's visualization methods for DE gens such as dotplot, where size or color can be used to indicate the proportion of cells that express a particular clonotype for each group.

Please let me know what you think. Thank you!

grst commented 2 years ago

Cool, thanks for your input! I'll remove the deprecation warning in the next update and think about how to streamline plotting.