bulkrna-batch-correcti…
Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip…
Load when placing bulk RNA-seq samples on a single-cell reference's pseudotime axis (NNLS
$ npx -y skills add tiangzlab/omicsclaw --skill bulkrna-trajblend --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/bulkrna-trajblendContext preview
The summary Claude sees to decide when to auto-load this skill.
Load when placing bulk RNA-seq samples on a single-cell reference's pseudotime axis (NNLS
name: bulkrna-trajblend description: Load when placing bulk RNA-seq samples on a single-cell reference's pseudotime axis (NNLS deconvolution + nearest-neighbour mapping). Skip when plain cell-type proportions (use bulkrna-deconvolution); native single-cell trajectory inference (use sc-pseudotime). trigger: trajblend, trajectory, bulk to single cell, interpolation, bulk2single, VAE, deconvolution trajectory tags: - bulkrna - trajectory - pseudotime - deconvolution - single-cell
Place bulk samples on an observed single-cell pseudotime axis and estimate cell-type fractions. Use `bulkrna-deconvolution` for fractions without placement and `sc-pseudotime` to infer a trajectory on the reference first.
from skills._sdk.notebook import load_skill, write_output
library = load_skill('bulkrna-trajblend')
data, reference, labels, pseudotime = library.demo_data(random_state=42)
result = library.map_trajectory(data, reference=reference, labels=labels, pseudotime=pseudotime)
write_output(result, 'tables/pseudotime_estimates.csv')For real files, pass `read_fastq`, `read_log` or `read_reference` as appropriate to `read_input(..., reader=...)`. `examples/example_step.py` is executable.
<!-- api:begin generated from _api.py; regenerate with run.py api <skill dir> --write -->
Read a reference with annotations; pass this function as reader= to read_input.
:param path: H5AD with expression in X, or cell-by-gene CSV/TSV with annotation columns. :param cell_type_key: CLI default cell_type; change for a named annotation column. :param pseudotime_key: CLI default pseudotime; supply an observed reference trajectory value. :returns: Cell-by-gene DataFrame, indexed cell-type Series and indexed pseudotime Series. :raises ValueError: Required annotations are missing. :raises ImportError: H5AD reading needs anndata; install it with install_skill_deps.
Return bulk pseudotime estimates from NNLS and joint PCA/kNN placement.
:param bulk: Sample-by-gene nonnegative expression on a scale comparable with the reference. :param reference: Cell-by-gene expression with at least fifty shared genes. :param labels: Cell-type labels indexed by reference cell identifiers. :param pseudotime: Observed reference pseudotime indexed by cell identifiers; never synthesized. :param k: CLI default 15 nearest reference cells; reduce for a smaller reference. :param random_state: CLI seed 42 forwarded to PCA; change to assess randomized-solver sensitivity. :returns: New sample-indexed pseudotime table; fractions and embeddings remain in attrs. :raises ValueError: Matrices, annotations, gene overlap or neighbor count are invalid. :raises ImportError: Missing scipy/scikit-learn; use install_skill_deps.
Return the estimated cell-type fractions.
:param result: Output of map_trajectory retaining attrs. :returns: A separate sample-by-cell-type DataFrame. :raises KeyError: Fraction diagnostics are absent.
Read placement diagnostics and plot data.
:param result: Output of map_trajectory. :param keep: True preserves attrs; False removes diagnostics before serialization. :returns: Separate method, seed, fractions, embedding and annotation values. :raises TypeError: The result is not a DataFrame.
Plot bulk and reference PCA coordinates colored by reference pseudotime.
:param result: Placement result retaining its diagnostic attrs. :returns: A matplotlib Figure without writing files. :raises KeyError: Embedding diagnostics are absent.
Plot sample-by-cell-type proportions.
:param result: Placement result retaining its diagnostic attrs. :returns: A matplotlib Figure without writing files. :raises KeyError: Fraction diagnostics are absent.
Generate synthetic bulk mixtures and an annotated reference in memory.
:param random_state: CLI seed 42; change for another simulation without global RNG mutation. :returns: Bulk table, reference table, cell-type Series and pseudotime Series. :raises ValueError: The seed is invalid.
<!-- api:end -->
`map_trajectory` takes sample/cell rows and gene columns. NNLS estimates cell-type fractions. Joint reference-plus-bulk log1p expression is standardized, projected with PCA, and mapped with 15 nearest reference cells. Use comparable expression scales; at least 50 shared genes are required. PCA receives `random_state=42`. The CLI's `--n-epochs` remains unused; no VAE or GNN is fitted.
The CLI writes these artifacts; functions return DataFrames and Figures without writing them:
python skills/bulkrna/bulkrna-trajblend/bulkrna_trajblend.py --demo --output /tmp/bulkrna_trajblend
For real files use `--input <file>`; trajectory placement also needs `--reference
Conversational & memory-enabled AI research partner for multi-omics analysis. CLI + Desktop App (installers in Releases). From biological idea to full research paper.
Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip…
Load when discovering bulk gene co-expression modules and hub genes with R WGCNA. Skip direct expression contrasts (use…
Load when comparing gene expression between two conditions in bulk RNA-seq count data. Skip
Load when estimating cell-type proportions in bulk RNA-seq samples from a single-cell or
Load when running pathway / GO term enrichment on a bulk RNA-seq DE result list. Skip when
Load when converting Ensembl, Entrez or symbol IDs in a bulk RNA count matrix using an explicit mapping or a small human demo…