bulkrna-deconvolution
Load when estimating cell-type proportions in bulk RNA-seq samples from a single-cell or signature-matrix reference. Skip when the data is already single-cell (no deconvolution needed); spatial deconvolution (use spatial-deconv).
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-08
- Stars
- ★ 161
- Forks
- 27
01 前言 Front Matter
- name
- bulkrna-deconvolution
- tags
- [ "bulkrna", "deconvolution", "NNLS", "cell-type-proportion" ]
- trigger
- bulk deconvolution, cell type proportion, NNLS, CIBERSORTx, bulk deconv, cell fraction
- description
- Load when estimating cell-type proportions in bulk RNA-seq samples from a single-cell or signature-matrix reference. Skip when the data is already single-cell (no deconvolution needed); spatial deconvolution (use spatial-deconv).
02 资源文件 9
- 脚本_api.py1.7 KB
- 脚本bulkrna_deconvolution.py10.9 KB
- 脚本examples/example_step.py498 B
- 参考文档references/methodology.md2.5 KB
- 参考文档references/output_contract.md1.3 KB
- 参考文档references/parameters.md222 B
- 脚本tests/__init__.py—
- 脚本tests/test_api.py1.1 KB
- 脚本tests/test_bulkrna_deconvolution.py1.8 KB
03 SKILL.md 正文
bulkrna-deconvolution
When to use
Estimate bulk cell-type proportions with an explicit signature matrix. See the description for adjacent skills.
Use from a step
from skills._sdk.notebook import load_skill, read_input, write_output
library = load_skill("bulkrna-deconvolution")
# Supply DataFrames read with read_input(..., reader=...) for your CSV layout.
result = library.deconvolve(counts, signature=signature)
write_output(result, "tables/result.csv")
The synthetic worked step is in examples/example_step.py.
API
<!-- api:begin generated from _api.py; regenerate with run.py api <skill dir> --write -->
deconvolve(counts, *, signature)
Estimate sample proportions without changing either input.
:param counts: Nonnegative gene-by-sample expression DataFrame. :param signature: Required gene-by-cell-type reference, matching the CLI --reference. :returns: Sample-by-cell-type DataFrame; diagnostics contain residuals and shared genes. :raises ValueError: Matrices have invalid values, duplicate labels or no shared genes.
run_info(result, *, keep=True)
Read reference overlap and reconstruction diagnostics.
:param result: DataFrame returned by deconvolve. :param keep: Default True; False removes diagnostics from attrs. :returns: Diagnostic dictionary, empty after removal.
proportions_figure(result)
Plot estimated cell-type proportions per sample.
:param result: Sample-by-cell-type DataFrame from deconvolve. :returns: A matplotlib Figure, without writing files. :raises ValueError: The table cannot be plotted as numeric proportions.
<!-- api:end -->
Methods and parameters
See parameters and methodology.
Gotchas
deconvolverequires shared gene identifiers and nonnegative matrices.run_info()['residuals']measures fit to the supplied reference, not confidence intervals.- NNLS is the only backend;
deconvolvedoes not call CIBERSORTx or MuSiC.
Inputs and outputs
The library returns objects without file writes. CLI inventory:
Inputs
- File types:
.csv
Outputs
tables/dominant_types.csvtables/proportions.csvfigures/mean_proportions_pie.pngfigures/proportions_heatmap.pngfigures/proportions_stacked.pngreport.mdresult.json
CLI
python skills/bulkrna/bulkrna-deconvolution/bulkrna_deconvolution.py --demo --output /tmp/bulkrna-deconvolution
See also
Dependencies
matplotlib, numpy, pandas, scipy
04 同仓库更多 Skills
demo-skill
A fixture skill for the skill environment tests. Use it for nothing else.
fake-domains
Test fixture for the golden deployment in tests/entry. Load never; it has no script.
replace-me-skill
Load when copying this directory to bootstrap a new OmicsClaw skill. Skip when an existing skill already covers the request.
spatial-velocity
Load when estimating RNA velocity on a spatial AnnData with `layers["spliced"]` + `layers["unspliced"]` via scVelo (stochastic / deterministic / dynamical) or veloVI (deep generative). Skip when input lacks the spliced/unspliced layers (must be quantified upstream by velocyto / kb-python / STARsolo); non-spatial scRNA velocity (use sc-velocity).
spatial-trajectory
Load when inferring pseudotime / lineage trajectories on a preprocessed spatial AnnData via DPT (default — diffusion pseudotime), CellRank (terminal-state + fate-probability), or Palantir (waypoint branch probabilities). Skip when the data has spliced/unspliced layers and you want velocity-driven dynamics (use spatial-velocity); non-spatial scRNA pseudotime (use sc-pseudotime).
spatial-statistics
Load when running spatial autocorrelation / hotspot / co-occurrence / neighbourhood-enrichment / Ripley K stats on a clustered spatial AnnData via squidpy. Skip when ranking spatially variable genes (use spatial-genes); tissue domain detection (use spatial-domains).