Osp banner
chansigit chansigit

Osp

Development community

Description

Single-sample scRNA-seq QC → clustering/DEG → HTML report, with optional Claude-agent cell-type annotation

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

osp — one-sample-pipeline

Single-sample scRNA-seq QC → clustering/DEG → self-contained HTML report, with an optional Claude-agent step that proposes cell-type annotations and QC actions from the report and the cluster marker tables.

Strictly single-sample by design — one sample per run, no cross-sample batch integration. Loop over samples in an outer driver (e.g. a Slurm job array); treat integration as a separate downstream step.

Install

pip install git+https://github.com/chansigit/osp.git
# with the optional annotation agent (needs claude-agent-sdk + claude CLI credentials):
pip install "osp[agent] @ git+https://github.com/chansigit/osp.git"

Quick usage

from osp import run_one_sample_pipeline, generate_report

ad_fo = adata[adata.obs["sample"] == "FO"]
run_one_sample_pipeline(ad_fo, sample_label="FO", outdir="osp_out/FO")
generate_report("osp_out/FO")

Stepwise calls, if you want more control:

from osp import qc_one_sample, cluster_and_deg, deg_two_groups
  • qc_one_sample — QC only (flags cells, drops nothing)
  • cluster_and_deg — clustering/DEG/PAGA on QC-passed data
  • deg_two_groups — Wilcoxon DEG between any two cell groups, for ad hoc comparisons outside the main pipeline

Command line

python -m osp data.h5ad --sample FO --outdir osp_out          # full pipeline + report
python -m osp data.h5ad --sample FO --outdir osp_out --annotate --model claude-sonnet-5
python -m osp.report osp_out                                   # rebuild the report only

See `examples/run_one_sample.py` for a driver that loads a large h5ad in backed mode and pulls out one sample (for per-sample Slurm array tasks), and `examples/submit_array.sbatch` for the job-array template.

Conventions

  • Raw counts convention: if adata.layers["counts"] exists, X is swapped for it at the start of both the QC and clustering stages — this makes the pipeline robust to inputs where X already holds normalized val