[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DAXS2X29FP9T13Q688PE5M":3,"skill-same:01M6DAXS2X29FP9T13Q688PE5M":74},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":14,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":49,"install":50,"resources":63},"01M6DAXS2X29FP9T13Q688PE5M","tooluniverse-spatial-transcriptomics",null,"Analyze spatial transcriptomics data to map gene expression in tissue architecture. Supports 10x Visium, MERFISH, seqFISH, Slide-seq, and imaging-based platforms. Performs spatial clustering, domain identification, cell-cell proximity analysis, spatial gene expression patterns, tissue architecture mapping, and integration with single-cell data. Use when analyzing spatial transcriptomics datasets, studying tissue organization, identifying spatial expression patterns, mapping cell-cell interactions in tissue context, characterizing tumor microenvironment spatial structure, or integrating spatial and single-cell RNA-seq data for comprehensive tissue analysis.","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-spatial-transcriptomics\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"Spatial","tooluniverse spatial transcriptomics","datasets","integration","gene expression","RNA","map","domain","structure","organization","patterns","analyzing","architecture","use","context","10x","analyze","analysis","clustering","data","2026-11-10 10:12:30",false,"---\nname: tooluniverse-spatial-transcriptomics\ndescription: Analyze spatial transcriptomics data to map gene expression in tissue architecture. Supports 10x Visium, MERFISH, seqFISH, Slide-seq, and imaging-based platforms. Performs spatial clustering, domain identification, cell-cell proximity analysis, spatial gene expression patterns, tissue architecture mapping, and integration with single-cell data. Use when analyzing spatial transcriptomics datasets, studying tissue organization, identifying spatial expression patterns, mapping cell-cell interactions in tissue context, characterizing tumor microenvironment spatial structure, or integrating spatial and single-cell RNA-seq data for comprehensive tissue analysis.\n---\n\n# Spatial Transcriptomics Analysis\n\nComprehensive analysis of spatially-resolved transcriptomics data to understand gene expression patterns in tissue architecture context. Combines expression profiling with spatial coordinates to reveal tissue organization, cell-cell interactions, and spatially variable genes.\n\n## LOOK UP, DON'T GUESS\nWhen uncertain about any scientific fact, SEARCH databases first rather than reasoning from memory. A database-verified answer is always more reliable than a guess.\n\n## When to Use This Skill\n\n**Triggers**:\n- User has spatial transcriptomics data (Visium, MERFISH, seqFISH, etc.)\n- Questions about tissue architecture or spatial organization\n- Spatial gene expression pattern analysis\n- Cell-cell proximity or neighborhood analysis requests\n- Tumor microenvironment spatial structure questions\n- Integration of spatial with single-cell data\n- Spatial domain identification\n- Tissue morphology correlation with expression\n\n**Example Questions**:\n1. \"Analyze this 10x Visium dataset to identify spatial domains\"\n2. \"Which genes show spatially variable expression in this tissue?\"\n3. \"Map the tumor microenvironment spatial organization\"\n4. \"Find genes enriched at tissue boundaries\"\n5. \"Identify cell-cell interactions based on spatial proximity\"\n6. \"Integrate spatial transcriptomics with scRNA-seq annotations\"\n\n---\n\n## Core Capabilities\n\n- **Data Import**: 10x Visium, MERFISH, seqFISH, Slide-seq, STARmap, Xenium formats\n- **Quality Control**: Spot\u002Fcell QC, spatial alignment verification, tissue coverage\n- **Normalization**: Spatial-aware normalization accounting for tissue heterogeneity\n- **Spatial Clustering**: Identify spatial domains with similar expression profiles\n- **Spatial Variable Genes**: Find genes with non-random spatial patterns\n- **Neighborhood Analysis**: Cell-cell proximity, spatial neighborhoods, niche identification\n- **Integration**: Merge with scRNA-seq for cell type mapping (Cell2location, Tangram, SPOTlight)\n- **Ligand-Receptor Spatial**: Map cell communication in tissue context via OmniPath\n\n## Supported Platforms\n\n- **10x Visium**: 55um spots (~50 cells\u002Fspot), genome-wide, includes H&E image — most common\n- **MERFISH\u002FseqFISH**: Single-cell resolution, 100-10,000 targeted genes, imaging-based\n- **Slide-seq\u002FV2**: 10um beads, genome-wide — higher resolution than Visium\n- **Xenium**: Single-cell\u002Fsubcellular, 300+ targeted genes (10x platform)\n\n---\n\n## Workflow Overview\n\n```\nInput: Spatial Transcriptomics Data + Tissue Image\n    |\n    v\nPhase 1: Data Import & QC\n    |-- Load spatial coordinates + expression matrix\n    |-- Load tissue histology image\n    |-- Quality control per spot\u002Fcell (min 200 genes, 500 UMI, \u003C20% MT)\n    |-- Align spatial coordinates to tissue\n    |\n    v\nPhase 2: Preprocessing\n    |-- Normalization (spatial-aware methods)\n    |-- Highly variable gene selection (top 2000)\n    |-- Dimensionality reduction (PCA)\n    |-- Spatial lag smoothing (optional)\n    |\n    v\nPhase 3: Spatial Clustering\n    |-- Build spatial neighbor graph (squidpy)\n    |-- Graph-based clustering with spatial constraints (Leiden)\n    |-- Annotate domains with marker genes (Wilcoxon)\n    |-- Visualize domains on tissue\n    |\n    v\nPhase 4: Spatial Variable Genes\n    |-- Test spatial autocorrelation (Moran's I, Geary's C)\n    |-- Filter significant spatial genes (FDR \u003C 0.05)\n    |-- Classify pattern types (gradient, hotspot, boundary, periodic)\n    |\n    v\nPhase 5: Neighborhood Analysis\n    |-- Define spatial neighborhoods (k-NN, radius)\n    |-- Calculate neighborhood composition (squidpy nhood_enrichment)\n    |-- Identify interaction zones between domains\n    |\n    v\nPhase 6: Integration with scRNA-seq\n    |-- Cell type deconvolution (Cell2location, Tangram, SPOTlight)\n    |-- Map cell types to spatial locations\n    |-- Validate with marker genes\n    |\n    v\nPhase 7: Spatial Cell Communication\n    |-- Identify proximal cell type pairs\n    |-- Query ligand-receptor database (OmniPath)\n    |-- Score spatial interactions (squidpy ligrec)\n    |-- Map communication hotspots\n    |\n    v\nPhase 8: Generate Spatial Report\n    |-- Tissue overview with domains\n    |-- Spatially variable genes\n    |-- Cell type spatial maps\n    |-- Interaction networks in tissue context\n```\n\n---\n\n## Phase Summaries\n\n### Phase 1: Data Import & QC\nLoad platform-specific data (scanpy read_visium for Visium). Apply QC filters: min 200 genes\u002Fspot, min 500 UMI\u002Fspot, max 20% mitochondrial. Verify spatial alignment with tissue image overlay.\n\n### Phase 2: Preprocessing\nNormalize to median total counts, log-transform, select top 2000 HVGs. Optional spatial smoothing via neighbor averaging (useful for noisy data but blurs boundaries).\n\n### Phase 3: Spatial Clustering\nPCA (50 components) followed by spatial neighbor graph construction (squidpy). Leiden clustering with spatial constraints yields spatial domains. Find domain markers via Wilcoxon rank-sum test.\n\n### Phase 4: Spatially Variable Genes\nMoran's I statistic tests spatial autocorrelation: I > 0 = clustering, I ~ 0 = random, I \u003C 0 = checkerboard. Filter by FDR \u003C 0.05. Classify patterns as gradient, hotspot, boundary, or periodic.\n\n### Phase 5: Neighborhood Analysis\nNeighborhood enrichment analysis (squidpy) tests whether cell types\u002Fdomains are co-localized beyond random expectation. Identify interaction zones at domain boundaries using k-NN spatial graphs.\n\n### Phase 6: scRNA-seq Integration\nCell type deconvolution maps single-cell annotations to spatial spots. Methods: Cell2location (recommended for Visium), Tangram, SPOTlight. Produces cell type fraction estimates per spot.\n\n### Phase 7: Spatial Cell Communication\n\nCombine spatial proximity with ligand-receptor databases. Key ToolUniverse tools:\n- `OmniPath_get_ligand_receptor_interactions` — 14,000+ L-R pairs from CellPhoneDB, CellChatDB, etc. Use `partners` param for specific genes.\n- `OmniPath_get_intercell_roles` — classify proteins as ligand\u002Freceptor\u002FECM. Use `proteins` param.\n- `OmniPath_get_cell_communication_annotations` — CellPhoneDB\u002FCellChatDB pathway annotations. Use `proteins` param.\n- `OmniPath_get_signaling_interactions` — intracellular signaling downstream of receptors.\n\nScore interactions by co-expression of L-R pairs in proximal cells. Map hotspots where interaction scores peak.\n\n### Phase 7.5: Data Discovery & Gene Context (ToolUniverse API tools)\n\nFor dataset discovery and gene annotation (API-based, no local computation needed):\n- `geo_search_datasets` \u002F `OmicsDI_search_datasets` \u002F `NCBI_SRA_search_runs` — find spatial TX datasets\n- `UniProt_get_function_by_accession` — protein function for stroma\u002Fimmune markers\n- `STRING_get_network` — protein interaction networks for key markers\n- `kegg_search_pathway` \u002F `kegg_get_pathway_info` — relevant metabolic\u002Fsignaling pathways\n- `DGIdb_get_drug_gene_interactions` — druggable targets in the spatial context\n- `PubMed_search_articles` — literature for spatial biology context\n\n> **API tools vs. local computation**: Phases 1-2 (data import, QC) and Phases 3-6 (clustering, SVGs, neighborhoods, deconvolution) require local Python with squidpy\u002Fscanpy. Phase 7 L-R databases and Phase 7.5 gene context use ToolUniverse API tools.\n\n### Phase 8: Report Generation\nSee [report_template.md](report_template.md) for full example output.\n\n---\n\n## Integration with ToolUniverse Skills\n\n- `tooluniverse-single-cell`: scRNA-seq reference for deconvolution (Phase 6) and L-R database (Phase 7)\n- `tooluniverse-gene-enrichment`: Pathway enrichment for spatial domain marker genes (Phase 3)\n- `tooluniverse-multi-omics-integration`: Integration with other omics layers (Phase 8)\n\n## ToolUniverse Data Retrieval Tools\n\n### HuBMAP Spatial Atlas Tools\n\nUse HuBMAP tools to discover published spatial biology datasets for reference, validation, or cross-study comparison.\n\n> **Availability Note**: `HuBMAP_search_datasets`, `HuBMAP_list_organs`, and `HuBMAP_get_dataset` may not be registered in your ToolUniverse instance. Verify with `tu.list_tools()` before use. If unavailable, use **OmicsDI** (`OmicsDI_search_datasets(query=\"spatial transcriptomics kidney\")`) or **CELLxGENE** (`CELLxGENE_get_cell_metadata`) as reliable alternatives for spatial dataset discovery.\n\n- `HuBMAP_search_datasets`: Search published datasets by `organ` (code, e.g. \"LK\"=Left Kidney, \"BR\"=Brain), `dataset_type`, `query`, `limit`\n- `HuBMAP_list_organs`: List all organs with codes and UBERON IDs (no required params)\n- `HuBMAP_get_dataset`: Get detailed metadata for a specific `hubmap_id` (e.g. \"HBM626.FHJD.938\")\n\nOrgan codes: LK\u002FRK=Kidney, LI=Large Intestine, SI=Small Intestine, HT=Heart, LV=Liver, LU=Lung, SP=Spleen, BR=Brain, PA=Pancreas, SK=Skin.\n\n**When to use**:\n- Finding reference spatial datasets for a given organ\u002Ftissue\n- Identifying available spatial assay types (Visium, CODEX, MERFISH) for a tissue\n- Cross-referencing donor metadata (age, sex) for spatial datasets\n- Retrieving DOI links for published spatial atlas datasets\n\n**Fallback if HuBMAP tools unavailable**:\n```python\n# Use OmicsDI for spatial dataset discovery\nresult = tu.tools.OmicsDI_search_datasets(query=\"spatial transcriptomics kidney Visium\")\n\n# Use CELLxGENE for cell-level expression context\nresult = tu.tools.CELLxGENE_get_cell_metadata(tissue=\"kidney\")\n```\n\n```python\n# Example: Find spatial datasets for kidney (if HuBMAP tools available)\nresult = tu.tools.HuBMAP_search_datasets(organ=\"LK\", limit=5)\n# Returns: {data: {total, returned, datasets: [{hubmap_id, title, dataset_type, organ, doi_url, ...}]}}\n\n# Example: Get all available organs\norgans = tu.tools.HuBMAP_list_organs()\n# Returns: {data: {total, organs: [{code, term, organ_uberon, rui_supported}]}}\n```\n\n---\n\n## Example Use Cases\n\n### Use Case 1: Tumor Microenvironment Mapping\n**Question**: \"Map the spatial organization of tumor, immune, and stromal cells\"\n**Workflow**: Load Visium -> QC -> Spatial clustering -> Deconvolution -> Interaction zones -> L-R analysis -> Report\n\n### Use Case 2: Developmental Gradient Analysis\n**Question**: \"Identify spatial gene expression gradients in developing tissue\"\n**Workflow**: Load spatial data -> SVG analysis -> Classify gradient patterns -> Map morphogens -> Correlate with cell fate -> Report\n\n### Use Case 3: Brain Region Identification\n**Question**: \"Automatically segment brain tissue into anatomical regions\"\n**Workflow**: Load Visium brain -> High-resolution clustering -> Match to known regions -> Validate with Allen Brain Atlas -> Report\n\n---\n\n## Quantified Minimums\n\n- At least 500 spatial locations after QC\n- Filter low-quality spots (min 200 genes, min 500 UMI, \u003C20% MT) and verify alignment\n- At least one spatial clustering method (graph-based with spatial constraints)\n- Spatially variable genes tested with Moran's I or equivalent (FDR \u003C 0.05)\n- Spatial plots on tissue images for all major findings\n- Report covers: domains, spatial genes, cell type maps, key interactions\n\n---\n\n## Reasoning Framework\n\n### Starting Point: What Is the Spatial Question?\n\nSpatial data adds location to expression. The key question: is the spatial pattern driven by cell type composition (trivial) or by spatially-regulated gene expression within the same cell type (interesting)? Deconvolution helps distinguish these.\n\nBefore interpreting any spatially variable gene (SVG), ask:\n1. Does this gene simply mark a cell type that is spatially restricted? (e.g., a T-cell marker enriched in immune infiltrate zones — expected, not informative)\n2. Or is the gene differentially expressed within the same cell type depending on its spatial position? (e.g., a fibroblast gene upregulated at the tumor-stroma boundary — spatially regulated, biologically interesting)\n\nTo distinguish these: (a) run deconvolution (Cell2location, Tangram) to get cell type fractions per spot; (b) regress SVG expression against cell type fraction; (c) if the spatial pattern persists after controlling for cell type composition, it reflects genuine spatial regulation. Always look up the gene's known biology before interpreting — check UniProt function and STRING interactions rather than guessing.\n\n### Evidence Grading\n\n- **T1**: Validated by orthogonal method (IHC, smFISH, known anatomy) — e.g., spatial domain matches histology-confirmed tumor margin\n- **T2**: Statistically significant, biologically consistent — SVG with Moran's I > 0.3 and FDR \u003C 0.01 in expected tissue region\n- **T3**: Computationally identified, awaiting validation — novel spatial domain from clustering with no histological correlate\n- **T4**: Exploratory or artifact-prone — low-UMI edge spots, domains driven by batch effects\n\n### Interpretation Guidance\n\n**Spatial domains**: Domains represent regions of coherent gene expression, often corresponding to tissue architecture (tumor core, stroma, immune infiltrate, necrosis). A domain is biologically meaningful when its marker genes align with known cell type signatures. Domains at tissue boundaries (e.g., tumor-stroma interface) are particularly informative for microenvironment studies.\n\n**Cell-cell proximity significance**: Neighborhood enrichment z-scores > 2 indicate cell types co-localize more than expected by chance. Negative z-scores indicate spatial avoidance. Interpret in biological context: immune cell enrichment near tumor cells may indicate active immune response or immunosuppressive niche depending on the cell types involved (e.g., CD8+ T cells vs. Tregs).\n\n**Spatially variable genes (SVGs)**: Moran's I > 0.3 with FDR \u003C 0.05 indicates strong spatial patterning. Classify SVGs by pattern: gradients (morphogen signaling, e.g., WNT along crypt-villus axis), hotspots (focal expression in immune aggregates), boundary genes (enriched at domain interfaces, e.g., epithelial-mesenchymal transition markers). SVGs with known spatial biology roles (e.g., tissue polarity genes) are higher confidence than novel candidates.\n\n### Synthesis Questions\n\nA complete spatial transcriptomics report should answer:\n1. What spatial domains were identified, and do they correspond to known tissue architecture?\n2. Which genes show significant spatial variability, and what pattern types do they exhibit?\n3. Are specific cell type pairs enriched or depleted in spatial proximity?\n4. What ligand-receptor interactions are active at domain boundaries or cell-cell interfaces?\n5. How do spatial findings compare to bulk or single-cell data from the same tissue type?\n\n---\n\n## Programmatic Access (Beyond Tools)\n\nWhen ToolUniverse tools return metadata but you need the actual expression matrices:\n\n```python\nimport scanpy as sc, pandas as pd, requests, io\n\n# Load h5ad (most common format for spatial\u002Fsingle-cell)\nadata = sc.read_h5ad(\"spatial_data.h5ad\")\n\n# Load 10X Visium output directory\nadata = sc.read_visium(\"path\u002Fto\u002Fspaceranger_output\u002F\")\n\n# Download from GEO supplementary files\ngeo_id = \"GSE123456\"\n# Check for h5ad or MTX in supplementary files\nurl = f\"https:\u002F\u002Fwww.ncbi.nlm.nih.gov\u002Fgeo\u002Fquery\u002Facc.cgi?acc={geo_id}&targ=gsm&view=data\"\n\n# Load 10X MTX format (matrix + barcodes + features)\nadata = sc.read_10x_mtx(\"filtered_feature_bc_matrix\u002F\", var_names=\"gene_symbols\")\n\n# HuBMAP data portal\n# Search at https:\u002F\u002Fportal.hubmapconsortium.org\u002Fsearch then download via globus or direct link\n# Human Cell Atlas: https:\u002F\u002Fdata.humancellatlas.org\u002F — download h5ad\u002Floom files\n```\n\nSee `tooluniverse-data-wrangling` skill for format cookbook and bulk download patterns.\n\n---\n\n## Limitations\n\n- **Resolution**: Visium spots contain multiple cells (not single-cell)\n- **Gene coverage**: Imaging methods have limited gene panels\n- **3D structure**: Most platforms are 2D sections\n- **Tissue quality**: Requires well-preserved tissue for imaging\n- **Computational**: Large datasets require significant memory\n- **Reference dependency**: Deconvolution quality depends on scRNA-seq reference\n\n---\n\n## References\n\n**Methods**:\n- Squidpy: https:\u002F\u002Fdoi.org\u002F10.1038\u002Fs41592-021-01358-2\n- Cell2location: https:\u002F\u002Fdoi.org\u002F10.1038\u002Fs41587-021-01139-4\n- SpatialDE: https:\u002F\u002Fdoi.org\u002F10.1038\u002Fnmeth.4636\n\n**Platforms**:\n- 10x Visium: https:\u002F\u002Fwww.10xgenomics.com\u002Fproducts\u002Fspatial-gene-expression\n- MERFISH: https:\u002F\u002Fdoi.org\u002F10.1126\u002Fscience.aaa6090\n- Slide-seq: https:\u002F\u002Fdoi.org\u002F10.1126\u002Fscience.aaw1219\n\n---\n\n## Reference Files\n\n- [code_examples.md](code_examples.md) - Python code for all phases (scanpy, squidpy, cell2location)\n- [report_template.md](report_template.md) - Full example report (breast cancer TME)\n","# Spatial Transcriptomics Analysis\n\nComprehensive analysis of spatially-resolved transcriptomics data to understand gene expression patterns in tissue architecture context. Combines expression profiling with spatial coordinates to reveal tissue organization, cell-cell interactions, and spatially variable genes.\n\n## LOOK UP, DON'T GUESS\nWhen uncertain about any scientific fact, SEARCH databases first rather than reasoning from memory. A database-verified answer is always more reliable than a guess.\n\n## When to Use This Skill\n\n**Triggers**:\n- User has spatial transcriptomics data (Visium, MERFISH, seqFISH, etc.)\n- Questions about tissue architecture or spatial organization\n- Spatial gene expression pattern analysis\n- Cell-cell proximity or neighborhood analysis requests\n- Tumor microenvironment spatial structure questions\n- Integration of spatial with single-cell data\n- Spatial domain identification\n- Tissue morphology correlation with expression\n\n**Example Questions**:\n1. \"Analyze this 10x Visium dataset to identify spatial domains\"\n2. \"Which genes show spatially variable expression in this tissue?\"\n3. \"Map the tumor microenvironment spatial organization\"\n4. \"Find genes enriched at tissue boundaries\"\n5. \"Identify cell-cell interactions based on spatial proximity\"\n6. \"Integrate spatial transcriptomics with scRNA-seq annotations\"\n\n---\n\n## Core Capabilities\n\n- **Data Import**: 10x Visium, MERFISH, seqFISH, Slide-seq, STARmap, Xenium formats\n- **Quality Control**: Spot\u002Fcell QC, spatial alignment verification, tissue coverage\n- **Normalization**: Spatial-aware normalization accounting for tissue heterogeneity\n- **Spatial Clustering**: Identify spatial domains with similar expression profiles\n- **Spatial Variable Genes**: Find genes with non-random spatial patterns\n- **Neighborhood Analysis**: Cell-cell proximity, spatial neighborhoods, niche identification\n- **Integration**: Merge with scRNA-seq for cell type mapping (Cell2location, Tangram, SPOTlight)\n- **Ligand-Receptor Spatial**: Map cell communication in tissue context via OmniPath\n\n## Supported Platforms\n\n- **10x Visium**: 55um spots (~50 cells\u002Fspot), genome-wide, includes H&E image — most common\n- **MERFISH\u002FseqFISH**: Single-cell resolution, 100-10,000 targeted genes, imaging-based\n- **Slide-seq\u002FV2**: 10um beads, genome-wide — higher resolution than Visium\n- **Xenium**: Single-cell\u002Fsubcellular, 300+ targeted genes (10x platform)\n\n---\n\n## Workflow Overview\n\n```\nInput: Spatial Transcriptomics Data + Tissue Image\n    |\n    v\nPhase 1: Data Import & QC\n    |-- Load spatial coordinates + expression matrix\n    |-- Load tissue histology image\n    |-- Quality control per spot\u002Fcell (min 200 genes, 500 UMI, \u003C20% MT)\n    |-- Align spatial coordinates to tissue\n    |\n    v\nPhase 2: Preprocessing\n    |-- Normalization (spatial-aware methods)\n    |-- Highly variable gene selection (top 2000)\n    |-- Dimensionality reduction (PCA)\n    |-- Spatial lag smoothing (optional)\n    |\n    v\nPhase 3: Spatial Clustering\n    |-- Build spatial neighbor graph (squidpy)\n    |-- Graph-based clustering with spatial constraints (Leiden)\n    |-- Annotate domains with marker genes (Wilcoxon)\n    |-- Visualize domains on tissue\n    |\n    v\nPhase 4: Spatial Variable Genes\n    |-- Test spatial autocorrelation (Moran's I, Geary's C)\n    |-- Filter significant spatial genes (FDR \u003C 0.05)\n    |-- Classify pattern types (gradient, hotspot, boundary, periodic)\n    |\n    v\nPhase 5: Neighborhood Analysis\n    |-- Define spatial neighborhoods (k-NN, radius)\n    |-- Calculate neighborhood composition (squidpy nhood_enrichment)\n    |-- Identify interaction zones between domains\n    |\n    v\nPhase 6: Integration with scRNA-seq\n    |-- Cell type deconvolution (Cell2location, Tangram, SPOTlight)\n    |-- Map cell types to spatial locations\n    |-- Validate with marker genes\n    |\n    v\nPhase 7: Spatial Cell Communication\n    |-- Identify proximal cell type pairs\n    |-- Query ligand-receptor database (OmniPath)\n    |-- Score spatial interactions (squidpy ligrec)\n    |-- Map communication hotspots\n    |\n    v\nPhase 8: Generate Spatial Report\n    |-- Tissue overview with domains\n    |-- Spatially variable genes\n    |-- Cell type spatial maps\n    |-- Interaction networks in tissue context\n```\n\n---\n\n## Phase Summaries\n\n### Phase 1: Data Import & QC\nLoad platform-specific data (scanpy read_visium for Visium). Apply QC filters: min 200 genes\u002Fspot, min 500 UMI\u002Fspot, max 20% mitochondrial. Verify spatial alignment with tissue image overlay.\n\n### Phase 2: Preprocessing\nNormalize to median total counts, log-transform, select top 2000 HVGs. Optional spatial smoothing via neighbor averaging (useful for noisy data but blurs boundaries).\n\n### Phase 3: Spatial Clustering\nPCA (50 components) followed by spatial neighbor graph construction (squidpy). Leiden clustering with spatial constraints yields spatial domains. Find domain markers via Wilcoxon rank-sum test.\n\n### Phase 4: Spatially Variable Genes\nMoran's I statistic tests spatial autocorrelation: I > 0 = clustering, I ~ 0 = random, I \u003C 0 = checkerboard. Filter by FDR \u003C 0.05. Classify patterns as gradient, hotspot, boundary, or periodic.\n\n### Phase 5: Neighborhood Analysis\nNeighborhood enrichment analysis (squidpy) tests whether cell types\u002Fdomains are co-localized beyond random expectation. Identify interaction zones at domain boundaries using k-NN spatial graphs.\n\n### Phase 6: scRNA-seq Integration\nCell type deconvolution maps single-cell annotations to spatial spots. Methods: Cell2location (recommended for Visium), Tangram, SPOTlight. Produces cell type fraction estimates per spot.\n\n### Phase 7: Spatial Cell Communication\n\nCombine spatial proximity with ligand-receptor databases. Key ToolUniverse tools:\n- `OmniPath_get_ligand_receptor_interactions` — 14,000+ L-R pairs from CellPhoneDB, CellChatDB, etc. Use `partners` param for specific genes.\n- `OmniPath_get_intercell_roles` — classify proteins as ligand\u002Freceptor\u002FECM. Use `proteins` param.\n- `OmniPath_get_cell_communication_annotations` — CellPhoneDB\u002FCellChatDB pathway annotations. Use `proteins` param.\n- `OmniPath_get_signaling_interactions` — intracellular signaling downstream of receptors.\n\nScore interactions by co-expression of L-R pairs in proximal cells. Map hotspots where interaction scores peak.\n\n### Phase 7.5: Data Discovery & Gene Context (ToolUniverse API tools)\n\nFor dataset discovery and gene annotation (API-based, no local computation needed):\n- `geo_search_datasets` \u002F `OmicsDI_search_datasets` \u002F `NCBI_SRA_search_runs` — find spatial TX datasets\n- `UniProt_get_function_by_accession` — protein function for stroma\u002Fimmune markers\n- `STRING_get_network` — protein interaction networks for key markers\n- `kegg_search_pathway` \u002F `kegg_get_pathway_info` — relevant metabolic\u002Fsignaling pathways\n- `DGIdb_get_drug_gene_interactions` — druggable targets in the spatial context\n- `PubMed_search_articles` — literature for spatial biology context\n\n> **API tools vs. local computation**: Phases 1-2 (data import, QC) and Phases 3-6 (clustering, SVGs, neighborhoods, deconvolution) require local Python with squidpy\u002Fscanpy. Phase 7 L-R databases and Phase 7.5 gene context use ToolUniverse API tools.\n\n### Phase 8: Report Generation\nSee [report_template.md](report_template.md) for full example output.\n\n---\n\n## Integration with ToolUniverse Skills\n\n- `tooluniverse-single-cell`: scRNA-seq reference for deconvolution (Phase 6) and L-R database (Phase 7)\n- `tooluniverse-gene-enrichment`: Pathway enrichment for spatial domain marker genes (Phase 3)\n- `tooluniverse-multi-omics-integration`: Integration with other omics layers (Phase 8)\n\n## ToolUniverse Data Retrieval Tools\n\n### HuBMAP Spatial Atlas Tools\n\nUse HuBMAP tools to discover published spatial biology datasets for reference, validation, or cross-study comparison.\n\n> **Availability Note**: `HuBMAP_search_datasets`, `HuBMAP_list_organs`, and `HuBMAP_get_dataset` may not be registered in your ToolUniverse instance. Verify with `tu.list_tools()` before use. If unavailable, use **OmicsDI** (`OmicsDI_search_datasets(query=\"spatial transcriptomics kidney\")`) or **CELLxGENE** (`CELLxGENE_get_cell_metadata`) as reliable alternatives for spatial dataset discovery.\n\n- `HuBMAP_search_datasets`: Search published datasets by `organ` (code, e.g. \"LK\"=Left Kidney, \"BR\"=Brain), `dataset_type`, `query`, `limit`\n- `HuBMAP_list_organs`: List all organs with codes and UBERON IDs (no required params)\n- `HuBMAP_get_dataset`: Get detailed metadata for a specific `hubmap_id` (e.g. \"HBM626.FHJD.938\")\n\nOrgan codes: LK\u002FRK=Kidney, LI=Large Intestine, SI=Small Intestine, HT=Heart, LV=Liver, LU=Lung, SP=Spleen, BR=Brain, PA=Pancreas, SK=Skin.\n\n**When to use**:\n- Finding reference spatial datasets for a given organ\u002Ftissue\n- Identifying available spatial assay types (Visium, CODEX, MERFISH) for a tissue\n- Cross-referencing donor metadata (age, sex) for spatial datasets\n- Retrieving DOI links for published spatial atlas datasets\n\n**Fallback if HuBMAP tools unavailable**:\n```python\n# Use OmicsDI for spatial dataset discovery\nresult = tu.tools.OmicsDI_search_datasets(query=\"spatial transcriptomics kidney Visium\")\n\n# Use CELLxGENE for cell-level expression context\nresult = tu.tools.CELLxGENE_get_cell_metadata(tissue=\"kidney\")\n```\n\n```python\n# Example: Find spatial datasets for kidney (if HuBMAP tools available)\nresult = tu.tools.HuBMAP_search_datasets(organ=\"LK\", limit=5)\n# Returns: {data: {total, returned, datasets: [{hubmap_id, title, dataset_type, organ, doi_url, ...}]}}\n\n# Example: Get all available organs\norgans = tu.tools.HuBMAP_list_organs()\n# Returns: {data: {total, organs: [{code, term, organ_uberon, rui_supported}]}}\n```\n\n---\n\n## Example Use Cases\n\n### Use Case 1: Tumor Microenvironment Mapping\n**Question**: \"Map the spatial organization of tumor, immune, and stromal cells\"\n**Workflow**: Load Visium -> QC -> Spatial clustering -> Deconvolution -> Interaction zones -> L-R analysis -> Report\n\n### Use Case 2: Developmental Gradient Analysis\n**Question**: \"Identify spatial gene expression gradients in developing tissue\"\n**Workflow**: Load spatial data -> SVG analysis -> Classify gradient patterns -> Map morphogens -> Correlate with cell fate -> Report\n\n### Use Case 3: Brain Region Identification\n**Question**: \"Automatically segment brain tissue into anatomical regions\"\n**Workflow**: Load Visium brain -> High-resolution clustering -> Match to known regions -> Validate with Allen Brain Atlas -> Report\n\n---\n\n## Quantified Minimums\n\n- At least 500 spatial locations after QC\n- Filter low-quality spots (min 200 genes, min 500 UMI, \u003C20% MT) and verify alignment\n- At least one spatial clustering method (graph-based with spatial constraints)\n- Spatially variable genes tested with Moran's I or equivalent (FDR \u003C 0.05)\n- Spatial plots on tissue images for all major findings\n- Report covers: domains, spatial genes, cell type maps, key interactions\n\n---\n\n## Reasoning Framework\n\n### Starting Point: What Is the Spatial Question?\n\nSpatial data adds location to expression. The key question: is the spatial pattern driven by cell type composition (trivial) or by spatially-regulated gene expression within the same cell type (interesting)? Deconvolution helps distinguish these.\n\nBefore interpreting any spatially variable gene (SVG), ask:\n1. Does this gene simply mark a cell type that is spatially restricted? (e.g., a T-cell marker enriched in immune infiltrate zones — expected, not informative)\n2. Or is the gene differentially expressed within the same cell type depending on its spatial position? (e.g., a fibroblast gene upregulated at the tumor-stroma boundary — spatially regulated, biologically interesting)\n\nTo distinguish these: (a) run deconvolution (Cell2location, Tangram) to get cell type fractions per spot; (b) regress SVG expression against cell type fraction; (c) if the spatial pattern persists after controlling for cell type composition, it reflects genuine spatial regulation. Always look up the gene's known biology before interpreting — check UniProt function and STRING interactions rather than guessing.\n\n### Evidence Grading\n\n- **T1**: Validated by orthogonal method (IHC, smFISH, known anatomy) — e.g., spatial domain matches histology-confirmed tumor margin\n- **T2**: Statistically significant, biologically consistent — SVG with Moran's I > 0.3 and FDR \u003C 0.01 in expected tissue region\n- **T3**: Computationally identified, awaiting validation — novel spatial domain from clustering with no histological correlate\n- **T4**: Exploratory or artifact-prone — low-UMI edge spots, domains driven by batch effects\n\n### Interpretation Guidance\n\n**Spatial domains**: Domains represent regions of coherent gene expression, often corresponding to tissue architecture (tumor core, stroma, immune infiltrate, necrosis). A domain is biologically meaningful when its marker genes align with known cell type signatures. Domains at tissue boundaries (e.g., tumor-stroma interface) are particularly informative for microenvironment studies.\n\n**Cell-cell proximity significance**: Neighborhood enrichment z-scores > 2 indicate cell types co-localize more than expected by chance. Negative z-scores indicate spatial avoidance. Interpret in biological context: immune cell enrichment near tumor cells may indicate active immune response or immunosuppressive niche depending on the cell types involved (e.g., CD8+ T cells vs. Tregs).\n\n**Spatially variable genes (SVGs)**: Moran's I > 0.3 with FDR \u003C 0.05 indicates strong spatial patterning. Classify SVGs by pattern: gradients (morphogen signaling, e.g., WNT along crypt-villus axis), hotspots (focal expression in immune aggregates), boundary genes (enriched at domain interfaces, e.g., epithelial-mesenchymal transition markers). SVGs with known spatial biology roles (e.g., tissue polarity genes) are higher confidence than novel candidates.\n\n### Synthesis Questions\n\nA complete spatial transcriptomics report should answer:\n1. What spatial domains were identified, and do they correspond to known tissue architecture?\n2. Which genes show significant spatial variability, and what pattern types do they exhibit?\n3. Are specific cell type pairs enriched or depleted in spatial proximity?\n4. What ligand-receptor interactions are active at domain boundaries or cell-cell interfaces?\n5. How do spatial findings compare to bulk or single-cell data from the same tissue type?\n\n---\n\n## Programmatic Access (Beyond Tools)\n\nWhen ToolUniverse tools return metadata but you need the actual expression matrices:\n\n```python\nimport scanpy as sc, pandas as pd, requests, io\n\n# Load h5ad (most common format for spatial\u002Fsingle-cell)\nadata = sc.read_h5ad(\"spatial_data.h5ad\")\n\n# Load 10X Visium output directory\nadata = sc.read_visium(\"path\u002Fto\u002Fspaceranger_output\u002F\")\n\n# Download from GEO supplementary files\ngeo_id = \"GSE123456\"\n# Check for h5ad or MTX in supplementary files\nurl = f\"https:\u002F\u002Fwww.ncbi.nlm.nih.gov\u002Fgeo\u002Fquery\u002Facc.cgi?acc={geo_id}&targ=gsm&view=data\"\n\n# Load 10X MTX format (matrix + barcodes + features)\nadata = sc.read_10x_mtx(\"filtered_feature_bc_matrix\u002F\", var_names=\"gene_symbols\")\n\n# HuBMAP data portal\n# Search at https:\u002F\u002Fportal.hubmapconsortium.org\u002Fsearch then download via globus or direct link\n# Human Cell Atlas: https:\u002F\u002Fdata.humancellatlas.org\u002F — download h5ad\u002Floom files\n```\n\nSee `tooluniverse-data-wrangling` skill for format cookbook and bulk download patterns.\n\n---\n\n## Limitations\n\n- **Resolution**: Visium spots contain multiple cells (not single-cell)\n- **Gene coverage**: Imaging methods have limited gene panels\n- **3D structure**: Most platforms are 2D sections\n- **Tissue quality**: Requires well-preserved tissue for imaging\n- **Computational**: Large datasets require significant memory\n- **Reference dependency**: Deconvolution quality depends on scRNA-seq reference\n\n---\n\n## References\n\n**Methods**:\n- Squidpy: https:\u002F\u002Fdoi.org\u002F10.1038\u002Fs41592-021-01358-2\n- Cell2location: https:\u002F\u002Fdoi.org\u002F10.1038\u002Fs41587-021-01139-4\n- SpatialDE: https:\u002F\u002Fdoi.org\u002F10.1038\u002Fnmeth.4636\n\n**Platforms**:\n- 10x Visium: https:\u002F\u002Fwww.10xgenomics.com\u002Fproducts\u002Fspatial-gene-expression\n- MERFISH: https:\u002F\u002Fdoi.org\u002F10.1126\u002Fscience.aaa6090\n- Slide-seq: https:\u002F\u002Fdoi.org\u002F10.1126\u002Fscience.aaw1219\n\n---\n\n## Reference Files\n\n- [code_examples.md](code_examples.md) - Python code for all phases (scanpy, squidpy, cell2location)\n- [report_template.md](report_template.md) - Full example report (breast cancer TME)\n",{"name":5,"description":7},"main","a298c929b6cbd662e1fce54302ce520d5ceea1a5",".agents\u002Flibrary\u002Fskills\u002Ftooluniverse-spatial-transcriptomics","https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain","https:\u002F\u002Fgithub.com\u002FPrekzursil","2026-11-02 14:30:57",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add Prekzursil\u002Fagent-skills-toolchain --skill tooluniverse-spatial-transcriptomics",{"tool":56,"command":57},"bunx","bunx skills add Prekzursil\u002Fagent-skills-toolchain --skill tooluniverse-spatial-transcriptomics",{"tool":59,"command":60},"pnpm","pnpm dlx skills add Prekzursil\u002Fagent-skills-toolchain --skill tooluniverse-spatial-transcriptomics","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002F.agents\u002Flibrary\u002Fskills\u002Ftooluniverse-spatial-transcriptomics\u002FSKILL.md",true,[64,70],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"code_examples.md","REFERENCE","参考文档",7601,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002F.agents\u002Flibrary\u002Fskills\u002Ftooluniverse-spatial-transcriptomics\u002Fcode_examples.md",{"path":71,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":72,"sourceHtmlUrl":73},"report_template.md",4003,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002F.agents\u002Flibrary\u002Fskills\u002Ftooluniverse-spatial-transcriptomics\u002Freport_template.md",[75,95,125,152,166,182],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":39},"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",[],[82,83,84,85,86,87,88,89,90,32,33,91,92,93,94],"clarify requirements","clarify","requirements","risk","options","task","prompts","goal","scanning","repo","injection","execution","file",{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":106,"publishedAt":39},"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",[101],{"categoryNo":102,"categoryName":103,"taxonomyType":104,"taxonomyTypeDesc":105},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[107,108,109,110,111,35,112,113,114,115,116,117,118,119,32,120,121,122,123,124],"openmm md","how","decision","pick","linux","tool","stack","open","NVIDIA","gpu","license","workflow","windows","free","molecular dynamics","local","do","MCP",{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":137,"publishedAt":39},"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",[131,134],{"categoryNo":132,"categoryName":133,"taxonomyType":104,"taxonomyTypeDesc":105},"01JBSEEDCAT000000000000003","演示文稿",{"categoryNo":135,"categoryName":136,"taxonomyType":104,"taxonomyTypeDesc":105},"01JBSEEDCAT000000000000008","测试与质量",[138,139,140,141,142,143,144,145,146,147,108,148,149,150,151],"review","visual","visual review","pages","web","false","iteration","take","check","slides","ui","screenshot","playwright","screenshots",{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":158,"publishedAt":39},"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",[],[154,159,160,161,162,163,164,165],"setup","report","project","installation","project setup","issues","state",{"skillNo":167,"name":168,"nameZh":6,"description":169,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":170,"categories":171,"keywords":173,"publishedAt":39},"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",[172],{"categoryNo":102,"categoryName":103,"taxonomyType":104,"taxonomyTypeDesc":105},[168,174,87,175,176,177,32,178,179,180,181],"start issue","issue","ready","work on issue","user","work","work on","development",{"skillNo":183,"name":159,"nameZh":6,"description":184,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":185,"categories":186,"keywords":187,"publishedAt":39},"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",[],[159,161,122,188,163,189],"files","interactive"]