zktuong / ktplotspy

Python library for plotting Cellphonedb results. Ported from ktplots R package.
https://ktplotspy.readthedocs.io/
MIT License
46 stars 12 forks source link

kpy.plot_cpdb - plot interacting pair rather than genes #71

Closed elise-smith closed 2 months ago

elise-smith commented 2 months ago

Thank you for the great package! For kpy.plot_cpdb, I have been specifying genes of interest, but sometimes it would be more useful to plot specific interacting pairs of ligands/receptors. Could there be an option to plot the interacting_pair, rather than just genes? Many thanks

zktuong commented 2 months ago

hi @elise-smith, sure i can make that happen but may take some time.

To clarify, the behaviour you want is to specify e.g. ["CPI-SC0B5CEA47D", "CPI-SC0C8B7BCBB"] and it will plot it accordingly? do you still want it to display as the gene names in the final output?

zktuong commented 2 months ago

OH wait you mean you just want e.g. TNF-TNFR?

elise-smith commented 2 months ago

Thank you for your quick reply! Sorry, I just realised that the genes option takes ligand receptor pairs, as well as individual genes, which was what I was looking for Thanks again

zktuong commented 2 months ago

well, kinda. the current way it works is it does a regex grab but it's not specific to a specific interacting pair.

I'm going to make a PR soon in the next 5 min and you can try the new option to specify the specify pair's name.

zktuong commented 2 months ago

you can try it now with:

pip install git+https://www.github.com/zktuong/ktplotspy@add-interacting-pairs-option
elise-smith commented 2 months ago

Just tested it out on a few interacting pairs and it works well! Thank you very much

zktuong commented 2 months ago

solved with #72