saezlab / liana-py

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

Update _tileplot.py for plotnine >=0.13 #108

Closed redst4r closed 1 month ago

redst4r commented 1 month ago

With plotnine>=0.13 they changed the interface of facet_grid (see Release notes); there's not more argument facets and doing something like the tutorial

li.pl.tileplot(liana_res=lr_res,
               fill = 'expr',
               label='padj',
               label_fun = lambda x: '*' if x < 0.05 else np.nan,
               top_n=15,
               orderby = 'interaction_stat',
               orderby_ascending = False,
               orderby_absolute = False,
               source_title='Ligand',
               target_title='Receptor',
               )

will fail with plotnine>=0.13.

As a simple fix, just remove the named argument in facet_grid solves the issue and is backwards compatible. Thanks for creating this awesome package!

dbdimitrov commented 1 month ago

Hi @redst4r, thanks for the PR. I will merge it soon :)