[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DTKTB24QWQ51SA9DKAQZ9M":3,"skill-same:01M6DTKTB24QWQ51SA9DKAQZ9M":118},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":49,"repositoryHtmlUrl":50,"repositoryHomepageUrl":51,"ownerHtmlUrl":52,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":53,"install":54,"resources":67},"01M6DTKTB24QWQ51SA9DKAQZ9M","spatial-annotate",null,"Load when assigning per-spot cell-type labels on a spatial AnnData via marker-gene scoring or scRNA-reference mapping (Tangram \u002F scANVI \u002F CellAssign). Skip when computing spot-level cell-type proportions for multi-cell-per-spot platforms (use spatial-deconv); tissue-domain detection (use spatial-domains).","TianGzlab\u002FOmicsClaw","TianGzlab","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F150978281?v=4","01M6DT9WNJJ470ADHPSMFAA02Y","01M6DT9WSN09C5K65GB6RK18R9",161,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fspatial\u002Fspatial-annotate\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"spatial annotate","Spatial","annotate","type","cellassign","tangram","marker-based","cell-type","via","scanvi","annotation","mapping","detection","cell","spot","domain","scoring","reference","use","anndata","2026-11-10 10:12:30",false,"---\nname: spatial-annotate\ndescription: Load when assigning per-spot cell-type labels on a spatial AnnData via marker-gene scoring\n  or scRNA-reference mapping (Tangram \u002F scANVI \u002F CellAssign). Skip when computing spot-level cell-type\n  proportions for multi-cell-per-spot platforms (use spatial-deconv); tissue-domain detection (use spatial-domains).\ntrigger: cell type annotation, annotate cell types, Tangram, scANVI, CellAssign, marker genes, label transfer, spatial annotation\ntags:\n- spatial\n- annotation\n- cell-type\n- marker-based\n- tangram\n- scanvi\n- cellassign\n---\n\n# spatial-annotate\n\n## When to use\n\nAssign discrete cell labels using marker overlap, Tangram, scANVI or CellAssign. Use spatial-deconv for proportions and spatial-domains for tissue regions.\n\n## Use from a step\n\n```python\nfrom skills._sdk.notebook import load_skill, read_input, write_output\nlibrary = load_skill(\"spatial-annotate\")\ndata = read_input(\"input.h5ad\")\ndata = library.annotate(data, cluster_key=\"leiden\")\nwrite_output(library.cell_type_counts(data), \"tables\u002Fresults.csv\")\n```\n\nRun [examples\u002Fexample_step.py](examples\u002Fexample_step.py) through the step runner.\n\n## API\n\n\u003C!-- api:begin generated from _api.py; regenerate with run.py api \u003Cskill dir> --write -->\n\n### `annotate(adata, *, method: str='marker_based', reference=None, species: str='human', marker_genes: dict | None=None, random_state: int=0, **parameters)`\n\nAnnotate in place and return the same AnnData without file writes.\n\nMarker and Tangram methods read log-normalized X. scANVI\u002FCellAssign\nrequire raw counts in the requested layer (normally counts), raw, or\nexplicitly selected X. Reference AnnData is copied before training.\n\n:param adata: Spatial AnnData with normalized X and method-required labels\u002Fcounts.\n:param method: CLI default marker_based; tangram, scanvi or cellassign are optional.\n:param reference: Labelled reference AnnData for Tangram\u002FscANVI; None otherwise.\n:param species: Human by default or mouse for built-in marker dictionaries.\n:param marker_genes: Optional CellAssign marker mapping; None uses species markers.\n:param random_state: Training seed, 0 by default; change to assess sensitivity.\n:param parameters: Method keyword options in references\u002Fparameters.md. Defaults\n    match the CLI, including cluster_key=leiden and n_marker_genes=50.\n:returns: The same AnnData with cell_type labels and JSON run diagnostics.\n:raises ValueError: Invalid method, species, missing reference or invalid counts.\n:raises TypeError: Unknown method parameter.\n:raises ImportError: Missing backend; use install_skill_deps for the named package.\n\n### `run_info(adata, *, keep: bool=True) -> dict`\n\nRead annotation counts, method parameters and cluster-marker scores.\n\n:param adata: AnnData returned by annotate.\n:param keep: True retains diagnostics; False removes them before CLI serialization.\n:returns: Diagnostic dict, or an empty dict before analysis.\n\n### `cell_type_counts(adata)`\n\nCount cell labels and their percentages.\n\n:param adata: AnnData with cell_type labels; expression values are not read.\n:returns: DataFrame with cell_type, n_cells and proportion (percent).\n:raises KeyError: Annotation labels are absent.\n\n### `annotation_figure(adata)`\n\nPlot discrete cell labels in spatial coordinates.\n\n:param adata: Annotated spatial AnnData; reads coordinates and cell_type.\n:returns: A matplotlib Figure without saving it.\n:raises KeyError: Annotation labels are absent.\n\n\u003C!-- api:end -->\n\n## Methods and parameters\n\nMarker\u002FTangram methods read normalized X. scANVI\u002FCellAssign validate raw integer counts. Reference methods take reference=AnnData; marker_genes applies only to CellAssign.\nSee [parameters](references\u002Fparameters.md) and [methodology](references\u002Fmethodology.md).\n\n## Gotchas\n\n- `annotate` requires a reference for Tangram\u002FscANVI. `tables\u002Fcluster_annotations.csv` is marker-method output; probabilities are method-dependent.\n- `run_info(keep=False)` removes library diagnostics before CLI serialization.\n\n## Inputs and outputs\n\nThe library returns AnnData, DataFrames or Figures without file writes. The CLI\nkeeps reports, result.json, tables and conditional gallery outputs. See the\ncomplete [output contract](references\u002Foutput_contract.md) for filenames and conditions.\n\n## CLI\n\n```bash\npython skills\u002Fspatial\u002Fspatial-annotate\u002Fspatial_annotate.py --input data.h5ad --output results\u002Fspatial-annotate\n```\n\n## See also\n\n- [Methodology](references\u002Fmethodology.md)\n- [Parameters](references\u002Fparameters.md)\n- [Output contract](references\u002Foutput_contract.md)\n\n## Dependencies\n\n`anndata`, `matplotlib`, `numpy`, `pandas`, `scanpy`, `scipy`, `scvi-tools`, `seaborn`, `tangram-sc`, `torch`\n","# spatial-annotate\n\n## When to use\n\nAssign discrete cell labels using marker overlap, Tangram, scANVI or CellAssign. Use spatial-deconv for proportions and spatial-domains for tissue regions.\n\n## Use from a step\n\n```python\nfrom skills._sdk.notebook import load_skill, read_input, write_output\nlibrary = load_skill(\"spatial-annotate\")\ndata = read_input(\"input.h5ad\")\ndata = library.annotate(data, cluster_key=\"leiden\")\nwrite_output(library.cell_type_counts(data), \"tables\u002Fresults.csv\")\n```\n\nRun [examples\u002Fexample_step.py](examples\u002Fexample_step.py) through the step runner.\n\n## API\n\n\u003C!-- api:begin generated from _api.py; regenerate with run.py api \u003Cskill dir> --write -->\n\n### `annotate(adata, *, method: str='marker_based', reference=None, species: str='human', marker_genes: dict | None=None, random_state: int=0, **parameters)`\n\nAnnotate in place and return the same AnnData without file writes.\n\nMarker and Tangram methods read log-normalized X. scANVI\u002FCellAssign\nrequire raw counts in the requested layer (normally counts), raw, or\nexplicitly selected X. Reference AnnData is copied before training.\n\n:param adata: Spatial AnnData with normalized X and method-required labels\u002Fcounts.\n:param method: CLI default marker_based; tangram, scanvi or cellassign are optional.\n:param reference: Labelled reference AnnData for Tangram\u002FscANVI; None otherwise.\n:param species: Human by default or mouse for built-in marker dictionaries.\n:param marker_genes: Optional CellAssign marker mapping; None uses species markers.\n:param random_state: Training seed, 0 by default; change to assess sensitivity.\n:param parameters: Method keyword options in references\u002Fparameters.md. Defaults\n    match the CLI, including cluster_key=leiden and n_marker_genes=50.\n:returns: The same AnnData with cell_type labels and JSON run diagnostics.\n:raises ValueError: Invalid method, species, missing reference or invalid counts.\n:raises TypeError: Unknown method parameter.\n:raises ImportError: Missing backend; use install_skill_deps for the named package.\n\n### `run_info(adata, *, keep: bool=True) -> dict`\n\nRead annotation counts, method parameters and cluster-marker scores.\n\n:param adata: AnnData returned by annotate.\n:param keep: True retains diagnostics; False removes them before CLI serialization.\n:returns: Diagnostic dict, or an empty dict before analysis.\n\n### `cell_type_counts(adata)`\n\nCount cell labels and their percentages.\n\n:param adata: AnnData with cell_type labels; expression values are not read.\n:returns: DataFrame with cell_type, n_cells and proportion (percent).\n:raises KeyError: Annotation labels are absent.\n\n### `annotation_figure(adata)`\n\nPlot discrete cell labels in spatial coordinates.\n\n:param adata: Annotated spatial AnnData; reads coordinates and cell_type.\n:returns: A matplotlib Figure without saving it.\n:raises KeyError: Annotation labels are absent.\n\n\u003C!-- api:end -->\n\n## Methods and parameters\n\nMarker\u002FTangram methods read normalized X. scANVI\u002FCellAssign validate raw integer counts. Reference methods take reference=AnnData; marker_genes applies only to CellAssign.\nSee [parameters](references\u002Fparameters.md) and [methodology](references\u002Fmethodology.md).\n\n## Gotchas\n\n- `annotate` requires a reference for Tangram\u002FscANVI. `tables\u002Fcluster_annotations.csv` is marker-method output; probabilities are method-dependent.\n- `run_info(keep=False)` removes library diagnostics before CLI serialization.\n\n## Inputs and outputs\n\nThe library returns AnnData, DataFrames or Figures without file writes. The CLI\nkeeps reports, result.json, tables and conditional gallery outputs. See the\ncomplete [output contract](references\u002Foutput_contract.md) for filenames and conditions.\n\n## CLI\n\n```bash\npython skills\u002Fspatial\u002Fspatial-annotate\u002Fspatial_annotate.py --input data.h5ad --output results\u002Fspatial-annotate\n```\n\n## See also\n\n- [Methodology](references\u002Fmethodology.md)\n- [Parameters](references\u002Fparameters.md)\n- [Output contract](references\u002Foutput_contract.md)\n\n## Dependencies\n\n`anndata`, `matplotlib`, `numpy`, `pandas`, `scanpy`, `scipy`, `scvi-tools`, `seaborn`, `tangram-sc`, `torch`\n",{"name":5,"tags":43,"trigger":45,"description":7},[44,28,25,24,23,27,22],"spatial","cell type annotation, annotate cell types, Tangram, scANVI, CellAssign, marker genes, label transfer, spatial annotation","main","90a3bec3e6549bc33dddbf67e4b23869736c49d1","skills\u002Fspatial\u002Fspatial-annotate",27,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw","https:\u002F\u002FTianGzlab.github.io\u002FOmicsClaw\u002F","https:\u002F\u002Fgithub.com\u002FTianGzlab","2026-10-08 01:36:11",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add TianGzlab\u002FOmicsClaw --skill spatial-annotate",{"tool":60,"command":61},"bunx","bunx skills add TianGzlab\u002FOmicsClaw --skill spatial-annotate",{"tool":63,"command":64},"pnpm","pnpm dlx skills add TianGzlab\u002FOmicsClaw --skill spatial-annotate","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fspatial\u002Fspatial-annotate\u002FSKILL.md",true,[68,74,78,84,90,94,98,102,106,110,114],{"path":69,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":72,"sourceHtmlUrl":73},"_api.py","SCRIPT","脚本",6293,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fspatial\u002Fspatial-annotate\u002F_api.py",{"path":75,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":76,"sourceHtmlUrl":77},"examples\u002Fexample_step.py",419,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fspatial\u002Fspatial-annotate\u002Fexamples\u002Fexample_step.py",{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"OPERATOR.json","REFERENCE","参考文档",360,"https:\u002F\u002Fgithub.com\u002Fhefarica\u002Farbitragex-v2\u002Fblob\u002Fmain\u002Fskills\u002Farbitragex-ultra\u002Foperators\u002Fop_26\u002FOPERATOR.json",{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"r_visualization\u002Fannotation_publication_template.R","OTHER","其他",1593,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fspatial\u002Fspatial-annotate\u002Fr_visualization\u002Fannotation_publication_template.R",{"path":91,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":92,"sourceHtmlUrl":93},"r_visualization\u002FREADME.md",1480,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fspatial\u002Fspatial-annotate\u002Fr_visualization\u002FREADME.md",{"path":95,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":96,"sourceHtmlUrl":97},"references\u002Fmethodology.md",11096,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fspatial\u002Fspatial-annotate\u002Freferences\u002Fmethodology.md",{"path":99,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":100,"sourceHtmlUrl":101},"references\u002Foutput_contract.md",1735,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fspatial\u002Fspatial-annotate\u002Freferences\u002Foutput_contract.md",{"path":103,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":104,"sourceHtmlUrl":105},"references\u002Fparameters.md",4428,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fspatial\u002Fspatial-annotate\u002Freferences\u002Fparameters.md",{"path":107,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":108,"sourceHtmlUrl":109},"spatial_annotate.py",37027,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fspatial\u002Fspatial-annotate\u002Fspatial_annotate.py",{"path":111,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":112,"sourceHtmlUrl":113},"tests\u002Ftest_api.py",1395,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fspatial\u002Fspatial-annotate\u002Ftests\u002Ftest_api.py",{"path":115,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":116,"sourceHtmlUrl":117},"tests\u002Ftest_spatial_annotate.py",5642,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fspatial\u002Fspatial-annotate\u002Ftests\u002Ftest_spatial_annotate.py",[119,132,144,160,184,205],{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":38},"01M6DTP4X225Q92RMY8XXHPCTT","demo-skill","A fixture skill for the skill environment tests. Use it for nothing else.","https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Ftests\u002Fskillenv\u002Ffixtures\u002Fskills\u002Fdemo\u002Fdemo-skill\u002FSKILL.md",[],[126,127,128,129,130,36,131],"demo skill","demo","tests","fixture","fixture skill","environment",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":38},"01M6DTP28JTWQK3HHXDNQV8BBV","fake-domains","Test fixture for the golden deployment in tests\u002Fentry. Load never; it has no script.","https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Ftests\u002Fentry\u002Ffake_skills\u002Fspatial\u002Ffake-domains\u002FSKILL.md",[],[139,140,141,128,129,142,143],"domains","fake domains","deployment","never","test",{"skillNo":145,"name":146,"nameZh":6,"description":147,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":150,"publishedAt":38},"01M6DTNZ4AMWKTME1T18K5C643","replace-me-skill","Load when copying this directory to bootstrap a new OmicsClaw skill. Skip when an existing skill already covers the request.","https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Ftemplates\u002Fskill\u002FSKILL.md",[],[151,152,153,154,155,156,157,158,159],"me","replace me skill","template","directory","skill template","existing skill","new skill","bootstrap","scaffold",{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":166,"publishedAt":38},"01M6DTNV63MTD0Q6YRC52F0B1Y","spatial-velocity","Load when estimating RNA velocity on a spatial AnnData with `layers[\"spliced\"]` + `layers[\"unspliced\"]` via scVelo (stochastic \u002F deterministic \u002F dynamical) or veloVI (deep generative). Skip when input lacks the spliced\u002Funspliced layers (must be quantified upstream by velocyto \u002F kb-python \u002F STARsolo); non-spatial scRNA velocity (use sc-velocity).","https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fspatial\u002Fspatial-velocity\u002FSKILL.md",[],[167,168,19,169,170,171,172,173,174,175,26,176,177,178,179,180,181,36,182,183],"velocity","spatial velocity","scvelo","input","starsolo","time","deep","RNA","kb-python","velocyto","rna-velocity","velovi","dynamics","upstream","kb","python","deterministic",{"skillNo":185,"name":186,"nameZh":6,"description":187,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":188,"categories":189,"keywords":190,"publishedAt":38},"01M6DTNPMR227NAT8QFY620YDW","spatial-trajectory","Load when inferring pseudotime \u002F lineage trajectories on a preprocessed spatial AnnData via DPT (default — diffusion pseudotime), CellRank (terminal-state + fate-probability), or Palantir (waypoint branch probabilities). Skip when the data has spliced\u002Funspliced layers and you want velocity-driven dynamics (use spatial-velocity); non-spatial scRNA pseudotime (use sc-pseudotime).","https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fspatial\u002Fspatial-trajectory\u002FSKILL.md",[],[19,191,192,193,194,195,196,197,26,198,199,200,201,31,167,202,36,203,37,204],"trajectory","spatial trajectory","state","terminal","lineage","diffusion","cellrank","palantir","dpt","pseudotime","probability","default","branch","data",{"skillNo":206,"name":207,"nameZh":6,"description":208,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":209,"categories":210,"keywords":211,"publishedAt":38},"01M6DTNJEYFT33P84DGHDNXW95","spatial-statistics","Load when running spatial autocorrelation \u002F hotspot \u002F co-occurrence \u002F neighbourhood-enrichment \u002F Ripley K stats on a clustered spatial AnnData via squidpy. Skip when ranking spatially variable genes (use spatial-genes); tissue domain detection (use spatial-domains).","https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fspatial\u002Fspatial-statistics\u002FSKILL.md",[],[212,213,19,26,214,215,216,217,218,219,139,220,221,222,33,36,37,30,223,224],"spatial statistics","statistics","nhood-enrichment","co-occurrence","ripley","geary","moran","neighbourhood","ranking","autocorrelation","local","enrichment","stats"]