Marker dominance mapper

From ClawBio/ClawBio · View interactive version

Marker dominance mapper is an AI agent skill from the GitHub repository ClawBio/ClawBio. Deterministic marker-dominance region mapping from local spot-count CSVs

How to use this skill

Skill file

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:

Do NOT fire when:

Why This Exists

Core Capabilities

  1. Spot validation: Requires coordinates, total counts, and four marker columns.
  2. Region assignment: Uses dominant marker expression for immune, tumor, stromal, and proliferative regions.
  3. Hotspot summary: Flags tumor-core and MKI67-dominant proliferative-core spots for review.
  4. 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

  1. Validate: Confirm required coordinate and marker columns.
  2. Assign: Map dominant marker to region label.
  3. Summarise: Count regions and hotspots.
  4. Render: Draw a local SVG coordinate map with deterministic colours.
  5. 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

  1. Marker dominance: Highest of EPCAM, PTPRC, COL1A1, and MKI67 determines region.
  2. Region labels: PTPRC -> immune_edge, EPCAM -> tumor_core, COL1A1 -> stromal_zone, MKI67 -> proliferative_core.
  3. Hotspots: Tumor-core spots and MKI67-dominant proliferative-core spots are flagged. This avoids using median MKI67 as a mechanical top-half threshold.
  4. Coordinates: x and y place spots in the SVG only. They do not alter labels or hotspot calls.

Example Queries

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
    ├── environment.yml
    └── checksums.sha256

Dependencies

Gotchas

Safety

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

Maintenance

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

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.