celltype_annotation
Single-cell cell-type annotation + report (v2 — stability-selected resolution, raw-expression label confirmation, preranked GSEA)
Skill by RCHENLAB
Chalk Labs
Need help deploying celltype_annotation?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/rchenlab-celltype-annotation
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/celltype-annotation
What's inside
- Skill name
celltype_annotation- Description
- Single-cell cell-type annotation + report (v2 — stability-selected resolution, raw-expression label confirmation, preranked GSEA)
- License
- MIT
- Instructions
- 129 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- name: only lowercase letters, digits and single hyphens allowed
Files (2)
- PROTOCOL.md
- SKILL.md
SKILL.md (first lines)
Canonical marker-based single-cell cell-type annotation protocol. Use when the goal is to
assign a cell-type label to each cluster of an scRNA-seq dataset by reading its marker genes.
Adapt the parameters to THIS dataset; plan ordered steps that:
0. **Establish what the matrix IS, and the rules, before touching it** (`run_code`) — read-only,
and BEFORE any normalization. Two outputs, both written as tables the later steps read back:
* *Provenance.* **Not for a 10x Cell Ranger input whose data profile already rules on it**
(its `.h5` matrices were read at upload: integer UMI counts, checked against Cell Ranger's
`metrics_summary.csv`). Cite that ruling; do NOT plan a `run_code` step to re-derive it, and
write the decision rule below into the plan's first step instead. Otherwise: inspect `X`,
`.raw`, `layers`, value ranges, sparsity and integer-ness, and check whether matrix-derived
totals reproduce any stored `nCount`/`nFeature` fields. A
published object often arrives already normalized and log1p'd: normalizing it again has NO
symptom — every tool succeeds, every figure renders, and every number after it is wrong. So
rule from the NUMBERS, and say which way you ruled:
- **Counts.** Every value non-negative and integer-valued to tolerance, the row sums
reproduce a stored total-count field (`nCount_RNA`, `total_counts`), the per-row non-zero
counts reproduce the stored detected-feature field, and no `layers`/`.raw` entry carries a
different scale. **That is sufficient — proceed.** An empty `uns` and a missing
transformation history are a LIMITATION TO REPORT, not a stop condition: a matrix that
reproduces its own stored QC fields exactly is not made unusable by the absence of a
written record, and stopping there forfeits the whole quantitative analysis over a
provenance note.
- **Not counts.** Any negative or non-integer value, row sums that do not reproduce the
stored totals, or a differently-scaled representation present. Then say so and drop the
count-dependent steps — never recover counts by exponentiating, rounding, or renaming.
State which representation supports which operation (linear-scale fold changes, detection
fractions, count-based tests) and which of the two rulings you applied.
* *The decision rule.* Name the primary estimand, the unit of replication, the minimum
support per group (cells per arm, per cluster), and the effect-size gate — and write them
down NOW, while no differential or marker result is visible yet. A threshold chosen after
seeing which one flatters the answer is not a threshold. Say what happens when a gate
FAILS: the estimate is marked unsupported and omitted, not softened until it passes.
1. QC the dataset (`run_scanpy_qc` for one matrix; `run_cellqc` INSTEAD when the data profile says the input is a folder of 10x Cell Ranger outputs (raw + filtered matrices): it corrects ambient RNA, removes doublets and writes the same normalised checkpoint): per-cell metrics, filter low-quality cells/genes,
normalize + log1p + HVG. Report pre/post counts. For snRNA-seq, a few hundred UMIs per
nucleus is EXPECTED — do not treat it as a failed run and do not filter it away.
1b. **Doublets** (`run_doublet_detection`): two cells in one droplet express both parents'
programmes and form an "intermediate" cluster that reads as a novel transitional cell type.
Run this before clustering. Report the rate. SKIP it after `run_cellqc`, which already called
and removed the doublets (DoubletFinder, with scDblFinder as a second opinion).
1c. **Integration** (`run_integration`) — REQUIRED when the object holds more than one sample.
Check the obs profile for a donor/sample/batch column first. Without it the cells cluster by
donor and every label below is really a donor label, with no visible symptom. Report
`method_used` and the before/after batch silhouette; if the tool returns a warning that the
batches did not mix, say so rather than proceeding as if they had.
2. Cluster the cells (`run_clustering`) with **`select_resolution: true`**. Every label
assigned later inherits this partition, so the resolution is chosen by bootstrap stability
(the finest resolution whose clusters still reproduce under resampling, scored by ARI),
not left at the default. Report the selected resolution AND how it was selected
(`resolution_source`), and sanity-check it against biology: the major lineages of the
panel should come apart.
3. Find marker genes per cluster (`run_de`): Wilcoxon `rank_genes_groups`. This also writes
the complete tested universe and a full ranked list per cluster, which steps 4-5 need.
4. Pathway context — `run_enrichment` (ORA over the significant markers, against the tested
universe as background) and `run_gsea_prerank` (preranked GSEA over the whole ranking).
Run BOTH when pathway interpretation matters: ORA tests the SIGNIFICANT set (every gene
passing `padj` and `lfc` — not a top-N of it, which would make the input size differ per
cluster and the results incomparable), GSEA walks the entire ranking and returns a signed
NES, so GSEA can see coordinated shifts that no per-gene cutoff keeps. They use different inputs and different null hypotheses, so **do
not require them to agree**, and do not report disagreement as an error in either.
5. Assign a cell-type label to each cluster with **`run_marker_annotation`**. For a tissue with a
curated reference (retina, human or mouse) pass `reference: "retina"` and NO panel: the
markers then come from the curated reference, not from memory (a model-written retina panel
once labelled 1,631 Muller glia "Unassigned"/"ganglion"). Otherwise pass a `panel` and
`discriminators` built for THIS tissue (the `annotate_clusters_by_markers_v2` skill explains
how to build them and why the discriminator list is not just the panel again).
Signature scores are a first pass only: the z-scored argmax confidently mislabels lineages
that share markers, so the final call comes from raw marker expression, and a cluster with
no dominant coherent signal stays `Unassigned` rather than being forced into the nearest
label. A label whose lineage-specific markers are not enriched in the cluster is WITHDRAWN.
Report which clusters the raw check CORRECTED, which were withdrawn or stayed unassigned, the
tool's warnings, and its composition notes (e.g. a lineage absent because the sample was
depleted of it).
5b. **Composition** (`run_composition`): the proportion each label makes up, per sample.
6. Produce figures: a UMAP colored by cluster and by assigned cell type, and violin/dot plots
of canonical marker genes.
6b. **Literature grounding** (`literature_search`) — OPTIONAL, and its own step: plan it ONLY when the user asks for literature, references or citations; otherwise leave it out and offer it as a follow-up.
When it is planned: search on the cell types, markers and pathway terms the analysis actually
surfaced. The manuscript's `## References` are built ONLY from an ACCEPTED literature step, so
a run without one has no reference list, and its report says so.
7. Do NOT plan a report-WRITING or rendering step — the methods + results report is assembled
automatically from the accepted results. That is about writing it, NOT about interpreting:
the enrichment (step 4) evidence is still part of a whole analysis.
Ground every label in the marker genes the tools actually returned. Do not fabricate cell
types, gene names, or numbers a tool did not return; if a step's tool errors, report it
honestly rather than inventing a result.
Reporting discipline — these belong in the write-up, not only in the logs:
- the marker panel used and where it came from;
- the resolution and how it was chosen;
- every cluster the raw-expression check corrected away from its first-pass label;
- every `Unassigned` cluster, with its cell count;
- the ORA background actually used (the tested universe, not a round number) and the GSEA
parameters (set-size limits, permutations, seed);
- **null findings.** A group where nothing cleared FDR is a result and stays in the report.
**Pathway analysis: use `run_enrichment` / `run_gsea_prerank` when the design supports them, and
when it does not, still take the gene sets from disk.** Both tools read `.gmt` libraries that are
ALREADY ON DISK next to the tools — GO_Biological_Process_2023, Reactome_2022, MSigDB_Hallmark_2020
(`AISCIENTIST_GENESETS_DIR` overrides the location) — offline, no download, no network. But both also
consume `run_de`'s output table and return ORA/GSEA p-values and FDR. A design with no biological
replication forbids exactly those p-values and therefore often skips `run_de` entirely, which
leaves both tools unusable through no fault of the plan. That is NOT a reason to go to the network:
run 3c5fbc8608a7 hand-rolled a p-value-free pathway score, went looking for a collection to fetch,
hit the confirmation guarding downloads from non-allowlisted hosts, was declined, and recorded
`"collection_status": "no verified authorized species-compatible collection"` — with three verified
libraries sitting in the directory the tools read. When you compute a pathway summary yourself,
read the `.gmt` files from that same local directory and say in the step that you did.
Enrichment is association with an expression programme — not evidence of pathway activity,
and not evidence of causation. Word it that way.
**Sensitivity analyses may not be shopped.** When a step re-runs the analysis under a different
QC cutoff, depth standardization, mixture or annotation, the PRIMARY estimate stays primary. A
variant is never promoted because it produced a larger effect, a cleaner figure, or a more
attractive biology — report the variants side by side with the cell mass each retains, and let
them disagree. The purpose is to show how much the answer depends on a choice, not to find theFrom RCHENLAB/AiScientist, MIT.
More from RCHENLAB/AiScientist
- 0.563score
perturbation_analysis
RCHENLAB
Analyze a pooled CRISPR / Perturb-seq screen — rank which perturbations change the transcriptome, then per-perturbation DE vs the non-targeting control
SkillAFreshness: AClaude Code +9 - 0.563score
variant_annotation
RCHENLAB
Interpret a VCF's variants (germline/somatic, WGS/WES) — gene + functional consequence (Ensembl VEP), ClinVar pathogenicity, gnomAD frequency, deleteriousness…
SkillAFreshness: AClaude Code +9 - 0.560score
annotate_clusters_by_markers_v2
RCHENLAB
Assign a cell-type label to each cluster from a curated marker panel, using signature scoring for a first pass and RAW marker expression to make the final call.
SkillAFreshness: AClaude Code +9 - 0.560score
scgpt_annotation
RCHENLAB
scGPT foundation-model per-cell annotation for a .h5ad — transfers reference cell-type labels + calibrated confidence to every cell, AND independently…
SkillAFreshness: AClaude Code +9 - 0.557score
score_signature
RCHENLAB
Reference template — score every cell for one or more gene signatures with scanpy `sc.tl.score_genes` (signature mean minus a matched random control set)…
SkillAFreshness: AClaude Code +9 - 0.557score
differential_expression
RCHENLAB
Compare an experimental condition vs control (e.g.
SkillAFreshness: AClaude Code +9 - 0.557score
clinical_variant_prioritization
RCHENLAB
Reference template — assign a research-triage priority tier (pathogenic → VUS → benign) per variant from ClinVar + gnomAD AF (disease-model thresholds) +…
SkillAFreshness: AClaude Code +9 - 0.557score
normalize_vcf
RCHENLAB
Reference template — normalize a VCF (split multiallelic, atomize MNPs, left-align indels) with bcftools norm before annotation or ClinVar/gnomAD matching.
SkillAFreshness: AClaude Code +9 - 0.557score
atlas_disease_genes
RCHENLAB
Reference template — prioritize disease-associated genes by combining condition differential expression with a precalculated cell-type atlas.
SkillAFreshness: AClaude Code +9 - 0.554score
perturbation_edistance
RCHENLAB
Reference template — rank perturbations by E-distance to control (which guides actually did something).
SkillAFreshness: AClaude Code +9 - 0.554score
condition_by_celltype
RCHENLAB
Reference template — condition-vs-control differential expression, STRATIFIED BY CELL TYPE.
SkillAFreshness: AClaude Code +9 - 0.549score
pairwise_de
RCHENLAB
Reference template — pairwise differential expression between two named groups.
SkillAFreshness: AClaude Code +9
Signals
- Stars
- 0
- Forks
- 3
- Open issues
- 16
- Last commit (this folder)
- Oct 13, 2026 (16 days ago)
- Last release
- Oct 19, 2026 (10 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/RCHENLAB/AiScientist
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from RCHENLAB
- 0.563score
perturbation_analysis
RCHENLAB
Analyze a pooled CRISPR / Perturb-seq screen — rank which perturbations change the transcriptome, then per-perturbation DE vs the non-targeting control
SkillAFreshness: AClaude Code +9 - 0.563score
variant_annotation
RCHENLAB
Interpret a VCF's variants (germline/somatic, WGS/WES) — gene + functional consequence (Ensembl VEP), ClinVar pathogenicity, gnomAD frequency, deleteriousness…
SkillAFreshness: AClaude Code +9 - 0.560score
scgpt_annotation
RCHENLAB
scGPT foundation-model per-cell annotation for a .h5ad — transfers reference cell-type labels + calibrated confidence to every cell, AND independently…
SkillAFreshness: AClaude Code +9 - 0.560score
annotate_clusters_by_markers_v2
RCHENLAB
Assign a cell-type label to each cluster from a curated marker panel, using signature scoring for a first pass and RAW marker expression to make the final call.
SkillAFreshness: AClaude Code +9 - 0.557score
differential_expression
RCHENLAB
Compare an experimental condition vs control (e.g.
SkillAFreshness: AClaude Code +9 - 0.557score
atlas_disease_genes
RCHENLAB
Reference template — prioritize disease-associated genes by combining condition differential expression with a precalculated cell-type atlas.
SkillAFreshness: AClaude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get celltype_annotation running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
celltype_annotation skill. Agent Mart. https://agentmart.dev/skills/rchenlab-celltype-annotation (last updated 2026-10-24)