K-Dense-AI/scientific-agent-skills / skills/scanpy
scanpy
VerifiedPerforms Scanpy single-cell RNA-seq QC, normalization, HVG selection, PCA/UMAP/t-SNE, clustering, exploratory marker ranking, pseudobulk preparation, visualization, and Seurat or SingleCellExperiment RDS conversion to h5ad. Applies to established exploratory scRNA-seq workflows with explicit count and expression provenance; complementary skills cover scvi-tools models and AnnData format details.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 19.8 KB |
| assets/analysis_template.py | script | 10.0 KB |
| assets/celltype_mapping.json | config | 184 B |
| assets/gene_signatures.json | config | 355 B |
| assets/pipeline_config.json | config | 380 B |
| references/analysis_workflow.md | markdown | 7.6 KB |
| references/api_reference.md | markdown | 9.1 KB |
| references/plotting_guide.md | markdown | 10.5 KB |
| references/r_interop.md | markdown | 11.8 KB |
| references/standard_workflow.md | markdown | 7.0 KB |
| references/upstream-review.md | markdown | 8.3 KB |
| scripts/_common.py | script | 10.0 KB |
| scripts/annotate.py | script | 3.7 KB |
| scripts/batch_correct.py | script | 3.1 KB |
| scripts/cluster.py | script | 2.5 KB |
| scripts/convert.py | script | 1.5 KB |
| scripts/find_markers.py | script | 4.3 KB |
| scripts/inspect_data.py | script | 3.1 KB |
| scripts/plot.py | script | 3.6 KB |
| scripts/preprocess.py | script | 3.5 KB |
| scripts/pseudobulk.py | script | 4.6 KB |
| scripts/qc_analysis.pyexecutable | script | 5.1 KB |
| scripts/reduce_dimensions.py | script | 2.8 KB |
| scripts/run_pipeline.py | script | 9.4 KB |
| scripts/score_genes.py | script | 3.9 KB |
| scripts/subset.py | script | 2.6 KB |
scripts/inspect_data.py
View on GitHub#!/usr/bin/env python3
"""
Inspect an AnnData / single-cell file and print a structured summary.
Reports shape, obs/var columns (with dtypes and category counts), layers,
obsm/varm/uns keys, X dtype and value range, and whether the data looks like
raw counts or normalized values. Use this before analysis to understand an
unfamiliar dataset and decide which pipeline steps still need to run.
Examples:
python inspect_data.py data.h5ad
python inspect_data.py 10x_dir/
"""
import argparse
import numpy as np
from _common import configure_scanpy, info, load_anndata
def _is_integer_matrix(X, n=10000):
from scipy import sparse
if X is None:
return False
arr = X.data[:n] if sparse.issparse(X) else np.asarray(X[:50]).ravel()[:n]
return bool(arr.size and np.isfinite(arr).all() and (arr >= 0).all()
and np.equal(arr, np.floor(arr)).all())
def main():
p = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
p.add_argument("input", help="Input file (.h5ad, .h5, .csv, .loom, or 10x mtx dir)")
p.add_argument("--max-cols", type=int, default=40, help="Max obs/var columns to list")
args = p.parse_args()
configure_scanpy()
adata = load_anndata(args.input)
print("=" * 70)
print(f"AnnData: {adata.n_obs} cells x {adata.n_vars} genes")
print("=" * 70)
X = adata.X
if X is None:
print("\nX is absent; inspect named layers and their provenance")
else:
looks_int = _is_integer_matrix(X)
xmax = float(X.max()) if min(X.shape) else float("nan")
print(f"\nX dtype={X.dtype} max={xmax:.2f}; sampled values are "
f"{'nonnegative integers' if looks_int else 'not count-like'}. "
"This does not establish raw-count provenance.")
print(f"\nobs columns ({len(adata.obs.columns)}):")
for c in adata.obs.columns[:args.max_cols]:
col = adata.obs[c]
from pandas.api.types import is_numeric_dtype
if not is_numeric_dtype(col.dtype):
nuniq = col.nunique()
extra = f" {nuniq} categories" + (f": {list(col.unique()[:8])}" if nuniq <= 8 else "")
else:
extra = f" range=[{col.min():.2f}, {col.max():.2f}]"
print(f" - {c} ({col.dtype}){extra}")
print(f"\nvar columns ({len(adata.var.columns)}): {list(adata.var.columns[:args.max_cols])}")
print(f"\nlayers: {list(adata.layers.keys())}")
print(f"obsm: {list(adata.obsm.keys())}")
print(f"varm: {list(adata.varm.keys())}")
print(f"uns: {list(adata.uns.keys())}")
print(f"raw: {'present' if adata.raw is not None else 'none'}")
done = []
if any(k in adata.obsm for k in ("X_pca",)):
done.append("PCA")
if "neighbors" in adata.uns:
done.append("neighbors")
if "X_umap" in adata.obsm:
done.append("UMAP")
if any(k in adata.obs.columns for k in ("leiden", "louvain")):
done.append("clustering")
print("\nPipeline steps already present: " + (", ".join(done) if done else "none"))
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |