question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Recent changes in sc.tl.rank_genes_groups broke y-axis range in sc.pl.rank_genes_groups

See original GitHub issue

y-axis range of sc.pl.rank_genes_groups seems unnecessarily long:

image

import scanpy as sc

sc.set_figure_params(dpi=72)
adata = sc.datasets.paul15()
sc.pp.log1p(adata)
sc.tl.rank_genes_groups(adata, groupby='paul15_clusters', method='t-test')
sc.pl.rank_genes_groups(adata, sharey=False)

Versions:

scanpy==1.5.2.dev52+g10937f5f anndata==0.7.4 umap==0.4.6 numpy==1.19.0 scipy==1.5.1 pandas==1.0.5 scikit-learn==0.23.1 statsmodels==0.11.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ivirshupcommented, Jul 29, 2020

My suspicion is that this is more likely to do with the plotting functions, than the calculation. I think the issue is that previously the axis limits weren’t being set (though they were calculated). Now they are set, but it turns out they were calculated on the full range of scores – not just the plotted ones. Here’s what a potential fix looks like:

Big images

Without fix:

tmp

With fix:

tmp_new

What do you think? (ping @fidelram)

0reactions
ivirshupcommented, Jul 30, 2020

Ah, that makes sense. Either way, I don’t think the intent of the function was to have the axis bounds determined by how many DE tests were saved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Recent changes in sc.tl.rank_genes_groups broke y-axis ...
y -axis range of sc.pl.rank_genes_groups seems unnecessarily long: import scanpy as sc sc.set_figure_params(dpi=72) adata ...
Read more >
scanpy.pl.rank_genes_groups - Read the Docs
Plot ranking of genes. Annotated data matrix. The groups for which to show the gene ranking.
Read more >
scanpy.tl.rank_genes_groups — Scanpy 1.9.1 documentation
Rank genes for characterizing groups. Expects logarithmized data. ... There are slight inconsistencies depending on whether sparse or dense data are passed. See ......
Read more >
Release notes — Scanpy 1.9.1 documentation - Read the Docs
filter_rank_genes_groups() now allows to filter with absolute values of log fold change PR 1649 · _choose_representation now subsets the provided representation ...
Read more >
scanpy.pl.rank_genes_groups_dotplot - Read the Docs
By default, the groupby is chosen from the rank genes groups parameter but ... of the mean gene value, plot the values computed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found