scientific-skills/Evidence Insights/bio-ontology-mapper/SKILL.md
Map unstructured biomedical text to standardized ontologies (SNOMED CT.
npx skillsauth add aipoch/medical-research-skills bio-ontology-mapperInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
scripts/main.py.references/ for task-specific guidance.Python: 3.10+. Repository baseline for current packaged skills.dataclasses: unspecified. Declared in requirements.txt.difflib: unspecified. Declared in requirements.txt.cd "20260318/scientific-skills/Evidence Insight/bio-ontology-mapper"
python -m py_compile scripts/main.py
python scripts/main.py --help
Example run plan:
CONFIG block or documented parameters if the script uses fixed settings.python scripts/main.py with the validated inputs.See ## Workflow above for related details.
scripts/main.py.references/ contains supporting rules, prompts, or checklists.Use this command to verify that the packaged script entry point can be parsed before deeper execution.
python -m py_compile scripts/main.py
Use these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.
python -m py_compile scripts/main.py
python scripts/main.py --help
Biomedical terminology normalization tool that maps free-text clinical and scientific concepts to standardized ontologies for semantic interoperability and data harmonization.
Key Capabilities:
Extract and map biomedical entities to ontologies:
from scripts.mapper import BioOntologyMapper
mapper = BioOntologyMapper()
# Map clinical text
result = mapper.map_text(
text="Patient has diabetes and hypertension, taking metformin",
ontologies=["snomed", "mesh", "rxnorm"],
confidence_threshold=0.7
)
for entity in result.entities:
print(f"{entity.text} → {entity.concept_id} ({entity.ontology})")
print(f" Preferred: {entity.preferred_term}")
print(f" Confidence: {entity.confidence:.2f}")
Supported Ontologies: | Ontology | Domain | Use Case | |----------|--------|----------| | SNOMED CT | Clinical | EHR interoperability | | MeSH | Literature | PubMed indexing | | ICD-10 | Billing | Diagnosis codes | | LOINC | Labs | Test result standardization | | RxNorm | Drugs | Medication normalization | | HGNC | Genes | Gene name standardization |
Map concepts between different ontologies:
# Cross-map SNOMED to ICD-10
translation = mapper.cross_map(
source_id="22298006", # SNOMED: Myocardial infarction
source_ontology="snomed",
target_ontology="icd10"
)
print(f"ICD-10: {translation.target_id} - {translation.target_term}")
# Output: I21.9 - Acute myocardial infarction, unspecified
Cross-Mapping Coverage:
Process large datasets:
# Batch process CSV
results = mapper.batch_map(
input_file="clinical_terms.csv",
text_column="diagnosis_description",
ontologies=["snomed", "icd10"],
output_format="csv",
max_workers=4
)
# Results include:
# - Original term
# - Mapped concept ID
# - Confidence score
# - Alternative mappings (if ambiguous)
Performance:
Assess mapping reliability:
scoring = mapper.score_mapping(
term="heart attack",
candidate="22298006", # Myocardial infarction
factors=["string_similarity", "context_match", "frequency"]
)
print(f"Overall confidence: {scoring.confidence:.2f}")
print(f"Breakdown: {scoring.factors}")
Scoring Factors:
Pre-Mapping:
During Mapping:
Post-Mapping:
Before Production:
Mapping Errors:
❌ Abbreviation ambiguity → "MI" = Myocardial infarction OR Michigan
❌ Outdated terms → Old terminology not in current ontology
❌ False confidence → High score for wrong concept
Technical Issues:
❌ API failures → No local fallback
❌ Version mismatches → Different ontology versions
❌ PHI exposure → Sending patient data to external APIs
Available in references/ directory:
snomed_ct_guide.md - SNOMED CT hierarchy and relationshipsmesh_structure.md - MeSH tree structure and qualifiersontology_mappings.md - Crosswalks between systemsnlp_best_practices.md - Biomedical text processingapi_documentation.md - External service integrationvalidation_datasets.md - Gold standard test setsLocated in scripts/ directory:
main.py - CLI interface for mappingmapper.py - Core ontology mapping engineextractor.py - Named entity recognitioncross_mapper.py - Ontology-to-ontology translationscorer.py - Confidence calculationbatch_processor.py - Large dataset handlingvalidator.py - Mapping quality checkscaching.py - Local storage for frequent lookups⚠️ Critical: Ontology mapping is for research and data integration, not clinical decision-making. Always validate mappings with domain experts before use in patient care contexts. Never process PHI without appropriate de-identification and compliance measures.
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| --term | str | Required | Single term to map |
| --input | str | Required | Input file path |
| --output | str | Required | Output file path |
| --ontology | str | 'both' | |
| --threshold | float | 0.7 | |
| --format | str | 'json' | |
| --use-api | str | Required | Use UMLS/MeSH APIs |
| --api-key | str | Required | |
Every final response should make these items explicit when they are relevant:
scripts/main.py fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.This skill accepts requests that match the documented purpose of bio-ontology-mapper and include enough context to complete the workflow safely.
Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
bio-ontology-mapperonly handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
Use the following fixed structure for non-trivial requests:
If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.
tools
Generates complete conventional oncology bulk-transcriptome biomarker and hub-gene research designs from a user-provided cancer type and study direction. Always use this skill whenever a user wants to design, plan, or build a tumor bioinformatics study centered on differential expression, prognostic filtering or risk modeling, PPI-based hub-gene prioritization, diagnostic/prognostic evaluation, clinical association, immune infiltration context, methylation context, and optional tissue or cell validation. Covers five study patterns (signature-first prognostic workflow, hub-gene-first biomarker workflow, hybrid signature-to-hub workflow, immune-context biomarker workflow, translational validation workflow) and always outputs four workload configs (Lite / Standard / Advanced / Publication+) with recommended primary plan, step-by-step workflow, figure plan, validation strategy, minimal executable version, publication upgrade path...
development
Generates complete conventional non-oncology bioinformatics research designs from a user-provided disease context, process-related gene family or biological theme, and validation direction. Use when a study centers on multi-dataset bulk transcriptome integration, DEG analysis, process-gene intersection, enrichment analysis, GSEA, PPI hub-gene prioritization, TF/miRNA regulatory networks, ROC-based biomarker evaluation, and immune infiltration analysis. Covers five study patterns (process-DEG discovery, enrichment/GSEA interpretation, hub-gene prioritization, regulatory-network and immune interpretation, multi-layer public validation) and always outputs Lite / Standard / Advanced / Publication+ with a recommended primary plan, stepwise workflow, figure plan, validation hierarchy, minimal executable version, publication upgrade path, and strictly verified literature retrieval.
tools
Plans confounder control, variable adjustment logic, and bias mitigation strategies at the protocol stage for clinical, epidemiologic, translational, observational, and biomarker studies. Always use this skill when a user needs to identify major confounders, decide which variables should or should not be adjusted for, compare matching/stratification/weighting approaches, anticipate selection or measurement bias, or pressure-test a study design before execution. Focus on bias sensing, causal structure awareness, variable-role classification, and critical design review rather than generic statistical advice.
testing
Generates complete comparative network-toxicology research designs from a user-provided exposure pair, shared toxic phenotype, and validation direction. Use when a study centers on two related exposures under one outcome and needs target collection, shared-vs-specific target decomposition, enrichment, PPI hub prioritization, docking, optional transcriptomic cross-checks, and conservative mechanistic synthesis. Covers five study patterns and always outputs Lite / Standard / Advanced / Publication+ with a recommended primary plan, stepwise workflow, figure plan, validation hierarchy, minimal executable version, publication upgrade path, and strictly verified literature retrieval.