Skip to content

MIM #114 follow-ups: media→DEFINED_MEDIUM reclassification, Carnitine dedup decision, peptone prose#116

Merged
realmarcin merged 2 commits into
mainfrom
chore/media-and-dedup
Jul 6, 2026
Merged

MIM #114 follow-ups: media→DEFINED_MEDIUM reclassification, Carnitine dedup decision, peptone prose#116
realmarcin merged 2 commits into
mainfrom
chore/media-and-dedup

Conversation

@realmarcin

Copy link
Copy Markdown
Collaborator

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) from UNDEFINED_MIXTUREDEFINED_MEDIUM (that type is for ingredient-level mixtures like yeast extract, not whole media). 41 media were already correctly DEFINED_MEDIUM; the 10 media-named STOCK_SOLUTION records 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 Hydrochloride and Carnitine (Dl) Hydrochloride are 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 a DEDUP_REVIEWED curation_history entry (per-ingredient + aggregate).

Cosmetic

Fixed the 3 soy-peptone curation_history prose that said "EXACT_MATCH" (their mapping_quality fields were already correctly CLOSE_MATCH).

🤖 Generated with Claude Code

…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>
Copilot AI review requested due to automatic review settings July 5, 2026 21:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread data/curated/mapped_ingredients.yaml Outdated
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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@realmarcin

Copy link
Copy Markdown
Collaborator Author

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:

  • 53 media reclassifications: all names are genuine media (broth/agar/medium/base). Each record adds one RECLASSIFY_INGREDIENT_TYPE entry and flips UNDEFINED_MIXTURE→DEFINED_MEDIUM; nothing else changes (still UNMAPPED, mapping untouched, notes intact). No single-ingredient / stock-component / ingredient-mixture was wrongly swept — the "…Agar Base" records are medium bases (defined formulations), not stock solutions.
  • Carnitine DEDUP_REVIEWED: present and byte-identical (modulo list indentation) in both `Carnitine_Hydrochloride.yaml` and the aggregate; no identifier/predicate/mapping change.
  • 3 soy-peptones (Phytone / Soya_Pepton / Soya_Peptone): prose now correctly matches `mapping_quality: CLOSE_MATCH` in both per-ingredient and aggregate; no residual EXACT_MATCH; SSSOM predicate (closeMatch) unchanged.
  • No ontology-mapping changes anywhere — only `ingredient_type` + curation_history prose moved. No stray files (58 files, all data YAMLs). All spot-checked YAML parses.

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>
@realmarcin realmarcin merged commit c2c6680 into main Jul 6, 2026
@realmarcin realmarcin deleted the chore/media-and-dedup branch July 6, 2026 20:49
realmarcin added a commit that referenced this pull request Jul 7, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants