[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DAXEGTDMDSNEZNVFH8Q99G":3,"skill-same:01M6DAXEGTDMDSNEZNVFH8Q99G":108},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":27,"linkOnly":28,"markdownContent":29,"markdownBody":30,"frontMatter":31,"refName":32,"commitSha":33,"skillDirectory":34,"forksCount":14,"repositoryHtmlUrl":35,"repositoryHomepageUrl":6,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":37,"install":38,"resources":51},"01M6DAXEGTDMDSNEZNVFH8Q99G","tooluniverse-single-cell",null,"Use when analyzing single-cell RNA-seq expression matrices, clustering cells, annotating cell types, or studying cell-cell communication.","Prekzursil\u002Fagent-skills-toolchain","Prekzursil","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F54636077?v=4","01M6DACZ1PCQHD99SCR1YXG28B","Andrei Mihai Visalon","01M6DACZ670WZF535V3WYYSS4Z",0,"MIT","https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002F.agents\u002Flibrary\u002Fskills\u002Ftooluniverse-single-cell\u002FSKILL.md",[],[19,20,21,22,23,24,25,26],"cell","tooluniverse single cell","communication","analyzing","clustering","use","RNA","matrices","2026-11-10 10:12:30",false,"---\nname: tooluniverse-single-cell\ndescription: Use when analyzing single-cell RNA-seq expression matrices, clustering cells, annotating cell types, or studying cell-cell communication.\n---\n\n# Single-Cell Genomics and Expression Matrix Analysis\n\nComprehensive single-cell RNA-seq analysis and expression matrix processing using scanpy, anndata, scipy, and ToolUniverse.\n\n---\n\n## LOOK UP, DON'T GUESS\nWhen uncertain about any scientific fact, SEARCH databases first (PubMed, UniProt, ChEMBL, ClinVar, etc.) rather than reasoning from memory. A database-verified answer is always more reliable than a guess.\n\n---\n\n## When to Use This Skill\n\nApply when users:\n- Have scRNA-seq data (h5ad, 10X, CSV count matrices) and want analysis\n- Ask about cell type identification, clustering, or annotation\n- Need differential expression analysis by cell type or condition\n- Want gene-expression correlation analysis (e.g., gene length vs expression by cell type)\n- Ask about PCA, UMAP, t-SNE for expression data\n- Need Leiden\u002FLouvain clustering on expression matrices\n- Want statistical comparisons between cell types (t-test, ANOVA, fold change)\n- Ask about marker genes, batch correction, trajectory, or cell-cell communication\n\n**BixBench Coverage**: 18+ questions across 5 projects (bix-22, bix-27, bix-31, bix-33, bix-36)\n\n**NOT for** (use other skills instead):\n- Bulk RNA-seq DESeq2 only -> `tooluniverse-rnaseq-deseq2`\n- Gene enrichment only -> `tooluniverse-gene-enrichment`\n- VCF\u002Fvariant analysis -> `tooluniverse-variant-analysis`\n\n---\n\n## Core Principles\n\n1. **Data-first** - Load, inspect, validate before analysis\n2. **AnnData-centric** - All data flows through anndata objects\n3. **Cell type awareness** - Per-cell-type subsetting when needed\n4. **Statistical rigor** - Normalization, multiple testing correction, effect sizes\n5. **Question-driven** - Parse what the user is actually asking\n\n---\n\n## Required Packages\n\n```python\nimport scanpy as sc, anndata as ad, pandas as pd, numpy as np\nfrom scipy import stats\nfrom scipy.cluster.hierarchy import linkage, fcluster\nfrom sklearn.decomposition import PCA\nfrom statsmodels.stats.multitest import multipletests\nimport gseapy as gp  # enrichment\nimport harmonypy     # batch correction (optional)\n```\n\nInstall: `pip install scanpy anndata leidenalg umap-learn harmonypy gseapy pandas numpy scipy scikit-learn statsmodels`\n\n---\n\n## Workflow Decision Tree\n\n```\nSTART: User question about scRNA-seq data\n|\n+-- FULL PIPELINE (raw counts -> annotated clusters)\n|   Workflow: QC -> Normalize -> HVG -> PCA -> Cluster -> Annotate -> DE\n|   See: references\u002Fscanpy_workflow.md\n|\n+-- DIFFERENTIAL EXPRESSION (per-cell-type comparison)\n|   Most common BixBench pattern (bix-33)\n|   See: analysis_patterns.md \"Pattern 1\"\n|\n+-- CORRELATION ANALYSIS (gene property vs expression)\n|   Pattern: Gene length vs expression (bix-22)\n|   See: analysis_patterns.md \"Pattern 2\"\n|\n+-- CLUSTERING & PCA (expression matrix analysis)\n|   See: references\u002Fclustering_guide.md\n|\n+-- CELL COMMUNICATION (ligand-receptor interactions)\n|   See: references\u002Fcell_communication.md\n|\n+-- TRAJECTORY ANALYSIS (pseudotime)\n    See: references\u002Ftrajectory_analysis.md\n```\n\n**Data format handling**:\n- h5ad -> `sc.read_h5ad()`\n- 10X -> `sc.read_10x_mtx()` or `sc.read_10x_h5()`\n- CSV\u002FTSV -> `pd.read_csv()` -> Convert to AnnData (check orientation!)\n\n---\n\n## Data Loading\n\nAnnData expects: **cells\u002Fsamples as rows (obs), genes as columns (var)**\n\n```python\nadata = sc.read_h5ad(\"data.h5ad\")  # h5ad already oriented\n\n# CSV\u002FTSV: check orientation\ndf = pd.read_csv(\"counts.csv\", index_col=0)\nif df.shape[0] > df.shape[1] * 5:  # genes > samples by 5x => transpose\n    df = df.T\nadata = ad.AnnData(df)\n\n# Load metadata\nmeta = pd.read_csv(\"metadata.csv\", index_col=0)\ncommon = adata.obs_names.intersection(meta.index)\nadata = adata[common].copy()\nfor col in meta.columns:\n    adata.obs[col] = meta.loc[common, col]\n```\n\n---\n\n## Quality Control\n\n```python\nadata.var['mt'] = adata.var_names.str.startswith(('MT-', 'mt-'))\nsc.pp.calculate_qc_metrics(adata, qc_vars=['mt'], inplace=True)\nsc.pp.filter_cells(adata, min_genes=200)\nadata = adata[adata.obs['pct_counts_mt'] \u003C 20].copy()\nsc.pp.filter_genes(adata, min_cells=3)\n```\n\nSee: references\u002Fscanpy_workflow.md for details\n\n---\n\n## Complete Pipeline (Quick Reference)\n\n```python\nimport scanpy as sc\n\nadata = sc.read_10x_h5(\"filtered_feature_bc_matrix.h5\")\n\n# QC\nadata.var['mt'] = adata.var_names.str.startswith('MT-')\nsc.pp.calculate_qc_metrics(adata, qc_vars=['mt'], inplace=True)\nadata = adata[adata.obs['pct_counts_mt'] \u003C 20].copy()\nsc.pp.filter_cells(adata, min_genes=200)\nsc.pp.filter_genes(adata, min_cells=3)\n\n# Normalize + HVG + PCA\nsc.pp.normalize_total(adata, target_sum=1e4)\nsc.pp.log1p(adata)\nadata.raw = adata.copy()\nsc.pp.highly_variable_genes(adata, n_top_genes=2000)\nsc.tl.pca(adata, n_comps=50)\n\n# Cluster + UMAP\nsc.pp.neighbors(adata, n_pcs=30)\nsc.tl.leiden(adata, resolution=0.5)\nsc.tl.umap(adata)\n\n# Find markers + Annotate + Per-cell-type DE\nsc.tl.rank_genes_groups(adata, groupby='leiden', method='wilcoxon')\n```\n\n---\n\n## Differential Expression Decision Tree\n\n```\nSingle-Cell DE (many cells per condition):\n  Use: sc.tl.rank_genes_groups(), methods: wilcoxon, t-test, logreg\n  Best for: Per-cell-type DE, marker gene finding\n\nPseudo-Bulk DE (aggregate counts by sample):\n  Use: DESeq2 via PyDESeq2\n  Best for: Sample-level comparisons with replicates\n\nStatistical Tests Only:\n  Use: scipy.stats (ttest_ind, f_oneway, pearsonr)\n  Best for: Correlation, ANOVA, t-tests on summaries\n```\n\n---\n\n## Statistical Tests (Quick Reference)\n\n```python\nfrom scipy import stats\nfrom statsmodels.stats.multitest import multipletests\n\n# Pearson\u002FSpearman correlation\nr, p = stats.pearsonr(gene_lengths, mean_expression)\n\n# Welch's t-test\nt_stat, p_val = stats.ttest_ind(group1, group2, equal_var=False)\n\n# ANOVA\nf_stat, p_val = stats.f_oneway(group1, group2, group3)\n\n# Multiple testing correction (BH)\nreject, pvals_adj, _, _ = multipletests(pvals, method='fdr_bh')\n```\n\n---\n\n## Batch Correction (Harmony)\n\n```python\nimport harmonypy\nsc.tl.pca(adata, n_comps=50)\nho = harmonypy.run_harmony(adata.obsm['X_pca'][:, :30], adata.obs, 'batch', random_state=0)\nadata.obsm['X_pca_harmony'] = ho.Z_corr.T\nsc.pp.neighbors(adata, use_rep='X_pca_harmony')\nsc.tl.leiden(adata, resolution=0.5)\nsc.tl.umap(adata)\n```\n\n---\n\n## ToolUniverse Integration\n\n### Data Discovery (before analysis)\n- **CxGDisc_search_datasets**: Search CELLxGENE Discover for scRNA-seq datasets by disease, tissue, organism. Use broad disease terms (e.g., \"breast cancer\" not \"triple-negative\").\n- **GEO_search_rnaseq_datasets** \u002F **geo_search_datasets**: Search GEO for scRNA-seq studies\n- **NCBI_SRA_search_runs**: Search SRA for sequencing runs (query=\"single cell RNA-seq [disease]\")\n- **OmicsDI_search_datasets**: Cross-repository dataset search\n\n### Cell Type Markers\n- **CellMarker_search_by_cell_type**: Tissue-specific cell markers (use `CellMarker_list_cell_types` first — exact names required, e.g., \"Regulatory T(Treg) cell\" not \"Regulatory T cell\")\n- **CellMarker_search_cancer_markers**: Cancer-context markers with experimental evidence\n- **CellMarker_search_by_gene**: Reverse lookup — which cell types express a gene?\n- **HPA_search_genes_by_query**: Cell-type marker gene search\n\n### Gene Annotation\n- **MyGene_query_genes** \u002F **MyGene_batch_query**: Gene ID conversion\n- **ensembl_lookup_gene**: Ensembl gene details\n- **UniProt_get_function_by_accession**: Protein function\n\n### Cell-Cell Communication\n- **OmniPath_get_ligand_receptor_interactions**: L-R pairs (CellPhoneDB, CellChatDB)\n- **OmniPath_get_signaling_interactions**: Downstream signaling\n- **OmniPath_get_complexes**: Multi-subunit receptors\n\n### Enrichment (Post-DE)\n- **PANTHER_enrichment**: GO enrichment (BP, MF, CC)\n- **STRING_functional_enrichment**: Network-based enrichment\n- **ReactomeAnalysis_pathway_enrichment**: Reactome pathways\n\n### Clinical Context (for tumor immunology)\n- **DGIdb_get_drug_gene_interactions**: Drug interactions for immune checkpoint targets (genes=[\"CD274\"] for PD-L1)\n- **civic_search_evidence_items**: Clinical evidence for mutations\u002Fbiomarkers\n- **TIMER2_immune_estimation**: TCGA immune infiltration correlation\n- **search_clinical_trials**: Clinical trial matching\n- **GTEx_get_expression_summary**: Normal tissue baseline expression\n- **PubMed_search_articles**: Literature context\n\n---\n\n## Scanpy vs Seurat Equivalents\n\n| Operation | Seurat (R) | Scanpy (Python) |\n|-----------|------------|-----------------|\n| Load data | `Read10X()` | `sc.read_10x_mtx()` |\n| Normalize | `NormalizeData()` | `sc.pp.normalize_total() + sc.pp.log1p()` |\n| Find HVGs | `FindVariableFeatures()` | `sc.pp.highly_variable_genes()` |\n| PCA | `RunPCA()` | `sc.tl.pca()` |\n| Cluster | `FindClusters()` | `sc.tl.leiden()` |\n| UMAP | `RunUMAP()` | `sc.tl.umap()` |\n| Find markers | `FindMarkers()` | `sc.tl.rank_genes_groups()` |\n| Batch correction | `RunHarmony()` | `harmonypy.run_harmony()` |\n\n---\n\n## Reasoning Framework for Result Interpretation\n\n### Evidence Grading\n\n| Grade | Criteria | Example |\n|-------|----------|---------|\n| **High confidence** | Marker padj \u003C 0.01, log2FC > 1, expressed in > 25% of cluster cells | CD3D as T-cell marker with padj = 1e-50, log2FC = 3.2, pct = 0.85 |\n| **Moderate confidence** | padj \u003C 0.05, log2FC > 0.5, or expressed in 10-25% of cluster | FOXP3 in Treg cluster with padj = 0.001, pct = 0.18 |\n| **Low confidence** | padj \u003C 0.05 but log2FC \u003C 0.5 or low pct_diff between clusters | Ubiquitously expressed gene with marginal enrichment |\n| **Unreliable** | Fewer than 20 cells in cluster, or QC metrics suggest doublets | Cluster with mean nGenes > 6000 and high doublet score |\n\n### Interpretation Guidance\n\n- **QC metric thresholds**: Standard filters are nGenes > 200 (remove empty droplets), nGenes \u003C 5000-6000 (remove doublets), pct_counts_mt \u003C 20% (remove dying cells). These thresholds are tissue-dependent: immune cells tolerate stricter nGene filters; neurons may have higher mitochondrial content naturally. Always visualize distributions before setting cutoffs.\n- **Cluster resolution guidance**: Leiden resolution 0.3-0.5 yields broad cell types (T cells, B cells, myeloid). Resolution 0.8-1.2 resolves subtypes (CD4 naive, CD4 memory, Treg). Resolution > 2.0 risks over-clustering (splitting biologically homogeneous populations). Validate by checking that each cluster has distinct marker genes.\n- **Marker gene confidence levels**: A strong marker is highly specific (high pct_diff between cluster and rest) and highly expressed (high log2FC). Genes expressed in many clusters with small fold changes are poor markers. Cross-reference with known markers from CellMarker or HPA databases.\n- **Pseudo-bulk vs single-cell DE**: For comparing conditions (treatment vs control), pseudo-bulk DE (aggregate by sample, then DESeq2) is more statistically valid than single-cell DE, which inflates significance due to non-independence of cells from the same sample.\n- **Batch effects**: If samples cluster by batch rather than biology on UMAP, apply Harmony or other correction before biological interpretation.\n\n### Synthesis Questions\n\n1. Do the identified clusters correspond to known cell types based on canonical markers, or do some clusters lack clear biological identity (potentially doublets or low-quality cells)?\n2. At the chosen clustering resolution, are there clusters that merge when resolution is lowered, suggesting they may be a single cell type split by technical noise?\n3. For differential expression between conditions, are the results consistent between single-cell and pseudo-bulk approaches, and do the top DE genes have known biological relevance?\n4. Do QC-flagged cells (high mito, extreme gene counts) concentrate in specific clusters, and does removing them change the clustering structure?\n5. If batch correction was applied, do post-correction clusters still maintain expected cell-type-specific marker expression?\n\n---\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| `ModuleNotFoundError: leidenalg` | `pip install leidenalg` |\n| Sparse matrix errors | `.toarray()`: `X = adata.X.toarray() if issparse(adata.X) else adata.X` |\n| Wrong matrix orientation | More genes than samples? Transpose |\n| NaN in correlation | Filter: `valid = ~np.isnan(x) & ~np.isnan(y)` |\n| Too few cells for DE | Need >= 3 cells per condition per cell type |\n| Memory error | Use `sc.pp.highly_variable_genes()` to reduce features |\n\n---\n\n## Reference Documentation\n\n**Detailed Analysis Patterns**: analysis_patterns.md (per-cell-type DE, correlation, PCA, ANOVA, cell communication)\n\n**Core Workflows**:\n- references\u002Fscanpy_workflow.md - Complete scanpy pipeline\n- references\u002Fseurat_workflow.md - Seurat to Scanpy translation\n- references\u002Fclustering_guide.md - Clustering methods\n- references\u002Fmarker_identification.md - Marker genes, annotation\n- references\u002Ftrajectory_analysis.md - Pseudotime\n- references\u002Fcell_communication.md - OmniPath\u002FCellPhoneDB workflow\n- references\u002Ftroubleshooting.md - Detailed error solutions\n","# Single-Cell Genomics and Expression Matrix Analysis\n\nComprehensive single-cell RNA-seq analysis and expression matrix processing using scanpy, anndata, scipy, and ToolUniverse.\n\n---\n\n## LOOK UP, DON'T GUESS\nWhen uncertain about any scientific fact, SEARCH databases first (PubMed, UniProt, ChEMBL, ClinVar, etc.) rather than reasoning from memory. A database-verified answer is always more reliable than a guess.\n\n---\n\n## When to Use This Skill\n\nApply when users:\n- Have scRNA-seq data (h5ad, 10X, CSV count matrices) and want analysis\n- Ask about cell type identification, clustering, or annotation\n- Need differential expression analysis by cell type or condition\n- Want gene-expression correlation analysis (e.g., gene length vs expression by cell type)\n- Ask about PCA, UMAP, t-SNE for expression data\n- Need Leiden\u002FLouvain clustering on expression matrices\n- Want statistical comparisons between cell types (t-test, ANOVA, fold change)\n- Ask about marker genes, batch correction, trajectory, or cell-cell communication\n\n**BixBench Coverage**: 18+ questions across 5 projects (bix-22, bix-27, bix-31, bix-33, bix-36)\n\n**NOT for** (use other skills instead):\n- Bulk RNA-seq DESeq2 only -> `tooluniverse-rnaseq-deseq2`\n- Gene enrichment only -> `tooluniverse-gene-enrichment`\n- VCF\u002Fvariant analysis -> `tooluniverse-variant-analysis`\n\n---\n\n## Core Principles\n\n1. **Data-first** - Load, inspect, validate before analysis\n2. **AnnData-centric** - All data flows through anndata objects\n3. **Cell type awareness** - Per-cell-type subsetting when needed\n4. **Statistical rigor** - Normalization, multiple testing correction, effect sizes\n5. **Question-driven** - Parse what the user is actually asking\n\n---\n\n## Required Packages\n\n```python\nimport scanpy as sc, anndata as ad, pandas as pd, numpy as np\nfrom scipy import stats\nfrom scipy.cluster.hierarchy import linkage, fcluster\nfrom sklearn.decomposition import PCA\nfrom statsmodels.stats.multitest import multipletests\nimport gseapy as gp  # enrichment\nimport harmonypy     # batch correction (optional)\n```\n\nInstall: `pip install scanpy anndata leidenalg umap-learn harmonypy gseapy pandas numpy scipy scikit-learn statsmodels`\n\n---\n\n## Workflow Decision Tree\n\n```\nSTART: User question about scRNA-seq data\n|\n+-- FULL PIPELINE (raw counts -> annotated clusters)\n|   Workflow: QC -> Normalize -> HVG -> PCA -> Cluster -> Annotate -> DE\n|   See: references\u002Fscanpy_workflow.md\n|\n+-- DIFFERENTIAL EXPRESSION (per-cell-type comparison)\n|   Most common BixBench pattern (bix-33)\n|   See: analysis_patterns.md \"Pattern 1\"\n|\n+-- CORRELATION ANALYSIS (gene property vs expression)\n|   Pattern: Gene length vs expression (bix-22)\n|   See: analysis_patterns.md \"Pattern 2\"\n|\n+-- CLUSTERING & PCA (expression matrix analysis)\n|   See: references\u002Fclustering_guide.md\n|\n+-- CELL COMMUNICATION (ligand-receptor interactions)\n|   See: references\u002Fcell_communication.md\n|\n+-- TRAJECTORY ANALYSIS (pseudotime)\n    See: references\u002Ftrajectory_analysis.md\n```\n\n**Data format handling**:\n- h5ad -> `sc.read_h5ad()`\n- 10X -> `sc.read_10x_mtx()` or `sc.read_10x_h5()`\n- CSV\u002FTSV -> `pd.read_csv()` -> Convert to AnnData (check orientation!)\n\n---\n\n## Data Loading\n\nAnnData expects: **cells\u002Fsamples as rows (obs), genes as columns (var)**\n\n```python\nadata = sc.read_h5ad(\"data.h5ad\")  # h5ad already oriented\n\n# CSV\u002FTSV: check orientation\ndf = pd.read_csv(\"counts.csv\", index_col=0)\nif df.shape[0] > df.shape[1] * 5:  # genes > samples by 5x => transpose\n    df = df.T\nadata = ad.AnnData(df)\n\n# Load metadata\nmeta = pd.read_csv(\"metadata.csv\", index_col=0)\ncommon = adata.obs_names.intersection(meta.index)\nadata = adata[common].copy()\nfor col in meta.columns:\n    adata.obs[col] = meta.loc[common, col]\n```\n\n---\n\n## Quality Control\n\n```python\nadata.var['mt'] = adata.var_names.str.startswith(('MT-', 'mt-'))\nsc.pp.calculate_qc_metrics(adata, qc_vars=['mt'], inplace=True)\nsc.pp.filter_cells(adata, min_genes=200)\nadata = adata[adata.obs['pct_counts_mt'] \u003C 20].copy()\nsc.pp.filter_genes(adata, min_cells=3)\n```\n\nSee: references\u002Fscanpy_workflow.md for details\n\n---\n\n## Complete Pipeline (Quick Reference)\n\n```python\nimport scanpy as sc\n\nadata = sc.read_10x_h5(\"filtered_feature_bc_matrix.h5\")\n\n# QC\nadata.var['mt'] = adata.var_names.str.startswith('MT-')\nsc.pp.calculate_qc_metrics(adata, qc_vars=['mt'], inplace=True)\nadata = adata[adata.obs['pct_counts_mt'] \u003C 20].copy()\nsc.pp.filter_cells(adata, min_genes=200)\nsc.pp.filter_genes(adata, min_cells=3)\n\n# Normalize + HVG + PCA\nsc.pp.normalize_total(adata, target_sum=1e4)\nsc.pp.log1p(adata)\nadata.raw = adata.copy()\nsc.pp.highly_variable_genes(adata, n_top_genes=2000)\nsc.tl.pca(adata, n_comps=50)\n\n# Cluster + UMAP\nsc.pp.neighbors(adata, n_pcs=30)\nsc.tl.leiden(adata, resolution=0.5)\nsc.tl.umap(adata)\n\n# Find markers + Annotate + Per-cell-type DE\nsc.tl.rank_genes_groups(adata, groupby='leiden', method='wilcoxon')\n```\n\n---\n\n## Differential Expression Decision Tree\n\n```\nSingle-Cell DE (many cells per condition):\n  Use: sc.tl.rank_genes_groups(), methods: wilcoxon, t-test, logreg\n  Best for: Per-cell-type DE, marker gene finding\n\nPseudo-Bulk DE (aggregate counts by sample):\n  Use: DESeq2 via PyDESeq2\n  Best for: Sample-level comparisons with replicates\n\nStatistical Tests Only:\n  Use: scipy.stats (ttest_ind, f_oneway, pearsonr)\n  Best for: Correlation, ANOVA, t-tests on summaries\n```\n\n---\n\n## Statistical Tests (Quick Reference)\n\n```python\nfrom scipy import stats\nfrom statsmodels.stats.multitest import multipletests\n\n# Pearson\u002FSpearman correlation\nr, p = stats.pearsonr(gene_lengths, mean_expression)\n\n# Welch's t-test\nt_stat, p_val = stats.ttest_ind(group1, group2, equal_var=False)\n\n# ANOVA\nf_stat, p_val = stats.f_oneway(group1, group2, group3)\n\n# Multiple testing correction (BH)\nreject, pvals_adj, _, _ = multipletests(pvals, method='fdr_bh')\n```\n\n---\n\n## Batch Correction (Harmony)\n\n```python\nimport harmonypy\nsc.tl.pca(adata, n_comps=50)\nho = harmonypy.run_harmony(adata.obsm['X_pca'][:, :30], adata.obs, 'batch', random_state=0)\nadata.obsm['X_pca_harmony'] = ho.Z_corr.T\nsc.pp.neighbors(adata, use_rep='X_pca_harmony')\nsc.tl.leiden(adata, resolution=0.5)\nsc.tl.umap(adata)\n```\n\n---\n\n## ToolUniverse Integration\n\n### Data Discovery (before analysis)\n- **CxGDisc_search_datasets**: Search CELLxGENE Discover for scRNA-seq datasets by disease, tissue, organism. Use broad disease terms (e.g., \"breast cancer\" not \"triple-negative\").\n- **GEO_search_rnaseq_datasets** \u002F **geo_search_datasets**: Search GEO for scRNA-seq studies\n- **NCBI_SRA_search_runs**: Search SRA for sequencing runs (query=\"single cell RNA-seq [disease]\")\n- **OmicsDI_search_datasets**: Cross-repository dataset search\n\n### Cell Type Markers\n- **CellMarker_search_by_cell_type**: Tissue-specific cell markers (use `CellMarker_list_cell_types` first — exact names required, e.g., \"Regulatory T(Treg) cell\" not \"Regulatory T cell\")\n- **CellMarker_search_cancer_markers**: Cancer-context markers with experimental evidence\n- **CellMarker_search_by_gene**: Reverse lookup — which cell types express a gene?\n- **HPA_search_genes_by_query**: Cell-type marker gene search\n\n### Gene Annotation\n- **MyGene_query_genes** \u002F **MyGene_batch_query**: Gene ID conversion\n- **ensembl_lookup_gene**: Ensembl gene details\n- **UniProt_get_function_by_accession**: Protein function\n\n### Cell-Cell Communication\n- **OmniPath_get_ligand_receptor_interactions**: L-R pairs (CellPhoneDB, CellChatDB)\n- **OmniPath_get_signaling_interactions**: Downstream signaling\n- **OmniPath_get_complexes**: Multi-subunit receptors\n\n### Enrichment (Post-DE)\n- **PANTHER_enrichment**: GO enrichment (BP, MF, CC)\n- **STRING_functional_enrichment**: Network-based enrichment\n- **ReactomeAnalysis_pathway_enrichment**: Reactome pathways\n\n### Clinical Context (for tumor immunology)\n- **DGIdb_get_drug_gene_interactions**: Drug interactions for immune checkpoint targets (genes=[\"CD274\"] for PD-L1)\n- **civic_search_evidence_items**: Clinical evidence for mutations\u002Fbiomarkers\n- **TIMER2_immune_estimation**: TCGA immune infiltration correlation\n- **search_clinical_trials**: Clinical trial matching\n- **GTEx_get_expression_summary**: Normal tissue baseline expression\n- **PubMed_search_articles**: Literature context\n\n---\n\n## Scanpy vs Seurat Equivalents\n\n| Operation | Seurat (R) | Scanpy (Python) |\n|-----------|------------|-----------------|\n| Load data | `Read10X()` | `sc.read_10x_mtx()` |\n| Normalize | `NormalizeData()` | `sc.pp.normalize_total() + sc.pp.log1p()` |\n| Find HVGs | `FindVariableFeatures()` | `sc.pp.highly_variable_genes()` |\n| PCA | `RunPCA()` | `sc.tl.pca()` |\n| Cluster | `FindClusters()` | `sc.tl.leiden()` |\n| UMAP | `RunUMAP()` | `sc.tl.umap()` |\n| Find markers | `FindMarkers()` | `sc.tl.rank_genes_groups()` |\n| Batch correction | `RunHarmony()` | `harmonypy.run_harmony()` |\n\n---\n\n## Reasoning Framework for Result Interpretation\n\n### Evidence Grading\n\n| Grade | Criteria | Example |\n|-------|----------|---------|\n| **High confidence** | Marker padj \u003C 0.01, log2FC > 1, expressed in > 25% of cluster cells | CD3D as T-cell marker with padj = 1e-50, log2FC = 3.2, pct = 0.85 |\n| **Moderate confidence** | padj \u003C 0.05, log2FC > 0.5, or expressed in 10-25% of cluster | FOXP3 in Treg cluster with padj = 0.001, pct = 0.18 |\n| **Low confidence** | padj \u003C 0.05 but log2FC \u003C 0.5 or low pct_diff between clusters | Ubiquitously expressed gene with marginal enrichment |\n| **Unreliable** | Fewer than 20 cells in cluster, or QC metrics suggest doublets | Cluster with mean nGenes > 6000 and high doublet score |\n\n### Interpretation Guidance\n\n- **QC metric thresholds**: Standard filters are nGenes > 200 (remove empty droplets), nGenes \u003C 5000-6000 (remove doublets), pct_counts_mt \u003C 20% (remove dying cells). These thresholds are tissue-dependent: immune cells tolerate stricter nGene filters; neurons may have higher mitochondrial content naturally. Always visualize distributions before setting cutoffs.\n- **Cluster resolution guidance**: Leiden resolution 0.3-0.5 yields broad cell types (T cells, B cells, myeloid). Resolution 0.8-1.2 resolves subtypes (CD4 naive, CD4 memory, Treg). Resolution > 2.0 risks over-clustering (splitting biologically homogeneous populations). Validate by checking that each cluster has distinct marker genes.\n- **Marker gene confidence levels**: A strong marker is highly specific (high pct_diff between cluster and rest) and highly expressed (high log2FC). Genes expressed in many clusters with small fold changes are poor markers. Cross-reference with known markers from CellMarker or HPA databases.\n- **Pseudo-bulk vs single-cell DE**: For comparing conditions (treatment vs control), pseudo-bulk DE (aggregate by sample, then DESeq2) is more statistically valid than single-cell DE, which inflates significance due to non-independence of cells from the same sample.\n- **Batch effects**: If samples cluster by batch rather than biology on UMAP, apply Harmony or other correction before biological interpretation.\n\n### Synthesis Questions\n\n1. Do the identified clusters correspond to known cell types based on canonical markers, or do some clusters lack clear biological identity (potentially doublets or low-quality cells)?\n2. At the chosen clustering resolution, are there clusters that merge when resolution is lowered, suggesting they may be a single cell type split by technical noise?\n3. For differential expression between conditions, are the results consistent between single-cell and pseudo-bulk approaches, and do the top DE genes have known biological relevance?\n4. Do QC-flagged cells (high mito, extreme gene counts) concentrate in specific clusters, and does removing them change the clustering structure?\n5. If batch correction was applied, do post-correction clusters still maintain expected cell-type-specific marker expression?\n\n---\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| `ModuleNotFoundError: leidenalg` | `pip install leidenalg` |\n| Sparse matrix errors | `.toarray()`: `X = adata.X.toarray() if issparse(adata.X) else adata.X` |\n| Wrong matrix orientation | More genes than samples? Transpose |\n| NaN in correlation | Filter: `valid = ~np.isnan(x) & ~np.isnan(y)` |\n| Too few cells for DE | Need >= 3 cells per condition per cell type |\n| Memory error | Use `sc.pp.highly_variable_genes()` to reduce features |\n\n---\n\n## Reference Documentation\n\n**Detailed Analysis Patterns**: analysis_patterns.md (per-cell-type DE, correlation, PCA, ANOVA, cell communication)\n\n**Core Workflows**:\n- references\u002Fscanpy_workflow.md - Complete scanpy pipeline\n- references\u002Fseurat_workflow.md - Seurat to Scanpy translation\n- references\u002Fclustering_guide.md - Clustering methods\n- references\u002Fmarker_identification.md - Marker genes, annotation\n- references\u002Ftrajectory_analysis.md - Pseudotime\n- references\u002Fcell_communication.md - OmniPath\u002FCellPhoneDB workflow\n- references\u002Ftroubleshooting.md - Detailed error solutions\n",{"name":5,"description":7},"main","a298c929b6cbd662e1fce54302ce520d5ceea1a5",".agents\u002Flibrary\u002Fskills\u002Ftooluniverse-single-cell","https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain","https:\u002F\u002Fgithub.com\u002FPrekzursil","2026-11-02 14:30:57",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add Prekzursil\u002Fagent-skills-toolchain --skill tooluniverse-single-cell",{"tool":44,"command":45},"bunx","bunx skills add Prekzursil\u002Fagent-skills-toolchain --skill tooluniverse-single-cell",{"tool":47,"command":48},"pnpm","pnpm dlx skills add Prekzursil\u002Fagent-skills-toolchain --skill tooluniverse-single-cell","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002F.agents\u002Flibrary\u002Fskills\u002Ftooluniverse-single-cell\u002FSKILL.md",true,[52,58,62,66,70,74,78,82,86,92,96,100,104],{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":57},"analysis_patterns.md","REFERENCE","参考文档",6523,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002F.agents\u002Flibrary\u002Fskills\u002Ftooluniverse-single-cell\u002Fanalysis_patterns.md",{"path":59,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Fcell_communication.md",20360,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002F.agents\u002Flibrary\u002Fskills\u002Ftooluniverse-single-cell\u002Freferences\u002Fcell_communication.md",{"path":63,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fclustering_guide.md",9658,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002F.agents\u002Flibrary\u002Fskills\u002Ftooluniverse-single-cell\u002Freferences\u002Fclustering_guide.md",{"path":67,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fmarker_identification.md",5299,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002F.agents\u002Flibrary\u002Fskills\u002Ftooluniverse-single-cell\u002Freferences\u002Fmarker_identification.md",{"path":71,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Fscanpy_workflow.md",10237,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002F.agents\u002Flibrary\u002Fskills\u002Ftooluniverse-single-cell\u002Freferences\u002Fscanpy_workflow.md",{"path":75,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fseurat_workflow.md",4510,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002F.agents\u002Flibrary\u002Fskills\u002Ftooluniverse-single-cell\u002Freferences\u002Fseurat_workflow.md",{"path":79,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Ftrajectory_analysis.md",2842,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002F.agents\u002Flibrary\u002Fskills\u002Ftooluniverse-single-cell\u002Freferences\u002Ftrajectory_analysis.md",{"path":83,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Ftroubleshooting.md",8701,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002F.agents\u002Flibrary\u002Fskills\u002Ftooluniverse-single-cell\u002Freferences\u002Ftroubleshooting.md",{"path":87,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":90,"sourceHtmlUrl":91},"scripts\u002Ffind_markers.py","SCRIPT","脚本",3626,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002F.agents\u002Flibrary\u002Fskills\u002Ftooluniverse-single-cell\u002Fscripts\u002Ffind_markers.py",{"path":93,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":94,"sourceHtmlUrl":95},"scripts\u002Fnormalize_data.py",2608,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002F.agents\u002Flibrary\u002Fskills\u002Ftooluniverse-single-cell\u002Fscripts\u002Fnormalize_data.py",{"path":97,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":98,"sourceHtmlUrl":99},"scripts\u002Fqc_metrics.py",4296,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002F.agents\u002Flibrary\u002Fskills\u002Ftooluniverse-single-cell\u002Fscripts\u002Fqc_metrics.py",{"path":101,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":102,"sourceHtmlUrl":103},"SKILL_OLD.md",75082,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002F.agents\u002Flibrary\u002Fskills\u002Ftooluniverse-single-cell\u002FSKILL_OLD.md",{"path":105,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":106,"sourceHtmlUrl":107},"test_skill.py",50283,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002F.agents\u002Flibrary\u002Fskills\u002Ftooluniverse-single-cell\u002Ftest_skill.py",[109,130,161,188,202,218],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":27},"01M6DF7D7478R55P46REYH4QAC","clarify-requirements","Resolve genuine pre-execution ambiguity by scanning repo context, generating 1-6 grounded options, and asking 1-3 focused questions via AskUserQuestion. NOT for mid-task use (injection risk); NOT when the goal is already unambiguous; use to disambiguate vague prompts before any file edits.","https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Ftools\u002Fworkspace-hooks\u002Fskills\u002Fclarify-requirements\u002FSKILL.md",[],[116,117,118,119,120,121,122,123,124,24,125,126,127,128,129],"clarify requirements","clarify","requirements","risk","options","task","prompts","goal","scanning","context","repo","injection","execution","file",{"skillNo":131,"name":132,"nameZh":6,"description":133,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":134,"categories":135,"keywords":141,"publishedAt":27},"01M6DF79CA4BHJS66J8EZDBPWJ","openmm-md","Run FREE, open-source, Windows-native GPU molecular dynamics via the openmm-md MCP (OpenMM + CUDA on the local NVIDIA GPU). Use for protein \u002F protein-ligand MD when you want a free stack or are on Windows without a Schrodinger license. Covers the full workflow (prepare, solvate, minimize, equilibrate, production, analyze, mmgbsa) AND an honest decision guide vs Schrodinger Desmond, including how to run Desmond legitimately on Linux or a cloud GPU with a real license. This is a deliberately LESSER free alternative and does NOT replace the schrodinger MCP tools. Do NOT use it to pick a free tool when a validated FEP+, WaterMap, IFD-MD, or Prime MM-GBSA result is actually required.","https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Ftools\u002Fmcp\u002Fopenmm-md-mcp\u002Fskill\u002Fopenmm-md\u002FSKILL.md",[136],{"categoryNo":137,"categoryName":138,"taxonomyType":139,"taxonomyTypeDesc":140},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[142,143,144,145,146,147,148,149,150,151,152,153,154,155,24,156,157,158,159,160],"openmm md","how","decision","pick","linux","analyze","tool","stack","open","NVIDIA","gpu","license","workflow","windows","free","molecular dynamics","local","do","MCP",{"skillNo":162,"name":163,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":173,"publishedAt":27},"01M6DF76C1MG85VEWP8VZCBNMN","visual-review","Take screenshots of web pages and UI using Playwright for visual review and iteration","https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Ftools\u002Feditor\u002Fmetaswarm\u002Fskills\u002Fvisual-review\u002FSKILL.md",[167,170],{"categoryNo":168,"categoryName":169,"taxonomyType":139,"taxonomyTypeDesc":140},"01JBSEEDCAT000000000000003","演示文稿",{"categoryNo":171,"categoryName":172,"taxonomyType":139,"taxonomyTypeDesc":140},"01JBSEEDCAT000000000000008","测试与质量",[174,175,176,177,178,179,180,181,182,183,143,184,185,186,187],"review","visual","visual review","pages","web","false","iteration","take","check","slides","ui","screenshot","playwright","screenshots",{"skillNo":189,"name":190,"nameZh":6,"description":191,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":192,"categories":193,"keywords":194,"publishedAt":27},"01M6DF73AQVCBZKEN0YXEX9FXP","status","Diagnostic status report — shows metaswarm installation state, project setup, and potential issues","https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Ftools\u002Feditor\u002Fmetaswarm\u002Fskills\u002Fstatus\u002FSKILL.md",[],[190,195,196,197,198,199,200,201],"setup","report","project","installation","project setup","issues","state",{"skillNo":203,"name":204,"nameZh":6,"description":205,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":206,"categories":207,"keywords":209,"publishedAt":27},"01M6DF6X6C2XB0P6GX76P7TTYV","start","Use when starting work on any task, when the user mentions metaswarm, or when the user wants to begin tracked development work","https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Ftools\u002Feditor\u002Fmetaswarm\u002Fskills\u002Fstart\u002FSKILL.md",[208],{"categoryNo":137,"categoryName":138,"taxonomyType":139,"taxonomyTypeDesc":140},[204,210,121,211,212,213,24,214,215,216,217],"start issue","issue","ready","work on issue","user","work","work on","development",{"skillNo":219,"name":195,"nameZh":6,"description":220,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":221,"categories":222,"keywords":223,"publishedAt":27},"01M6DF6QMJ9AJKFKHHKRT005PQ","Interactive project setup — detects your project, configures metaswarm, writes project-local files","https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Ftools\u002Feditor\u002Fmetaswarm\u002Fskills\u002Fsetup\u002FSKILL.md",[],[195,197,158,224,199,225],"files","interactive"]