MIM #114 follow-ups: media→DEFINED_MEDIUM reclassification, Carnitine dedup decision, peptone prose#116
Conversation
…p, peptone prose - Media-vs-ingredient modeling: reclassified 53 commercial media (broth/agar/medium) from ingredient_type UNDEFINED_MIXTURE → DEFINED_MEDIUM (the schema's designated type for complete medium formulations, e.g. LB broth). These are media, not ingredient-level mixtures; no schema change needed. (41 media were already DEFINED_MEDIUM; the 10 media-named STOCK_SOLUTION records are correctly typed — they're stock components/bases for a medium.) - Carnitine Hydrochloride dedup: reviewed vs Carnitine (Dl) Hydrochloride. Decision — NOT merged: distinct name surface-forms (stereo-unspecified vs racemic "DL"), both correctly mapping to the stereo-unspecified parent CHEBI:17126; MIM keeps one record per surface-form. Documented via a DEDUP_REVIEWED curation_history entry (per-ingredient + aggregate). - Cosmetic: the 3 soy-peptone curation_history entries said "EXACT_MATCH" while mapping_quality is correctly CLOSE_MATCH — fixed the prose to match. Only ingredient_type + curation_history prose changed; no ontology mappings altered. reconcile in-sync; invariants A/B1/B2/B3 pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| action: MAPPED | ||
| changes: 'Mapped residual peptone variant: identifier UNMAPPED_0558 -> MICRO:0000182 | ||
| (tryptone), EXACT_MATCH, mirroring sibling Tryptone/Bacto-tryptone. mapping_status | ||
| (tryptone), CLOSE_MATCH, mirroring sibling Tryptone/Bacto-tryptone. mapping_status |
There was a problem hiding this comment.
Stray 4th prose edit, out of scope and now inconsistent. The PR scope is the 3 soy-peptone records (Phytone/Soya_Pepton/Soya_Peptone), whose mapping_quality is CLOSE_MATCH — so flipping their prose EXACT_MATCH→CLOSE_MATCH correctly aligns prose with the field. This 4th change is a different ingredient: Tryptone peptone (identifier MICRO:0000182, UNMAPPED_0558), whose mapping_quality is EXACT_MATCH (unchanged here, line ~140203). Flipping only the prose to CLOSE_MATCH therefore makes the aggregate self-contradictory (prose says CLOSE_MATCH, field says EXACT_MATCH), and it diverges from the per-ingredient file data/ingredients/mapped/Tryptone_Peptone.yaml, which still reads EXACT_MATCH in both its mapping_quality and its curation_history prose. The SSSOM reconcile/invariant gates derive the predicate from mapping_quality (not this prose), so they pass and do not catch the drift. Recommend reverting this line to EXACT_MATCH to restore aggregate↔per-ingredient consistency (tryptone→tryptone is a genuine exact match; changing it to CLOSE_MATCH would be a mapping change requiring the field + predicate + per-ingredient file to move too, which is out of scope for this cosmetic-prose PR).
|
Review (data-curation): mostly clean, one confirmed issue flagged inline. Confirmed issue (1) — stray 4th prose edit in `data/curated/mapped_ingredients.yaml`: the cosmetic EXACT_MATCH→CLOSE_MATCH fix was also applied to `Tryptone peptone` (MICRO:0000182, UNMAPPED_0558), whose `mapping_quality` is `EXACT_MATCH`. That leaves the aggregate self-contradictory (prose CLOSE_MATCH vs field EXACT_MATCH) and out of sync with the untouched per-ingredient `Tryptone_Peptone.yaml` (still EXACT_MATCH in both field and prose). The SSSOM gates key off `mapping_quality`, not this prose, so they pass and dont catch it. Suggest reverting that one line to EXACT_MATCH. Details inline. Verified clean:
|
The cosmetic EXACT_MATCH->CLOSE_MATCH prose fix over-matched a 4th record (Tryptone peptone, MICRO:0000182) whose mapping_quality is correctly EXACT_MATCH (tryptone->tryptone is exact). Reverted that one curation_history prose line to EXACT_MATCH so the aggregate prose matches its field and the per-ingredient record. Only the 3 soy-peptones (closeMatch to the broad FOODON parent) keep the CLOSE_MATCH prose. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Regenerate the unified mapping so it reflects the current MIM/CultureMech state after the SSSOM rebuild (#117) and #115/#116. 20 rows updated: - cholesterol CHEBI:140435 → CHEBI:16113 - Carnitine Hydrochloride CHEBI:48601 → kgmicrobe.compound:carnitine_hydrochloride - Phytone / Soya pepton(e) / Tryptone peptone remapped to FOODON/MICRO - Glycerol synonyms + kg_microbe_node_id refreshed - stale cas_rn cleared on beef-extract variants and Sulfur Row count unchanged (3938). Built via `build_unified_ingredient_mapping.py` (run under uv for the GitPython dep). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
The final MIM #114 follow-ups. No ontology mappings changed (only
ingredient_type+ curation_history prose); reconcile in-sync, invariants A/B1/B2/B3 pass.Media-vs-ingredient modeling
The schema already has
DEFINED_MEDIUM("complete medium formulation/recipe, e.g. LB broth") — so no schema change is needed; the commercial-media records just weren't all using it. Reclassified 53 media (broth/agar/medium-named) fromUNDEFINED_MIXTURE→DEFINED_MEDIUM(that type is for ingredient-level mixtures like yeast extract, not whole media). 41 media were already correctlyDEFINED_MEDIUM; the 10 media-namedSTOCK_SOLUTIONrecords are correctly typed (they're stock components/bases for a medium — "Macro Component 1 for J Medium", "UW concentrated base", etc.). Precedent exists for mapping specific media to NCIT growth-medium terms (Middlebrook_7H10_Agar → NCIT:C85509) — a further optional enhancement, not done here.Carnitine Hydrochloride dedup — decision: NOT a duplicate
Both
Carnitine HydrochlorideandCarnitine (Dl) Hydrochlorideare 0-occurrence and map to CHEBI:17126, but they're distinct name surface-forms (stereo-unspecified, from CultureBotHT, vs racemic "DL"), both correctly grounding to the stereo-unspecified parent. MIM keeps one record per surface-form, so kept both; documented with aDEDUP_REVIEWEDcuration_history entry (per-ingredient + aggregate).Cosmetic
Fixed the 3 soy-peptone
curation_historyprose that said "EXACT_MATCH" (theirmapping_qualityfields were already correctly CLOSE_MATCH).🤖 Generated with Claude Code