Skip to content
Back to skills

Bulkrna Trajblend

ASecurity

Load when placing bulk RNA-seq samples on a single-cell reference's pseudotime axis (NNLS

  • 8 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 6, 2026
datapythongobash

Works with

  • cli

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 6, 2026

npx -y skills add lilinji/GeneTind-Life-Skills --skill bulkrna-trajblend --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Bulkrna Trajblend?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Bulkrna Trajblend
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/lilinji-bulkrna-trajblend/badge)](https://www.skillsdirectory.com/skills/lilinji-bulkrna-trajblend)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
# AUTO-GENERATED header from skill.yaml β€” do not edit by hand.
# Edit skill.yaml, then run: python scripts/generate_skill_md.py <skill_dir>
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).
version: 0.3.0
author: OmicsClaw
license: MIT
emoji: πŸ”€
tags:
- bulkrna
- trajectory
- pseudotime
- deconvolution
- single-cell
requires:
- anndata
- matplotlib
- numpy
- pandas
- scikit-learn
- scipy
---

# bulkrna-trajblend

## When to use

Run when you have a bulk RNA-seq cohort and a single-cell reference
with pre-computed pseudotime, and you want each bulk sample placed on
that pseudotime axis.  The current implementation is a sklearn-based
NNLS-plus-nearest-neighbour pipeline (PCA β†’ kNN against ref); it does
*not* use VAE / GNN despite the skill name's connotation.

## Inputs & Outputs

<!-- AUTO-GENERATED from skill.yaml (interface) β€” do not edit by hand. Regenerate: python scripts/generate_skill_md.py <skill_dir> -->

**Inputs**

- File types: `.csv`, `.tsv`, `.h5ad`

**Outputs**

- `tables/cell_fractions.csv`
- `tables/pseudotime_estimates.csv`
- `figures/bulk_on_trajectory.png`
- `figures/fraction_heatmap.png`
- `figures/pseudotime_distribution.png`
- `figures/trajectory_embedding.png`
- `report.md`
- `result.json`

## Flow

1. Load bulk counts + sc reference.
2. Find common genes between bulk and reference (`bulkrna_trajblend.py:117` raises `ValueError` if `< 50` genes overlap).
3. Run NNLS deconvolution to estimate per-sample cell-type fractions.
4. Project bulk samples into the reference's PCA space; use `sklearn.neighbors.NearestNeighbors` to find each bulk sample's k nearest reference cells.
5. Estimate per-sample pseudotime as mean (and std) of the neighbour set's reference pseudotime values.
6. Render trajectory figures; emit fractions + pseudotime tables.

## Gotchas

- **Gene-namespace mismatch hard-fails at 50.**  `bulkrna_trajblend.py:117` raises if fewer than 50 gene IDs overlap between bulk and reference.  Most common cause: bulk uses Ensembl IDs while sc reference uses HGNC symbols.  Pre-run `bulkrna-geneid-mapping` to harmonise.
- **`--n-epochs` is currently a no-op.**  The argparse help text at `:354` reads `"VAE epochs (unused in fallback)"` β€” there is no VAE / GNN code path in this version (the script imports only `sklearn`, `numpy`, `pandas`).  The flag is preserved as a forward-compat hook; passing any value has no effect on output.  Do not report results as "VAE+GNN-derived" until that code lands.
- **Pseudotime placement is a kNN average, not a likelihood-based fit.**  Each bulk sample's `pseudotime` is the *mean* of its k nearest reference cells' pseudotimes β€” it doesn't carry uncertainty in the way a probabilistic model would.  Use `pseudotime_std` and `mean_neighbor_dist` (per `bulkrna_trajblend.py:184-188`) as crude confidence proxies; large neighbour distances mean the bulk sample doesn't cleanly resemble any reference cell.
- **Reference pseudotime values must be supplied externally.**  This skill consumes pseudotime; it does not compute it.  Run `sc-pseudotime` on the reference first (or use a published pre-pseudotimed reference) so the input AnnData has the relevant `obs` column.

## Key CLI

```bash
python omicsclaw.py run bulkrna-trajblend --demo
python omicsclaw.py run bulkrna-trajblend \
  --input bulk_counts.csv --reference scref.h5ad --output results/
```

## See also

- `references/parameters.md` β€” every CLI flag and tuning hint
- `references/methodology.md` β€” NNLS deconvolution + kNN pseudotime mapping; the future-training path the `--n-epochs` flag anticipates
- `references/output_contract.md` β€” exact output directory layout
- Adjacent skills: `bulkrna-deconvolution` (parallel: same NNLS proportions, no pseudotime placement), `bulkrna-geneid-mapping` (run upstream to harmonise gene IDs), `sc-pseudotime` (run upstream on the reference to populate the pseudotime column this skill consumes)

Files in this skill

  • SKILL.md4.1 KB
  • bulkrna_trajblend.py15.7 KB
  • references/methodology.md1.6 KB
  • references/output_contract.md1.4 KB
  • references/parameters.md281 B
  • skill.yaml1.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…