Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

sc-multi-count

FreeNo executable scriptsNot checked

Merge multiple single-sample scRNA-seq count matrices (from sc-count) into one downstream-ready AnnData with sample labels.

mdbabumiamssmby mdbabumiamssm★ 36 GitHub stars

About this skill

Multi-Sample Count Merge

You are SC Multi-Count, a specialized OmicsClaw agent for merging multiple single-sample scRNA-seq count matrices into one downstream-ready AnnData.

Why This Exists

  • Without it: users manually concatenate AnnData objects, handle barcode collisions, and lose provenance metadata.
  • With it: one command merges count outputs from sc-count, labels each cell with its sample of origin, and writes a standardized processed.h5ad.
  • Why OmicsClaw: preserves the same contract (layers['counts'], input contract, matrix contract) that downstream skills expect.

Core Capabilities

  1. Multi-sample merge: outer-join concatenation with barcode prefixing.
  2. Sample labeling: writes obs['sample_id'] for downstream batch correction or per-sample comparison.
  3. Stable downstream contract: writes processed.h5ad with layers['counts'] and OmicsClaw input-contract metadata.
  4. Standard output layer: barcode-rank, count-distribution, and sample-composition figures plus machine-readable tables.
  5. Reproducibility layer: writes README.md, report.md, result.json, and rerun commands.

Input Formats

Format Extension Required Fields / Structure Example
Multiple H5AD .h5ad each from sc-count output --input s1/processed.h5ad --input s2/processed.h5ad
Demo n/a --demo flag built-in split of PBMC demo

Data / State Requirements

Requirement Where it should exist Why it matters
Per-sample count H5AD --input (repeated) each must be a count-level AnnData
Sample labels --sample-id or inferred needed for obs['sample_id']

Workflow

  1. Load: read each input H5AD and tag with sample ID.
  2. Validate: check at least two inputs; warn on barcode collisions.
  3. Merge: outer-join concatenation with barcode prefixing to avoid collisions.
  4. Standardize: create layers['counts'], record OmicsClaw contracts.
  5. Visualize: barcode-rank, count distributions, complexity scatter, sample composition.
  6. Report: write report.md, result.json, and reproducibility bundle.
  7. Export: write processed.h5ad.

CLI Reference

# Merge two sc-count outputs
oc run sc-multi-count \
  --input sample1/processed.h5ad \
  --input sample2/processed.h5ad \
  --output merged/

# With explicit sample IDs
oc run sc-multi-count \
  --input s1/processed.h5ad --sample-id Patient_A \
  --input s2/processed.h5ad --sample-id Patient_B \
  --output merged/

# Demo mode
python omicsclaw.py run sc-multi-count --demo --output /tmp/sc_multi_count_demo

Example Queries

  • "把这两个样本的 count 矩阵合并到一起"
  • "merge these two sc-count outputs"
  • "多样本计数矩阵合并"

Algorithm / Methodology

Merge Path

  1. Load samples: read each processed.h5ad, prefix barcodes with sample ID.
  2. Outer-join concatenation: union of gene sets, zero-fill for missing genes.
  3. Standardize: write layers['counts'], adata.raw, and OmicsClaw contracts.
  4. Quality checks: detect empty samples, extreme imbalance, zero cells.

Key parameters:

Parameter Default Description
--input required path to a processed.h5ad (repeat for each sample)
--sample-id inferred explicit sample label (repeat, matching order of --input)

Visualization Contract

  1. Python standard gallery: barcode-rank, count distributions, complexity scatter, sample composition.
  2. Figure-ready exports: barcode metrics and per-sample summary under figure_data/.
  3. Gallery manifest: figures/manifest.json.

Output Structure

output_directory/
├── README.md
├── report.md
├── result.json
├── processed.h5ad
├── standardized_input.h5ad -> processed.h5ad
├── figures/
│   ├── barcode_rank.png
│   ├── count_distributions.png
│   ├── count_complexity_scatter.png
│   ├── sample_composition.png
│   └── manifest.json
├── tables/
│   ├── barcode_metrics.csv
│   └── per_sample_summary.csv
├── figure_data/
│   ├── manifest.json
│   ├── barcode_metrics.csv
│   └── per_sample_summary.csv
└── reproducibility/
    ├── analysis_notebook.ipynb
    ├── commands.sh
    └── requirements.txt

Workflow Position

  • Upstream step: sc-count (run once per sample to produce individual processed.h5ad files)
  • Usual next step: sc-qc for quality assessment on the merged object

Recommended Next Steps

  • sc-qc or sc-preprocessing on the merged processed.h5ad.
  • sc-batch-integration if samples have batch effects.

Dependencies

Required:

  • Python 3
  • scanpy, anndata, pandas, numpy, matplotlib

CLI Parameters

Flag Type Default Description
--input path (repeatable) — Path to a processed.h5ad from sc-count; repeat once per s
Full SKILL.md on GitHub

Install sc-multi-count in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the sc-multi-count skill do?

Merge multiple single-sample scRNA-seq count matrices (from sc-count) into one downstream-ready AnnData with sample labels.

How do I install the sc-multi-count skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the sc-multi-count skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare sc-multi-count with