Tutorials#

HTML on Read the Docs is pre-executed (tables and figures already there). Re-run locally only if you have the .h5ad files at the repo root.

Pick a notebook#

If you want…

Open

No spliced/unspliced layers yet — velocyto, kb-python, STARsolo, alevin-fry, or labeling data

Preparing spliced/unspliced data

Full DE → mechanism story (human LPS-PBMC)

Partition DE by mechanism — transcription vs stabilization

Same API with real DE hits (mouse, 3 vs 3)

Partition by mechanism — GA vs Ctrl

Underpowered design (empty DE list on purpose)

Partition by mechanism — when DE finds nothing

DE + enrichment, no nascent layers

Differential expression + enrichment, no velocity layers

Plot gallery only

Visualization gallery

Gene overlap across DE backends

Gene overlap across DE methods

If you are new: read Quickstart, then either Partition DE by mechanism — transcription vs stabilization or Partition by mechanism — GA vs Ctrl. Open the SCI/EC notebook only if you want the empty-list lesson. If your AnnData does not have nascent layers at all, start with Preparing spliced/unspliced data instead.

SCI (EC) and GA share the same entry point (partition_de_by_mechanism). Whether genes are selected depends on the design, not on the function name.

Partition notebooks#

Notebook

Design

What to expect

LPS-PBMC

Human 10x, resting vs LPS 4 h

Full path: DE, labels, programs, absolute placement

GA vs Ctrl

Mouse, 3 individuals per group

Real DE hits, programs, enrichment

SCI vs UN (EC)

Mouse endothelium, 3 vs 3

Capture OK but 0 DE genes; sample- vs cell-level contrast

Run locally#

pip install "scatrans[pseudobulk,gsea]"
# or from a clone: pip install -e ".[dev,pseudobulk,gsea]"
jupyter lab docs/tutorials/

Put data files at the repository root. Notebooks load them with a relative path, for example sc.read_h5ad("../../EC.h5ad").

File

Used by

GSE226488_PBMC_tutorial_subset.h5ad

LPS-PBMC

GA_test.h5ad

GA

EC.h5ad

SCI partition, gene UpSet

kang_ifnb_tutorial_subset.h5ad

Standalone DE + enrichment

These files are large and are not on PyPI. Citations: References & Data Sources. Without them you can still read the HTML on Read the Docs. The visualization gallery does not need an external file.

Rough runtime with data on disk: LPS / GA about 10–30 min (calibration is slower); EC / UpSet about 2–15 min; standalone DE + enrichment about 5–15 min; synthetic plots about 1–3 min.


Notebook cards#

Preparing spliced/unspliced data

velocyto / kb-python / STARsolo / alevin-fry → AnnData layers, plus merging and sanity checks.

Preparing spliced/unspliced data
Partition — LPS-PBMC (GSE226488)

Full human story: DE, mechanism labels, programs, absolute placement.

Partition DE by mechanism — transcription vs stabilization
Partition — GA vs Ctrl

Powered mouse design with real DE hits, GO programs, enrichment.

Partition by mechanism — GA vs Ctrl
Partition — SCI vs UN (low power)

Same API; DE finds nothing — that is the point. Sample- vs cell-level table.

Partition by mechanism — when DE finds nothing
DE + enrichment (no nascent layers)

Wilcoxon / PyDESeq2 / Memento, ORA, GO, KEGG, GSEA, plots.

Differential expression + enrichment, no velocity layers
Visualization gallery

scat.pl helpers on synthetic tables, including palettes and cmap=.

Visualization gallery
Gene UpSet across DE methods

Overlap of gene lists from different DE backends.

Gene overlap across DE methods