Sc count

From TianGzlab/OmicsClaw · View interactive version

Sc count is an AI agent skill from the GitHub repository TianGzlab/OmicsClaw. Load when turning scRNA FASTQ (or existing CellRanger/STARsolo/SimpleAF/kb-python output) into a downstream-ready AnnData. Skip when reads are already counted into AnnData (use sc-standardize-input); raw quality assessment only (use sc-fastq-qc).

How to use this skill

Skill file

sc-count

Use from a step

This is CLI_ONLY: counting needs external tools and reference indexes.

from skills._sdk.notebook import run_cli

run_cli("sc-count", "--input", "data/sample_R1.fastq.gz",
        "--read2", "data/sample_R2.fastq.gz", "--method", "starsolo",
        "--reference", "/refs/star", "--chemistry", "10xv3",
        "--whitelist", "/refs/barcodes.tsv",
        inputs=["data/sample_R1.fastq.gz", "data/sample_R2.fastq.gz",
                "/refs/barcodes.tsv"])

Record the reference index version in the module README as well. The demo

standardizes PBMC3k raw counts; it does not align or count reads. There is

no _api.py for this skill.

When to use

The user has FASTQ files (or pre-existing tool output directories) and

wants per-cell counts in OmicsClaw's canonical AnnData contract. Four

backends share one CLI: cellranger, starsolo, simpleaf,

kb_python. When passed a matching already-counted directory the skill

re-canonicalises rather than re-counts. Pairs with sc-fastq-qc

upstream (read QC) and sc-multi-count downstream (merging multiple

samples).

Inputs & Outputs

Inputs

Outputs

Flow

  1. Resolve --input; if it's an existing CellRanger / STARsolo / SimpleAF / kb-python output dir, re-canonicalise instead of running the backend.
  2. Otherwise validate backend prerequisites (chemistry, reference, t2g for kb-python, whitelist for STARsolo).
  3. Run the chosen backend against the FASTQ (and --read2 if explicit).
  4. Load the resulting matrix into AnnData; canonicalise (layers["counts"], adata.raw, gene-name harmonisation).
  5. Render barcode-rank + count-distribution figures.
  6. Emit processed.h5ad + report.md + result.json.

Gotchas

Key CLI

# Demo (standardizes PBMC3k counts; no counting backend)
python skills/singlecell/scrna/sc-count/sc_count.py --demo --output /tmp/sc_count_demo

# CellRanger over FASTQ
python skills/singlecell/scrna/sc-count/sc_count.py \
  --input fastq_dir/ --output results/ \
  --reference cellranger_transcriptome --threads 16

# STARsolo (requires explicit chemistry)
python skills/singlecell/scrna/sc-count/sc_count.py \
  --input fastq_dir/ --output results/ \
  --method starsolo --reference star_genome_dir --chemistry 10xv3 --whitelist barcodes.tsv

# Re-canonicalise an existing CellRanger output directory
python skills/singlecell/scrna/sc-count/sc_count.py \
  --input cellranger_output_dir/ --output results/

See also

Dependencies

Python packages this skill's script needs. They are not installed for you — check before a long run.

anndata, matplotlib, numpy, pandas, scanpy, scipy, seaborn

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.