tooluniverse-single-cell

Analyze single-cell RNA-seq data with scanpy from QC gating through clustering and annotation.

1.7k|254|Updated Mar 3, 2025
One-click install
npx skills add https://github.com/mims-harvard/ToolUniverse --skill tooluniverse-single-cell
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tooluniverse-single-cell
Source: https://github.com/mims-harvard/ToolUniverse/tree/main/plugins/tooluniverse/skills/tooluniverse-single-cell
Command: npx skills add https://github.com/mims-harvard/ToolUniverse --skill tooluniverse-single-cell

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires scanpy, anndata, pandas, numpy, scipy, scikit-learn, statsmodels, leidenalg, harmonypy, gseapy, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Single-cell RNA-seq analysis requires many error-prone steps—QC gating, doublet detection, normalization, clustering, marker identification, and cell-type annotation—where wrong thresholds or skipped steps silently corrupt results. This Skill provides a complete, distribution-aware scanpy/AnnData workflow with explicit guidance on choosing thresholds, detecting doublets and ambient RNA, and interpreting results with statistical rigor.

Core Features & Use Cases

  • QC Gating & Filtering: Compute per-cell metrics (n_genes_by_counts, total_counts, pct_counts_mt, pct_counts_ribo), apply MAD-based outlier thresholds, and handle doublets (Scrublet/scDblFinder), ambient RNA (SoupX/DecontX), and empty droplets (EmptyDrops/knee).
  • Full Analysis Pipeline: Normalization, highly variable gene selection, PCA, UMAP/t-SNE, Leiden/Louvain clustering, marker gene identification, and cell-type annotation with Harmony batch correction.
  • Downstream Analysis: Per-cell-type differential expression (Wilcoxon), pseudo-bulk DESeq2, gene-property correlation, cell-cell communication via OmniPath ligand-receptor pairs, and trajectory analysis.
  • Use Case: Given an h5ad file of tumor-infiltrating immune cells, load it, gate out dying cells and doublets, cluster with Leiden, annotate T-cell and myeloid populations using CellMarker references, and identify which cell type has the most treatment-induced DEGs.

Quick Start

Ask the agent to load your h5ad or 10X scRNA-seq file, run QC gating with MAD-based thresholds, cluster the cells, and annotate cell types with marker genes.

Frequently Asked Questions about tooluniverse-single-cell

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a complete scRNA-seq analysis pipeline with scanpy?

Load data with sc.read_h5ad or sc.read_10x_h5, calculate QC metrics and filter cells, normalize with sc.pp.normalize_total and log1p, select highly variable genes, run PCA, then cluster with sc.tl.leiden and visualize with UMAP. Finish with sc.tl.rank_genes_groups for marker identification.

How to choose QC thresholds for single-cell RNA-seq data?

Use MAD-based outlier detection instead of hardcoded cutoffs: flag cells beyond 5 median absolute deviations on log1p counts and genes, and 3 MADs upper-only on mitochondrial percentage paired with a biological ceiling. Always visualize violin and count-vs-mito scatter plots before committing to thresholds.

What is the difference between Leiden and Louvain clustering in scanpy?

Leiden is the recommended method because it guarantees connected communities and better optimization, while Louvain is faster but may produce disconnected clusters. Both accept a resolution parameter where higher values yield more clusters; start at 0.5 and adjust based on biology.

How do I detect doublets in scRNA-seq data?

Run Scrublet via sc.pp.scrublet on raw counts per sample before merging, with expected_doublet_rate around 0.8% per 1,000 cells recovered. Flag cells, cluster, then drop doublets, since real doublets form recognizable bridge clusters between parent cell types.

Should I use single-cell DE or pseudo-bulk DESeq2 for condition comparisons?

Pseudo-bulk DE (aggregating counts by sample, then running R DESeq2) is more statistically valid for condition comparisons because single-cell DE inflates significance by treating non-independent cells from the same sample as replicates. Use single-cell Wilcoxon tests mainly for marker gene finding.

Why do my marker genes appear in every cluster?

Ubiquitous marker expression usually indicates ambient RNA contamination, where cell-free mRNA from lysed cells is co-encapsulated into every droplet. Per-cell QC cannot detect this; apply SoupX or DecontX count correction using the raw and filtered matrices.