annotation-workflows
Run CellTypist prediction and annotation workflows from Python or CLI for tables, Matrix Market, h5ad, and AnnData.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- annotation-workflows
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Run CellTypist prediction and annotation workflows from Python or CLI for tables, Matrix Market, h5ad, and AnnData.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/api-reference.md6.1 KB
- 参考文档references/cli-reference.md4.2 KB
- 参考文档references/data-formats.md5.0 KB
- 参考文档references/troubleshooting.md6.7 KB
- 脚本scripts/annotation_smoke.py13.0 KB
03 SKILL.md 正文
CellTypist Annotation Workflows
Use this sub-skill when a task is about assigning CellTypist labels to query cells, validating annotation inputs, exporting prediction tables, or choosing between Python and CLI prediction workflows.
Route quickly
- Use API reference for
celltypist.annotate,Classifier,AnnotationResult, best-match vs probability-match modes, majority voting, and result shapes. - Use data formats before running annotation on count tables, Matrix Market files,
.h5ad, or in-memoryAnnData. - Use CLI reference when the user wants
celltypist --indata ...commands, output flags, or batchable shell patterns. - Use troubleshooting for missing
.mtxsidecar files, transposed matrices, normalization errors, model-feature mismatches, output-folder failures, majority-voting skips, GPU fallback, and cache/network surprises. - Run annotation_smoke.py to create a tiny local model and query table in a temporary directory, annotate without network downloads, and verify prediction/result-table shapes.
Stay in scope
- Keep model download, cache inventory, model conversion, model subsetting, and marker extraction in model-management.
- Keep custom model training and downsampling strategy in training-and-custom-models; this sub-skill only uses a tiny synthetic model for smoke checks.
- Keep dotplots, UMAP figures, presentation plots, and result interpretation in visualization-and-results.
Default annotation pattern
Prefer an explicit local model path or loaded Model object when the user needs offline behavior. Leaving model=None or using built-in model names can consult CellTypist's model cache and may require network access if the cache is empty.
import celltypist
predictions = celltypist.annotate(
"query_counts.csv",
model="local_model.pkl",
mode="best match",
)
predictions.to_table(folder="results", prefix="query_")
adata = predictions.to_adata(insert_labels=True, insert_conf=True, insert_prob=True)
For CLI workflows, create the output directory first and use CLI mode names with underscores:
mkdir -p results
celltypist --indata query_counts.csv --model local_model.pkl --outdir results --prefix query_ --quiet
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).