Open Xparx opened 2 years ago
Thanks for the report. I can broadly reproduce the error for passing values_to_plot
. The error I get is a little different, but I expect that's due to pandas versions.
A more minimal example:
import scanpy as sc
adata = sc.datasets.pbmc3k_processed().raw.to_adata()
sc.tl.rank_genes_groups(adata, groupby="louvain", reference="B cells")
# Errors with any of ['scores', 'logfoldchanges', 'pvals', 'pvals_adj','log10_pvals', 'log10_pvals_adj']
sc.pl.rank_genes_groups_dotplot(adata, values_to_plot='logfoldchanges')
For rankby_abs
it does error, but is that a valid argument to pass to this function?
I "fixed" the issue I had by eddting the _dotplot.py module editing the DotPlot class. Switching the top line for the bottom line.
# dot_color_df = dot_color_df.loc[dot_size_df.index][dot_size_df.columns]
dot_color_df = dot_color_df.reindex(dot_size_df.index).reindex(columns=dot_size_df.columns)
I'm not sure the output is what is desired but for my case at least it is the same for cases where it wored before.
I will retract the above snippet. It let's the function work for what it worked for before but the new results are nonsense.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
As the title says. A specific set of combinations of keywords to rank gene groups and plotting throws an error unexpectedly.
Minimal code sample (that we can copy&paste without having any data)
Versions