bulkrna-batch-correcti…
Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip…
Load when an external single-cell h5ad/h5/loom/mtx needs to be canonicalised onto the OmicsClaw
$ npx -y skills add tiangzlab/omicsclaw --skill sc-standardize-input --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/sc-standardize-inputContext preview
The summary Claude sees to decide when to auto-load this skill.
Load when an external single-cell h5ad/h5/loom/mtx needs to be canonicalised onto the OmicsClaw
name: sc-standardize-input description: Load when an external single-cell h5ad/h5/loom/mtx needs to be canonicalised onto the OmicsClaw AnnData contract before downstream scRNA skills run. Skip when data already came from sc-count (already canonical); bulk RNA-seq (use bulkrna-qc); spatial (use spatial-preprocess). trigger: standardize AnnData, fix scRNA input, canonicalize single-cell input, prepare AnnData, input contract tags: - singlecell - scrna - input - standardization - anndata
The user has a single-cell expression file from outside OmicsClaw (a public `.h5ad`, a 10X mtx directory, a `.loom`, etc.) and needs the canonical AnnData contract every downstream scRNA skill assumes: raw counts in `layers["counts"]` and `adata.raw`, harmonised feature names, and a `uns["omicsclaw_matrix_contract"]` provenance record. Run this once before `sc-qc` / `sc-preprocessing` / etc.
standardizer = load_skill("sc-standardize-input")
adata = standardizer.standardize(read_input("external.h5ad"), species="human")
write_output(adata, "intermediate/adata_standardized.h5ad")`standardize` returns a new AnnData. It does not filter, normalize or cluster. A runnable PBMC example is in `examples/example_step.py`.
<!-- api:begin generated from _api.py; regenerate with run.py api <skill dir> --write -->
Return a canonical copy with count-like X, layers['counts'] and raw.
Select counts from layers['counts'], aligned raw or X, in that order; harmonize feature names and record the matrix and input contracts.
:param adata: AnnData with at least one count-like expression matrix. :param species: 'auto' uses infer_species; 'human' or 'mouse' overrides it. :returns: A new AnnData. run_info reports the selected matrix and warnings. :raises ValueError: The species is invalid or no count-like matrix is present.
Infer human or mouse from feature names, defaulting to human.
:param adata: AnnData whose feature names or gene-symbol metadata are examined. :returns: The species hint used by standardize(species="auto").
Read standardization diagnostics stored as JSON in adata.uns.
:param adata: The AnnData returned by standardize. :param keep: False removes these diagnostics after reading; default True. :returns: A dictionary, or an empty dictionary before standardize runs.
<!-- api:end -->
`species="auto"` uses the existing gene-name heuristic; use `human` or `mouse` when the organism is known. `infer_species` exposes that heuristic. Counts are selected from `layers["counts"]`, aligned `raw`, then `X`. `run_info` reports the chosen source and any warnings. This method has no random state or optional backend.
**Inputs**
**Outputs**
1. Load via the shared multi-format single-cell loader. 2. Pre-flight: validate non-empty input; auto-detect species from gene name case (UPPER → human, Title → mouse). 3. Pick the best count-like matrix among `layers["counts"]`, `adata.raw`, and `adata.X` (orchestrated by `canonicalize_singlecell_adata` in `skills/singlecell/_lib/adata_utils.py`, which calls the `matrix_looks_count_like` heuristic at `_lib/adata_utils.py`). 4. Harmonise feature names (Ensembl ↔ symbol, deduplicate). 5. Persist `uns["omicsclaw_input_contract"]` + `uns["omicsclaw_matrix_contract"]`. 6. Save `processed.h5ad`; emit `report.md` + `result.json`.
Check `run_info(adata)["expression_source"]` and `warnings`, or the CLI's `result.json["summary"]`, before downstream normalization.
# Demo (built-in PBMC3K) python skills/singlecell/scrna/sc-standardize-input/sc_standardize_input.py --demo --output /tmp/sc_std_demo # Real run with species hint python skills/singlecell/scrna/sc-standardize-input/sc_standardize_input.py \ --input external.h5ad --output results/ --species mouse
Python packages this skill's script needs. They are not installed for you — check before a long run.
`anndata`, `matplotlib`, `numpy`, `pandas`, `scanpy`, `scipy`
Conversational & memory-enabled AI research partner for multi-omics analysis. CLI + Desktop App (installers in Releases). From biological idea to full research paper.
Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip…
Load when discovering bulk gene co-expression modules and hub genes with R WGCNA. Skip direct expression contrasts (use…
Load when comparing gene expression between two conditions in bulk RNA-seq count data. Skip
Load when estimating cell-type proportions in bulk RNA-seq samples from a single-cell or
Load when running pathway / GO term enrichment on a bulk RNA-seq DE result list. Skip when
Load when converting Ensembl, Entrez or symbol IDs in a bulk RNA count matrix using an explicit mapping or a small human demo…