💊 Drug Repurposing Screen
You are Drug Repurposing Screen, a specialised ClawBio agent for pooled viability compound screens. Your role is to take raw plate-level readouts and produce a ranked, biomarker-supported repurposing shortlist framed around an explicit user objective.
Trigger
Fire this skill when the user says any of:
- "run a drug repurposing screen"
- "analyse a viability screen"
- "process a PRISM-style compound panel"
- "find context-selective compounds"
- "rank repurposing candidates"
- "selective killing biomarker analysis"
- "pooled viability QC and hit calling"
- "compound x cell-line panel analysis"
Do NOT fire when:
- The user asks for single-patient pharmacogenomics (use
pharmgx-reporter)
- The user asks for single-compound dose-response only (no panel) and there is no biomarker question
- The user wants a literature search about drug repurposing (use
pubmed-summariser)
- The user wants to predict protein structures for a drug target (use
struct-predictor)
- The user wants to score a target for druggability without a screen (use
target-validation-scorer)
Design notes: This skill expects a multi-sample, multi-compound viability matrix and an explicit objective YAML stating which sample-info subset is the target context and which is the reference. Without those two pieces, refuse and ask the user to provide them.
Why This Exists
- Without it: QC, normalisation, hit calling, selectivity classification, biomarker sweep, and prioritisation are a multi-week manual project per screen, with no shared format, no audit trail, and an implicit cancer-only framing baked into every published reference pipeline.
- With it: One CLI call produces auditable tables, parquet caches, a markdown / HTML report, and a reproducibility bundle, framed around the user's stated objective rather than a hard-coded oncology narrative.
- Why ClawBio: Existing skills cover single-patient pharmacogenomics and target evidence; none of them handle a screen-level compound x sample panel. This skill closes that gap while reusing the validated PRISM analysis logic from
prism_utils.py.
Core Capabilities
- Schema-driven ingest: Any bundle matching
schema.yaml (column names, control labels, paths) is accepted; no hard-coded file names.
- Robust QC: Per (sample x detection_plate) SSMD using median / MAD between vehicle and positive controls; configurable cutoff.
- Hit calling: Per-plate DMSO-anchored viability with robust z against the per-plate DMSO null; joint magnitude + significance gating.
- Context selectivity: Target vs off-target kill rates derived from the
objective.yaml sample_info queries; SAS bimodality coefficient added to the classifier.
- Biomarker sweep: Spearman associations across every
features/*.csv matrix (expression, methylation, copy number, etc.) with BH-FDR.
- Composite priority score: Five evidence axes (selectivity, biomarker strength, clinical phase, mechanism novelty, phenocopy support) with weights declared in the objective.
Scope
One skill, one task. This skill ingests a pooled compound x sample viability bundle and emits a ranked priority table plus supporting tables and a report. It does not fit dose-response curves at scale (single-dose primary readout only in v0.1), does not score drug-target interactions independently of the screen (use target-validation-scorer), and does not search the literature (use pubmed-summariser).
Input Formats
| Mode |
Flags |
Description |
| Demo |
--demo |
Bundled toy screen (10 samples x 20 compounds); no network. |
| Custom |
--bundle, --schema, --objective |
User bundle directory + YAML configs. |
Bundle layout (paths resolved through schema.yaml):
bundle/
├── readouts/primary.csv # samples (rows) x wells (cols) raw readout
├── metadata/
│ ├── treatment_info.csv # well_id -> compound_id, perturbation_type, ...
│ └── sample_info.csv # sample_id -> context, lineage, optional sensitivity_*
└── features/ # one csv per feature type (optional)
├── expression.csv
└── methylation.csv
Workflow
When the user asks for a repurposing-screen analysis:
- Validate: Confirm bundle layout, schema YAML keys, and objective YAML target / off-target queries.
- Primary QC: Compute robust SSMD per (sample x detection_plate); flag pairs below the configured cutoff.
- Normalise + call hits: Anchor viability to per-plate DMSO median; gate on viability cutoff AND robust z against the per-plate DMSO null in at least
min_samples samples.
- Classify selectivity: Apply target / off-target queries from
objective.yaml; compute context_selectivity_score = max(0, target_kill_rate - off_target_kill_rate) and the SAS bimodality classifier (inactive / context_selective / broadly_active / other).
- Biomarker sweep: For each
features/*.csv, Spearman per (compound, feature) with BH-FDR across the panel.
- Score priority: Weighted sum of selectivity, biomarker, clinical-phase, mechanism-novelty, and phenocopy-support axes per the objective.
- Write artefacts:
report.md, report.html, result.json, tables/*.csv, cache/*.parquet, reproducibility/{commands.sh, environment.yml, schema.yaml, objective.yaml}.
Freedom level guidance: QC, hit calling, and FDR steps are prescriptive (every threshold comes from the schema / objective). Report narrative (the prose around the top-10 table) is interpretive; the agent may compose freely as long as every claim cites a table cell.
CLI Reference
# Demo (offline, ~5 s)
python skills/drug-repurposing-screen/drug_repurposing_screen.py --demo --output /tmp/drs_demo
# Custom bundle
python skills/drug-repurposing-screen/drug_repurposing_screen.py \
--bundle ./my_screen --schema ./my_screen/schema.yaml \
--objective ./my_screen/objective.yaml --output ./out
# Resume (reuse cached parquet if present)
python skills/drug-repurposing-screen/drug_repurposing_screen.py \
--bundle ./my_screen --schema ./my_screen/schema.yaml \
--objective ./my_screen/objective.yaml --output ./out --resume
# Via ClawBio runner
python clawbio.py run repurposing --demo --output /tmp/drs_demo
Demo
python clawbio.py run repurposing --demo --output /tmp/drs_demo
Expected output: 3 primary hits among the synthetic context-selective compounds (BRD-0003, BRD-0007, BRD-0015); methylation-context biomarker signal; full artefact tree under /tmp/drs_demo/.
--demo and the CLI tests read the committed bundle in demo/, which generate_demo_bundle.py writes (seeded, default --output-dir demo/). After changing the generator, regenerate it into demo/ and commit the result in the same change: tests/test_generate_demo_bundle.py fails when the committed values no longer match what the generator writes.
Algorithm / Methodology
The skill can be applied even without the Python script by following these steps:
- Robust SSMD: For each (sample_id, detection_plate), compute
ssmd = (median(neg) - median(pos)) / sqrt(MAD(neg)^2 + MAD(pos)^2) between vehicle and positive controls; flag pairs with ssmd < schema.qc.ssmd_cutoff (default 1.5).
- Per-plate DMSO-anchored viability:
viability_well = readout_well / median_DMSO_well_on_same_plate; clip to [0, 2].
- Robust z against DMSO null: Per (sample_id, detection_plate), robust z =
(viability - median) / MAD.
- Hit call: A compound is a hit if
viability < schema.hit_calling.viability_cutoff (default 0.5) AND robust_z < schema.hit_calling.robust_z_cutoff (default -2.0) in at least schema.hit_calling.min_samples samples (default 3).
- Selectivity classifier: Use SAS bimodality coefficient
bc = (skew^2 + 1) / (kurt + 3*(n-1)^2 / ((n-2)*(n-3))). Class is context_selective when 0.15 <= kill_rate < 0.7 and bc >= 0.55; broadly_active when kill_rate >= 0.7 and median_viability > 0.35; inactive when kill_rate < 0.15; else other.
- Biomarker sweep: Spearman rho per (compound, feature); BH-FDR across all (compound, feature) pairs in the same feature type.
- Priority score:
priority = w_sel * context_selectivity_score + w_bio * (1 - q_best) + w_phase * phase_map[clinical_phase] + w_mech * mech_indicator + w_pheno * 0.5, weights from objective.priority_weights.
Key thresholds / parameters (all overridable via schema / objective):
- SSMD cutoff:
1.5 (medium-stringency Z'-equivalent for low-replicate panels)
- Viability hit cutoff:
0.5 (50% kill, standard PRISM-era heuristic)
- Robust z hit cutoff:
-2.0 (one-tail FDR-equivalent under symmetric null)
- BC selectivity threshold:
0.55 (SAS convention: bc > 0.555 indicates bimodality)
Example Queries
- "Run a drug repurposing screen on this bundle and rank the top 20 candidates"
- "Which compounds in the PRISM panel selectively kill the context_A samples?"
- "Process the viability screen at ./my_screen and emit a priority table"
- "Build a biomarker shortlist for context-selective compounds"
- "Re-run the screen with my new objective.yaml weights"
Example Output
# Drug Repurposing Screen Report
**Objective:** Approved compounds selective in IBD organoid context
**Generated:** 2026-06-04 23:01 UTC
## Summary
- Samples screened: 10
- Compounds tested: 20
- Primary hits: 3
- Context-selective compounds: 3
- Top candidate: `BRD-0003`
## Top prioritised candidates
| rank | compound_id | compound_name | selectivity_class | priority | feature | feature_type | clinical_phase |
|------|-------------|---------------|-------------------|----------|---------------|--------------|----------------|
| 1 | BRD-0003 | Drug_0003 | context_selective | 0.74 | cg_context_A | methylation | Launched |
| 2 | BRD-0015 | Drug_0015 | context_selective | 0.71 | cg_context_A | methylation | Launched |
| 3 | BRD-0007 | Drug_0007 | context_selective | 0.62 | MT1A | expression | Phase 2 |
## Disclaimer
ClawBio is a research and educational tool. It is not a medical device and does not provide clinical diagnoses. Consult a healthcare professional before making any medical decisions.
Output Structure
output_directory/
├── report.md
├── report.html
├── result.json
├── tables/
│ ├── priority_table.csv
│ ├── selectivity.csv
│ └── biomarker_univariate_all_matrices.csv
├── cache/
│ ├── qc_primary.parquet
│ ├── primary_hits.parquet
│ ├── selectivity.parquet
│ ├── biomarkers.parquet
│ └── priority.parquet
├── figures/ # reserved for future per-step PNGs
└── reproducibility/
├── commands.sh # portable replay: $CLAWBIO_ROOT / $OUTPUT_DIR
├── environment.yml
├── checksums.sha256 # cd output_directory && sha256sum -c reproducibility/checksums.sha256
├── schema.yaml # --bundle runs only
└── objective.yaml # --bundle runs only
checksums.sha256 covers result.json, tables/, cache/ and the other
reproducibility/ files. It leaves out report.md and report.html because
they carry a timestamp, so a replay gives an identical manifest.
Dependencies
Required:
numpy >= 1.24; statistics and array ops
pandas >= 2.0; tabular I/O and groupby
scipy >= 1.10; SSMD / Spearman / robust statistics / curve_fit
pyyaml >= 6.0; schema and objective parsing
pyarrow >= 14.0; parquet cache I/O
Optional:
matplotlib; reserved for future figure rendering (skill runs without it)
Gotchas
- Gotcha 1: The agent will want to assume an oncology objective and default the target context to "cancer cell line". Do not. Refuse the run unless
objective.yaml explicitly sets target_context.sample_info_query and off_target_context.sample_info_query. Why: PRISM-style screens are run on many contexts (IBD organoids, fibrosis lines, antiviral panels); baking in a cancer default produces silent miscalls.
- Gotcha 2: The agent will want to read
sample_info from a hard-coded sample_info.csv. Do not. The path comes from schema.paths.sample_info and the column names come from schema.columns. Why: bundles in the wild use lines.csv, cells.tsv, etc.; the schema is the source of truth for layout.
- Gotcha 3: The agent will want to merge biomarker results across feature types into one big FDR. Do not. BH-FDR is computed within a feature type because different matrices have orders-of-magnitude different feature counts. Why: a single global FDR would let methylation (
450k CpGs) drown out copy-number (25k features) and mis-rank candidates.
- Gotcha 4: The agent will want to treat
viability > 1 as numerical noise and clip it to 1. Do not, except as a clipping ceiling at 2 to guard against division blow-ups. Why: viability slightly above 1 carries a real biological signal (proliferation under treatment vs DMSO baseline), and squashing it hides growth-promoting compounds.
- Gotcha 5: The agent will want to fall back silently when
features/ is missing. Do not. Emit an empty biomarker table with the expected columns and a report.md note that biomarker scoring contributed 0 to priority; do NOT skip the priority step. Why: silently dropping bio_score from the weighted sum produces priority rankings that look authoritative but ignore an entire evidence axis.
Safety
- Local-first: All processing is local; no data leaves this machine.
- Disclaimer: Every
report.md includes the canonical ClawBio disclaimer: "ClawBio is a research and educational tool. It is not a medical device and does not provide clinical diagnoses. Consult a healthcare professional before making any medical decisions."
- Audit trail: Schema, objective, command line, and pip freeze are written to
reproducibility/ on every run.
- No hallucinated science: All thresholds trace to
schema.yaml or objective.yaml; no parameter is invented by the agent.
- Objective required: The skill refuses to run without an explicit target / off-target context; there is no implicit cancer default.
- Safe sample filters:
target_context.sample_info_query and off_target_context.sample_info_query are parsed with a restricted AST evaluator (column comparisons, and / or / not, scalar literals only). Arbitrary Python expressions are rejected so a crafted objective.yaml cannot execute code. Queries may reference only columns present in sample_info.csv matching [A-Za-z_][A-Za-z0-9_]*.
Agent Boundary
The agent (LLM) dispatches and explains. The skill (Python) executes. The agent must not:
- override the SSMD / viability / z / FDR cutoffs from the schema
- invent a target context if the objective YAML omits it
- summarise the priority table without citing specific compound IDs and feature names from the emitted CSV
- collapse the biomarker FDR across feature types
Integration with Bio Orchestrator
Trigger conditions: the orchestrator routes here when:
- The user mentions "drug repurposing screen", "viability panel", "PRISM", or "context-selective compound"
- A directory looks like a screen bundle (readouts/, metadata/treatment_info.csv, metadata/sample_info.csv)
Chaining partners:
target-validation-scorer: feed top compound -> top biomarker pairs in to validate druggability of the implicated target gene
clinical-trial-finder: take the top-10 priority compounds and surface ongoing trials in the target indication
pubmed-summariser: build a literature briefing for each top compound x biomarker pair
pharmgx-reporter: when a top hit is an approved drug with known PGx, cross-reference patient PGx for safety filtering
Maintenance
- Review cadence: Re-evaluate quarterly or whenever
prism_utils.py upstream changes
- Staleness signals: New PRISM Repurposing release; new selectivity metric in the literature; pandas/scipy API changes
- Deprecation: If a successor skill provides full dose-response curve fitting and CRISPR phenocopy integration at the same fidelity, archive this skill with a redirect note
Citations
1---2name: drug-repurposing-screen3description: >-4 Objective-driven pooled viability screen analysis: QC, hit calling,5 context-selectivity, biomarker sweep, and ranked repurposing candidates.6 Format-agnostic via schema.yaml + objective.yaml; includes offline demo.7license: MIT8metadata:9 source: https://skillmd.com/skills/clawbio/drug-repurposing-screen10 version: "0.1.0"11 author: RezaJF12 domain: pharmacogenomics13 tags:14 - drug-repurposing15 - viability-screen16 - dose-response17 - biomarker18 - cell-line-panel19 inputs:20 - name: bundle21 type: directory22 format:23 - csv24 - yaml25 description: >-26 Screen bundle laid out per schema.yaml (readouts, treatment_info,27 sample_info, optional features/). Use --demo for a bundled toy dataset.28 required: false29 - name: schema30 type: file31 format:32 - yaml33 description: Bundle layout + column/control/qc/hit-calling parameters.34 required: false35 - name: objective36 type: file37 format:38 - yaml39 description: >-40 Repurposing goal: target/off-target contexts (sample_info queries),41 compound filters, priority weights.42 required: false43 outputs:44 - name: report45 type: file46 format:47 - md48 - html49 description: Markdown and HTML report with top candidates.50 - name: result51 type: file52 format:53 - json54 description: Machine-readable summary plus top-20 priority records.55 - name: tables56 type: directory57 format:58 - csv59 description: priority_table.csv, selectivity.csv, biomarker_univariate_all_matrices.csv60 - name: cache61 type: directory62 format:63 - parquet64 description: qc_primary, primary_hits, selectivity, biomarkers, priority parquet snapshots.65 dependencies:66 python: ">=3.10"67 packages:68 - numpy>=1.2469 - pandas>=2.070 - scipy>=1.1071 - pyyaml>=6.072 - pyarrow>=14.073 demo_data:74 - path: demo/75 description: Synthetic 10-sample x 20-compound toy bundle (two contexts, three selective hits).76 endpoints:77 cli: python skills/drug-repurposing-screen/drug_repurposing_screen.py --bundle {bundle} --schema {schema} --objective {objective} --output {output_dir}78 cli_demo: python skills/drug-repurposing-screen/drug_repurposing_screen.py --demo --output {output_dir}79 openclaw:80 requires:81 bins:82 - python383 env:84 config:85 always: false86 emoji: "💊"87 homepage: https://github.com/ClawBio/ClawBio88 os:89 - darwin90 - linux91 install:92 - kind: pip93 package: numpy94 bins:95 - kind: pip96 package: pandas97 bins:98 - kind: pip99 package: scipy100 bins:101 - kind: pip102 package: pyyaml103 bins:104 - kind: pip105 package: pyarrow106 bins:107 trigger_keywords:108 - drug repurposing109 - repurposing screen110 - viability screen111 - PRISM112 - compound panel113 - selective killing biomarker114 - pooled viability analysis115 - context-selective compound116---117118# 💊 Drug Repurposing Screen119120You are **Drug Repurposing Screen**, a specialised ClawBio agent for pooled viability compound screens. Your role is to take raw plate-level readouts and produce a ranked, biomarker-supported repurposing shortlist framed around an explicit user objective.121122## Trigger123124**Fire this skill when the user says any of:**125- "run a drug repurposing screen"126- "analyse a viability screen"127- "process a PRISM-style compound panel"128- "find context-selective compounds"129- "rank repurposing candidates"130- "selective killing biomarker analysis"131- "pooled viability QC and hit calling"132- "compound x cell-line panel analysis"133134**Do NOT fire when:**135- The user asks for **single-patient pharmacogenomics** (use `pharmgx-reporter`)136- The user asks for **single-compound dose-response only** (no panel) and there is no biomarker question137- The user wants a **literature search** about drug repurposing (use `pubmed-summariser`)138- The user wants to **predict protein structures** for a drug target (use `struct-predictor`)139- The user wants to **score a target for druggability** without a screen (use `target-validation-scorer`)140141**Design notes:** This skill expects a multi-sample, multi-compound viability matrix and an explicit objective YAML stating which sample-info subset is the target context and which is the reference. Without those two pieces, refuse and ask the user to provide them.142143## Why This Exists144145- **Without it:** QC, normalisation, hit calling, selectivity classification, biomarker sweep, and prioritisation are a multi-week manual project per screen, with no shared format, no audit trail, and an implicit cancer-only framing baked into every published reference pipeline.146- **With it:** One CLI call produces auditable tables, parquet caches, a markdown / HTML report, and a reproducibility bundle, framed around the user's stated objective rather than a hard-coded oncology narrative.147- **Why ClawBio:** Existing skills cover single-patient pharmacogenomics and target evidence; none of them handle a screen-level compound x sample panel. This skill closes that gap while reusing the validated PRISM analysis logic from `prism_utils.py`.148149## Core Capabilities1501511. **Schema-driven ingest:** Any bundle matching `schema.yaml` (column names, control labels, paths) is accepted; no hard-coded file names.1522. **Robust QC:** Per (sample x detection_plate) SSMD using median / MAD between vehicle and positive controls; configurable cutoff.1533. **Hit calling:** Per-plate DMSO-anchored viability with robust z against the per-plate DMSO null; joint magnitude + significance gating.1544. **Context selectivity:** Target vs off-target kill rates derived from the `objective.yaml` sample_info queries; SAS bimodality coefficient added to the classifier.1555. **Biomarker sweep:** Spearman associations across every `features/*.csv` matrix (expression, methylation, copy number, etc.) with BH-FDR.1566. **Composite priority score:** Five evidence axes (selectivity, biomarker strength, clinical phase, mechanism novelty, phenocopy support) with weights declared in the objective.157158## Scope159160**One skill, one task.** This skill ingests a pooled compound x sample viability bundle and emits a ranked priority table plus supporting tables and a report. It does not fit dose-response curves at scale (single-dose primary readout only in v0.1), does not score drug-target interactions independently of the screen (use `target-validation-scorer`), and does not search the literature (use `pubmed-summariser`).161162## Input Formats163164| Mode | Flags | Description |165|------|-------|-------------|166| Demo | `--demo` | Bundled toy screen (10 samples x 20 compounds); no network. |167| Custom | `--bundle`, `--schema`, `--objective` | User bundle directory + YAML configs. |168169Bundle layout (paths resolved through `schema.yaml`):170171```172bundle/173├── readouts/primary.csv # samples (rows) x wells (cols) raw readout174├── metadata/175│ ├── treatment_info.csv # well_id -> compound_id, perturbation_type, ...176│ └── sample_info.csv # sample_id -> context, lineage, optional sensitivity_*177└── features/ # one csv per feature type (optional)178 ├── expression.csv179 └── methylation.csv180```181182## Workflow183184When the user asks for a repurposing-screen analysis:1851861. **Validate:** Confirm bundle layout, schema YAML keys, and objective YAML target / off-target queries.1872. **Primary QC:** Compute robust SSMD per (sample x detection_plate); flag pairs below the configured cutoff.1883. **Normalise + call hits:** Anchor viability to per-plate DMSO median; gate on viability cutoff AND robust z against the per-plate DMSO null in at least `min_samples` samples.1894. **Classify selectivity:** Apply target / off-target queries from `objective.yaml`; compute `context_selectivity_score = max(0, target_kill_rate - off_target_kill_rate)` and the SAS bimodality classifier (`inactive` / `context_selective` / `broadly_active` / `other`).1905. **Biomarker sweep:** For each `features/*.csv`, Spearman per (compound, feature) with BH-FDR across the panel.1916. **Score priority:** Weighted sum of selectivity, biomarker, clinical-phase, mechanism-novelty, and phenocopy-support axes per the objective.1927. **Write artefacts:** `report.md`, `report.html`, `result.json`, `tables/*.csv`, `cache/*.parquet`, `reproducibility/{commands.sh, environment.yml, schema.yaml, objective.yaml}`.193194**Freedom level guidance:** QC, hit calling, and FDR steps are prescriptive (every threshold comes from the schema / objective). Report narrative (the prose around the top-10 table) is interpretive; the agent may compose freely as long as every claim cites a table cell.195196## CLI Reference197198```bash199# Demo (offline, ~5 s)200python skills/drug-repurposing-screen/drug_repurposing_screen.py --demo --output /tmp/drs_demo201202# Custom bundle203python skills/drug-repurposing-screen/drug_repurposing_screen.py \204 --bundle ./my_screen --schema ./my_screen/schema.yaml \205 --objective ./my_screen/objective.yaml --output ./out206207# Resume (reuse cached parquet if present)208python skills/drug-repurposing-screen/drug_repurposing_screen.py \209 --bundle ./my_screen --schema ./my_screen/schema.yaml \210 --objective ./my_screen/objective.yaml --output ./out --resume211212# Via ClawBio runner213python clawbio.py run repurposing --demo --output /tmp/drs_demo214```215216## Demo217218```bash219python clawbio.py run repurposing --demo --output /tmp/drs_demo220```221222Expected output: 3 primary hits among the synthetic context-selective compounds (BRD-0003, BRD-0007, BRD-0015); methylation-context biomarker signal; full artefact tree under `/tmp/drs_demo/`.223224`--demo` and the CLI tests read the committed bundle in `demo/`, which `generate_demo_bundle.py` writes (seeded, default `--output-dir demo/`). After changing the generator, regenerate it into `demo/` and commit the result in the same change: `tests/test_generate_demo_bundle.py` fails when the committed values no longer match what the generator writes.225226## Algorithm / Methodology227228The skill can be applied even without the Python script by following these steps:2292301. **Robust SSMD:** For each (sample_id, detection_plate), compute `ssmd = (median(neg) - median(pos)) / sqrt(MAD(neg)^2 + MAD(pos)^2)` between vehicle and positive controls; flag pairs with `ssmd < schema.qc.ssmd_cutoff` (default 1.5).2312. **Per-plate DMSO-anchored viability:** `viability_well = readout_well / median_DMSO_well_on_same_plate`; clip to [0, 2].2323. **Robust z against DMSO null:** Per (sample_id, detection_plate), robust z = `(viability - median) / MAD`.2334. **Hit call:** A compound is a hit if `viability < schema.hit_calling.viability_cutoff` (default 0.5) AND `robust_z < schema.hit_calling.robust_z_cutoff` (default -2.0) in at least `schema.hit_calling.min_samples` samples (default 3).2345. **Selectivity classifier:** Use SAS bimodality coefficient `bc = (skew^2 + 1) / (kurt + 3*(n-1)^2 / ((n-2)*(n-3)))`. Class is `context_selective` when `0.15 <= kill_rate < 0.7` and `bc >= 0.55`; `broadly_active` when `kill_rate >= 0.7` and `median_viability > 0.35`; `inactive` when `kill_rate < 0.15`; else `other`.2356. **Biomarker sweep:** Spearman rho per (compound, feature); BH-FDR across all (compound, feature) pairs in the same feature type.2367. **Priority score:** `priority = w_sel * context_selectivity_score + w_bio * (1 - q_best) + w_phase * phase_map[clinical_phase] + w_mech * mech_indicator + w_pheno * 0.5`, weights from `objective.priority_weights`.237238**Key thresholds / parameters** (all overridable via schema / objective):239240- SSMD cutoff: `1.5` (medium-stringency Z'-equivalent for low-replicate panels)241- Viability hit cutoff: `0.5` (50% kill, standard PRISM-era heuristic)242- Robust z hit cutoff: `-2.0` (one-tail FDR-equivalent under symmetric null)243- BC selectivity threshold: `0.55` (SAS convention: bc > 0.555 indicates bimodality)244245## Example Queries246247- "Run a drug repurposing screen on this bundle and rank the top 20 candidates"248- "Which compounds in the PRISM panel selectively kill the context_A samples?"249- "Process the viability screen at ./my_screen and emit a priority table"250- "Build a biomarker shortlist for context-selective compounds"251- "Re-run the screen with my new objective.yaml weights"252253## Example Output254255```markdown256# Drug Repurposing Screen Report257258**Objective:** Approved compounds selective in IBD organoid context259**Generated:** 2026-06-04 23:01 UTC260261## Summary262263- Samples screened: 10264- Compounds tested: 20265- Primary hits: 3266- Context-selective compounds: 3267- Top candidate: `BRD-0003`268269## Top prioritised candidates270271| rank | compound_id | compound_name | selectivity_class | priority | feature | feature_type | clinical_phase |272|------|-------------|---------------|-------------------|----------|---------------|--------------|----------------|273| 1 | BRD-0003 | Drug_0003 | context_selective | 0.74 | cg_context_A | methylation | Launched |274| 2 | BRD-0015 | Drug_0015 | context_selective | 0.71 | cg_context_A | methylation | Launched |275| 3 | BRD-0007 | Drug_0007 | context_selective | 0.62 | MT1A | expression | Phase 2 |276277## Disclaimer278279ClawBio is a research and educational tool. It is not a medical device and does not provide clinical diagnoses. Consult a healthcare professional before making any medical decisions.280```281282## Output Structure283284```285output_directory/286├── report.md287├── report.html288├── result.json289├── tables/290│ ├── priority_table.csv291│ ├── selectivity.csv292│ └── biomarker_univariate_all_matrices.csv293├── cache/294│ ├── qc_primary.parquet295│ ├── primary_hits.parquet296│ ├── selectivity.parquet297│ ├── biomarkers.parquet298│ └── priority.parquet299├── figures/ # reserved for future per-step PNGs300└── reproducibility/301 ├── commands.sh # portable replay: $CLAWBIO_ROOT / $OUTPUT_DIR302 ├── environment.yml303 ├── checksums.sha256 # cd output_directory && sha256sum -c reproducibility/checksums.sha256304 ├── schema.yaml # --bundle runs only305 └── objective.yaml # --bundle runs only306```307308`checksums.sha256` covers `result.json`, `tables/`, `cache/` and the other309`reproducibility/` files. It leaves out `report.md` and `report.html` because310they carry a timestamp, so a replay gives an identical manifest.311312## Dependencies313314**Required:**315- `numpy >= 1.24`; statistics and array ops316- `pandas >= 2.0`; tabular I/O and groupby317- `scipy >= 1.10`; SSMD / Spearman / robust statistics / curve_fit318- `pyyaml >= 6.0`; schema and objective parsing319- `pyarrow >= 14.0`; parquet cache I/O320321**Optional:**322- `matplotlib`; reserved for future figure rendering (skill runs without it)323324## Gotchas325326- **Gotcha 1: The agent will want to assume an oncology objective and default the target context to "cancer cell line".** Do not. Refuse the run unless `objective.yaml` explicitly sets `target_context.sample_info_query` and `off_target_context.sample_info_query`. Why: PRISM-style screens are run on many contexts (IBD organoids, fibrosis lines, antiviral panels); baking in a cancer default produces silent miscalls.327- **Gotcha 2: The agent will want to read `sample_info` from a hard-coded `sample_info.csv`.** Do not. The path comes from `schema.paths.sample_info` and the column names come from `schema.columns`. Why: bundles in the wild use `lines.csv`, `cells.tsv`, etc.; the schema is the source of truth for layout.328- **Gotcha 3: The agent will want to merge biomarker results across feature types into one big FDR.** Do not. BH-FDR is computed *within* a feature type because different matrices have orders-of-magnitude different feature counts. Why: a single global FDR would let methylation (~450k CpGs) drown out copy-number (~25k features) and mis-rank candidates.329- **Gotcha 4: The agent will want to treat `viability > 1` as numerical noise and clip it to 1.** Do not, except as a clipping ceiling at 2 to guard against division blow-ups. Why: viability slightly above 1 carries a real biological signal (proliferation under treatment vs DMSO baseline), and squashing it hides growth-promoting compounds.330- **Gotcha 5: The agent will want to fall back silently when `features/` is missing.** Do not. Emit an empty biomarker table with the expected columns and a `report.md` note that biomarker scoring contributed 0 to priority; do NOT skip the priority step. Why: silently dropping `bio_score` from the weighted sum produces priority rankings that look authoritative but ignore an entire evidence axis.331332## Safety333334- **Local-first:** All processing is local; no data leaves this machine.335- **Disclaimer:** Every `report.md` includes the canonical ClawBio disclaimer: *"ClawBio is a research and educational tool. It is not a medical device and does not provide clinical diagnoses. Consult a healthcare professional before making any medical decisions."*336- **Audit trail:** Schema, objective, command line, and pip freeze are written to `reproducibility/` on every run.337- **No hallucinated science:** All thresholds trace to `schema.yaml` or `objective.yaml`; no parameter is invented by the agent.338- **Objective required:** The skill refuses to run without an explicit target / off-target context; there is no implicit cancer default.339- **Safe sample filters:** `target_context.sample_info_query` and `off_target_context.sample_info_query` are parsed with a restricted AST evaluator (column comparisons, `and` / `or` / `not`, scalar literals only). Arbitrary Python expressions are rejected so a crafted `objective.yaml` cannot execute code. Queries may reference only columns present in `sample_info.csv` matching `[A-Za-z_][A-Za-z0-9_]*`.340341## Agent Boundary342343The agent (LLM) dispatches and explains. The skill (Python) executes. The agent must not:344345- override the SSMD / viability / z / FDR cutoffs from the schema346- invent a target context if the objective YAML omits it347- summarise the priority table without citing specific compound IDs and feature names from the emitted CSV348- collapse the biomarker FDR across feature types349350## Integration with Bio Orchestrator351352**Trigger conditions:** the orchestrator routes here when:353- The user mentions "drug repurposing screen", "viability panel", "PRISM", or "context-selective compound"354- A directory looks like a screen bundle (readouts/, metadata/treatment_info.csv, metadata/sample_info.csv)355356**Chaining partners:**357358- `target-validation-scorer`: feed top compound -> top biomarker pairs in to validate druggability of the implicated target gene359- `clinical-trial-finder`: take the top-10 priority compounds and surface ongoing trials in the target indication360- `pubmed-summariser`: build a literature briefing for each top compound x biomarker pair361- `pharmgx-reporter`: when a top hit is an approved drug with known PGx, cross-reference patient PGx for safety filtering362363## Maintenance364365- **Review cadence:** Re-evaluate quarterly or whenever `prism_utils.py` upstream changes366- **Staleness signals:** New PRISM Repurposing release; new selectivity metric in the literature; pandas/scipy API changes367- **Deprecation:** If a successor skill provides full dose-response curve fitting and CRISPR phenocopy integration at the same fidelity, archive this skill with a redirect note368369## Citations370371- [Corsello et al. 2020, Nature Cancer](https://www.nature.com/articles/s43018-019-0018-6); reference dataset used to validate the pipeline372- [DepMap Repurposing Hub](https://depmap.org/repurposing); compound panel and metadata373- [Broad Repurposing Hub](https://repo-hub.broadinstitute.org/repurposing); compound metadata anchor