Recent changes in sc.tl.rank_genes_groups broke y-axis range in sc.pl.rank_genes_groups
See original GitHub issuey-axis range of sc.pl.rank_genes_groups seems unnecessarily long:
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:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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:
With fix:
What do you think? (ping @fidelram)
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.