In-silico gene perturbation#
ov.single.perturb runs a virtual gene perturbation on an AnnData
and returns the post-perturbation expression, the
post-perturbation gene regulatory network, and per-edge / per-gene
Δ-tables. It addresses issue
omicverse#739
(“Dynamo’s virtual KO doesn’t analyse downstream GRN”).
When to use#
Use this |
Use something else |
|---|---|
Want to know which TF→target edges change after a KO/OE |
Want a cell-fate trajectory shift only → |
Want a tidy |
Want a foundation-model prediction → Geneformer / scGPT (separate path) |
Have scRNA-seq alone |
Want multi-omics (ATAC + RNA) GRN → SCENIC+ / Pando |
Three modes, one call#
|
Effect |
Notes |
|---|---|---|
|
Knockout |
expression clamped to 0 in the simulated cell state |
|
Knockdown |
expression scaled by |
|
Over-expression |
expression scaled by |
Backends — pick by what data you have#
Backend |
Min data |
Strength |
Tutorial |
|---|---|---|---|
|
scRNA only |
Built-in differential-regulation table with |
|
|
scRNA + base GRN (motif/ATAC, optional) |
Propagates the perturbation through a base GRN for |
|
|
— |
Picks |
— |
Both backends are lazy imports — omicverse.single itself doesn’t
require either to be installed.
Unified downstream analyses (Tier A / B / C)#
Regardless of backend, every PerturbResult exposes the same
downstream API. See t_perturb_unified for an
end-to-end run on the official Paul15 dataset.
Tier |
Method |
What it gives |
|---|---|---|
A |
|
unified per-cell + cell×cell |
A |
|
adds |
B |
|
per-cell promote/block score |
B |
|
source × target cluster matrix |
B |
|
publication-style plots |
C |
|
GO / KEGG / Reactome enrichment |
C |
|
MGI / HPO / DisGeNET enrichment |
C |
|
long-run cell fate sampling |
C |
|
predicted-vs-observed correlation + top-K precision |
C |
|
overall robustness Z |
API at a glance#
import omicverse as ov
result = ov.single.perturb(
adata,
target='Sox2', # gene name or list of names
mode='ko', # 'ko' | 'kd' | 'oe'
backend='auto', # 'auto' | 'sctenifoldknk' | 'cell_oracle'
fold_change=2.0, # for OE / KD
grn_base=None, # for cell_oracle backend (DataFrame or networkx graph)
n_propagation=3, # CellOracle-only
grn_output=True,
return_delta=True,
)
# What you get back:
result.adata_perturbed # AnnData with predicted post-perturbation counts (when supported)
result.grn # networkx.DiGraph of the perturbed GRN
result.grn_base # networkx.DiGraph of the baseline GRN
result.delta_grn # DataFrame (source, target, weight_base, weight_pert, delta)
result.delta_expr # DataFrame (gene, delta, Z, log2_fc, p-value, adjusted p-value)
result.trajectory_shift # CellOracle's transition_prob matrix (or None)
result.summary(top_n=10) # printable + returned top-affected genes
References#
Osorio, D., Zhong, Y. et al. scTenifoldKnk: an efficient virtual knockout tool for gene function predictions via single-cell gene regulatory network perturbation. Patterns 3, 100434 (2022).
Kamimoto, K., Stringa, B., Hoffmann, C.M. et al. Dissecting cell identity via network inference and in silico gene perturbation. Nature 614, 742–751 (2023). — CellOracle.
Issue omicverse#739 motivated this module.