Skip to content

Commit edfda5c

Browse files
Ekin-Kahramanmeeseeksmachine
authored andcommitted
Backport PR scverse#4032: docs: add inline example plot to sc.pl.highly_variable_genes
1 parent 48c7783 commit edfda5c

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

.github/workflows/check-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
name: Check for release notes
5252
runs-on: ubuntu-latest
5353
needs: check-milestone
54-
if: github.event.pull_request.user.login != 'pre-commit-ci[bot]' && needs.check-milestone.outputs.no-relnotes-reason == '' && !contains(fromJSON('["style","refactor","test","build","ci"]'), needs.check-milestone.outputs.type)
54+
if: github.event.pull_request.user.login != 'pre-commit-ci[bot]' && needs.check-milestone.outputs.no-relnotes-reason == '' && !contains(fromJSON('["style","refactor","test","build","docs","ci"]'), needs.check-milestone.outputs.type)
5555
steps:
5656
- uses: actions/checkout@v6
5757
with: { filter: 'blob:none', fetch-depth: 0 }

src/scanpy/plotting/_preprocessing.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,27 @@ def highly_variable_genes( # noqa: PLR0912
4343
A string is appended to the default filename.
4444
Infer the filetype if ending on {{`'.pdf'`, `'.png'`, `'.svg'`}}.
4545
46+
Examples
47+
--------
48+
Compute and plot highly variable genes from raw PBMC data.
49+
50+
.. plot::
51+
:context: close-figs
52+
53+
import scanpy as sc
54+
adata = sc.datasets.pbmc3k()
55+
sc.pp.normalize_total(adata, target_sum=1e4)
56+
sc.pp.log1p(adata)
57+
sc.pp.highly_variable_genes(adata, min_mean=0.0125, max_mean=3, min_disp=0.5)
58+
sc.pl.highly_variable_genes(adata)
59+
60+
Plot on logarithmic axes.
61+
62+
.. plot::
63+
:context: close-figs
64+
65+
sc.pl.highly_variable_genes(adata, log=True)
66+
4667
"""
4768
if isinstance(adata_or_result, AnnData):
4869
result = adata_or_result.var

0 commit comments

Comments
 (0)