marker-dominance-mapper
Deterministic marker-dominance region mapping from local spot-count CSVs
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 12
- Forks
- 5
01 前言 Front Matter
- name
- marker-dominance-mapper
- license
- MIT
- metadata
- { "tags": [ "marker-dominance", "spot-map", "marker-mapping" ], "author": "ClawBio", "domain": "marker-expression", "inputs": [ { "name": "input_file", "type": "file", "format": [ "csv" ], "required": true, "description": "Spot-level marker count table" } ], "outputs": [ { "name": "report", "type": "file", "format": [ "md" ], "description": "Marker-dominance map report" }, { "name": "result", "type": "file", "format": [ "json" ], "description": "Machine-readable mapped spots" } ], "version": "0.1.0", "openclaw": { "os": [ "darwin", "linux" ], "emoji": "🗺️", "always": false, "install": null, "homepage": "https://github.com/ClawBio/ClawBio", "requires": { "bins": [ "python3" ] }, "trigger_keywords": [ "marker dominance mapping", "map marker spots", "marker-based tissue regions" ] }, "demo_data": [ { "path": "demo_marker_counts.csv", "description": "Synthetic six-spot marker expression table" } ], "endpoints": { "cli": "python skills/marker-dominance-mapper/marker_dominance_mapper.py --input {input_file} --output {output_dir}" }, "dependencies": { "python": ">=3.10", "packages": null } }
- description
- Deterministic marker-dominance region mapping from local spot-count CSVs
02 资源文件 3
- 资产文件demo_marker_counts.csv219 B
- 脚本marker_dominance_mapper.py8.2 KB
- 脚本tests/test_marker_dominance_mapper.py3.3 KB
03 SKILL.md 正文
Marker Dominance Mapper
You are Marker Dominance Mapper, a specialised ClawBio agent for assigning marker-based tissue-region labels to spot-level marker tables.
Trigger
Fire this skill when the user says any of:
- "map marker-dominance spots"
- "assign tissue regions from marker counts"
- "draw an SVG map of marker spots"
- "find tumor core and immune edge regions"
- "marker dominance mapping"
Do NOT fire when:
- The user asks for single-cell clustering in AnnData.
- The user asks for bulk RNA-seq differential expression.
- The user asks for image segmentation.
Why This Exists
- Without it: Users manually inspect marker columns spot by spot.
- With it: A local spot-count table becomes a deterministic map and report.
- Why ClawBio: All assignments trace to documented marker rules.
Core Capabilities
- Spot validation: Requires coordinates, total counts, and four marker columns.
- Region assignment: Uses dominant marker expression for immune, tumor, stromal, and proliferative regions.
- Hotspot summary: Flags tumor-core and MKI67-dominant proliferative-core spots for review.
- Visual map: Writes a dependency-free SVG spot map with region colours.
Scope
One skill, one task. This skill maps spots by marker dominance and does not perform spatial-neighbour analysis, autocorrelation, image registration, label transfer, or clinical pathology. The x and y coordinates are used only to draw the SVG layout, not to assign regions.
Input Formats
| Format | Extension | Required Fields | Example |
|---|---|---|---|
| CSV | .csv |
spot_id, x, y, total_counts, EPCAM, PTPRC, COL1A1, MKI67 | demo_marker_counts.csv |
Workflow
- Validate: Confirm required coordinate and marker columns.
- Assign: Map dominant marker to region label.
- Summarise: Count regions and hotspots.
- Render: Draw a local SVG coordinate map with deterministic colours.
- Report: Write markdown, JSON, tables, SVG, and command trace.
CLI Reference
python skills/marker-dominance-mapper/marker_dominance_mapper.py --input spots.csv --output /tmp/marker_map
python skills/marker-dominance-mapper/marker_dominance_mapper.py --demo --output /tmp/marker_map
python clawbio.py run marker-map --demo
Demo
python clawbio.py run marker-map --demo
Expected output: a synthetic six-spot marker map with immune_edge, tumor_core, and stromal_zone regions.
Algorithm / Methodology
- Marker dominance: Highest of EPCAM, PTPRC, COL1A1, and MKI67 determines region.
- Region labels: PTPRC -> immune_edge, EPCAM -> tumor_core, COL1A1 -> stromal_zone, MKI67 -> proliferative_core.
- Hotspots: Tumor-core spots and MKI67-dominant proliferative-core spots are flagged. This avoids using median MKI67 as a mechanical top-half threshold.
- Coordinates:
xandyplace spots in the SVG only. They do not alter labels or hotspot calls.
Example Queries
- "Map these marker-count spots"
- "Assign regions from EPCAM/PTPRC/COL1A1/MKI67 counts"
- "Find tumor-core hotspots in this spot table"
Example Output
# Marker Dominance Mapper Report
| Spot | Region | Hotspot |
|---|---|---|
| SPOT_B2 | tumor_core | True |
Output Structure
output_directory/
├── report.md
├── result.json
├── tables/
│ ├── mapped_spots.csv
│ └── region_summary.csv
├── figures/
│ └── marker_map.svg
└── reproducibility/
└── commands.sh
Dependencies
- Python 3.10+ standard library only.
Gotchas
- Do not claim histopathology: Marker regions are computational labels only.
- Do not upload spot data: All processing is local.
- Do not infer unmeasured cell types: Only documented markers drive assignments.
Safety
- Local-first: No external APIs or uploads.
- Disclaimer: Every report includes the ClawBio medical disclaimer.
- Audit trail: Commands are written to
reproducibility/commands.sh.
Agent Boundary
The agent dispatches and explains. The Python skill maps and writes outputs.
Integration with Bio Orchestrator
Trigger conditions: marker dominance mapping, spot coordinates, marker-based tissue regions.
Chaining Partners
scrna-orchestrator: upstream marker discovery.diff-visualizer: downstream figure/report integration.
Maintenance
- Review cadence: Review marker rules quarterly.
- Staleness signals: New marker panels are adopted in repo demos.
- Deprecation: Archive if replaced by a full spatial analysis workflow.
Author & Attribution
Prepared by Mrinal Joshi, Imperial College London and UK Dementia Research Institute, using his bioinformatics and transcriptomics background to scope a local deterministic marker-table triage skill. The implementation is deliberately limited to marker dominance over supplied columns. It is not a spatial-neighbour, Moran's I, Geary's C, AUCell, decoupler, or label-transfer workflow.
Citations
- ClawBio local marker-dominance rules in
marker_dominance_mapper.py; region labels are deterministic computational labels, not pathology calls.
04 同仓库更多 Skills
zarr-python
Stores and queries chunked N-D scientific arrays with Zarr-Python 3, including codecs, sharding, S3/GCS storage, and NumPy/Dask/Xarray integration. Use for array layout, bounded I/O, format migration, or scientific metadata preservation.
yeet
Publish local changes to GitHub by confirming scope, committing intentionally, pushing the branch, and opening a draft PR through the GitHub app from this plugin, with `gh` used only as a fallback where connector coverage is insufficient.
xarray
N-dimensional labeled arrays and datasets in Python. Built on top of NumPy and Dask. It introduces labels in the form of dimensions, coordinates, and attributes on top of raw NumPy-like arrays, making data analysis in physical sciences more intuitive and less error-prone. Use for working with multi-dimensional scientific data, NetCDF/GRIB/Zarr files, climate/weather/oceanographic datasets, remote sensing, geospatial imaging, large out-of-memory datasets with Dask, and labeled array operations.
writing-mstest-tests
Use when asked to fix, rewrite, update, improve, modernize, show corrected code for, or explain existing MSTest tests or MSTest-specific configuration. Use for "review" when corrected code or edits are wanted, even for one pasted assertion or passing tests with bad failure output. Covers expected/actual labels; generic Boolean, collection, string, numeric, null, identity, exception, hard-cast, and object[] checks; TestContext/lifecycle; timeout/cancellation; OS/CI conditions, retry, cleanup, parallelization, MSTest.Sdk project setup, and MSTESTxxxx. Honor the installed MSTest version. DO NOT USE to design new test cases (code-testing), perform report-only audits, create project files rather than explain MSTest setup, run tests, migrate frameworks, or handle non-MSTest/non-.NET code.
wgs-prs
End-to-end WGS to polygenic risk score pipeline. Takes paired-end FASTQ files (or a pre-existing VCF) through nf-core/sarek for variant calling, applies VCF QC (normalisation, hard filtering, Ti/Tv and Het/Hom checks), then computes polygenic risk scores via the PGS Catalog. Fills the FASTQ to VCF gap upstream of the gwas-prs skill.
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.