Skip to content

Commit c7c1f4e

Browse files
docs: add inline example plot to sc.pl.highly_variable_genes (#4032)
Co-authored-by: Phil Schaf <flying-sheep@web.de>
1 parent dbb5c58 commit c7c1f4e

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.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
@@ -41,6 +41,27 @@ def highly_variable_genes( # noqa: PLR0912
4141
A string is appended to the default filename.
4242
Infer the filetype if ending on {{`'.pdf'`, `'.png'`, `'.svg'`}}.
4343
44+
Examples
45+
--------
46+
Compute and plot highly variable genes from raw PBMC data.
47+
48+
.. plot::
49+
:context: close-figs
50+
51+
import scanpy as sc
52+
adata = sc.datasets.pbmc3k()
53+
sc.pp.normalize_total(adata, target_sum=1e4)
54+
sc.pp.log1p(adata)
55+
sc.pp.highly_variable_genes(adata, min_mean=0.0125, max_mean=3, min_disp=0.5)
56+
sc.pl.highly_variable_genes(adata)
57+
58+
Plot on logarithmic axes.
59+
60+
.. plot::
61+
:context: close-figs
62+
63+
sc.pl.highly_variable_genes(adata, log=True)
64+
4465
"""
4566
if isinstance(adata_or_result, AnnData):
4667
result = adata_or_result.var

0 commit comments

Comments
 (0)