saezlab / liana-py

LIANA+: an all-in-one framework for cell-cell communication
http://liana-py.readthedocs.io/
GNU General Public License v3.0
164 stars 21 forks source link

limit plotting in li.pl.dotplot to selected ligands/receptors #21

Closed JuHey closed 1 year ago

JuHey commented 1 year ago

I was looking for a way to limit plotting using li.pl.dotplot function to a selection of ligand/receptor complexes. But the plot function does not seem to offer that. What are my options?

dbdimitrov commented 1 year ago

Hi,

@JuHey good suggestion, I have implemented it in dotplot_by_sample, but I didn't include it in the basic dotplot. I will do so in liana's next update.

JuHey commented 1 year ago

Hi, @dbdimitrov. Thank you for taking this on. Is there a way to coerce doplot_by_sample to work when having only a single sample? In a way, the basic dotplot could be a special case of dotplot_by_sample. With that, a single function would suffice.

Cheers

dbdimitrov commented 1 year ago

Hi,

@JuHey, in the end they are both very simple functions & already share a lot of code. I will think whether a solution that merges them would be the cleanest, but indeed one can think of dotplot_by_sample as just a special case of dotplot.

In the meantime, you can pre-filter the dataframe to only those proteins that are of interest to you & still use the dotplot function.

dbdimitrov commented 1 year ago

One can now filter dotplot by ligand_complex and receptor_complex