Add fatty acyl-CoA grouping classes and examples - #82
Open
cmungall wants to merge 7 commits into
Open
Conversation
Encodes the fatty acid β-oxidation substrate classification (mitochondrial and peroxisomal) as MoleculeGroupingClass instances. The diagram's decision tree maps onto orthogonal classification facets over fatty acyl-CoA (CHEBI:37554), linked via subtype_of: - linearity/branching: linear fatty acyl-CoA, branched-chain fatty acyl-CoA (CHEBI:61912) - chain length (under linear): short- (CHEBI:61905), medium- (CHEBI:61907), long- (CHEBI:33184), and very-long-chain (CHEBI:61910) fatty acyl-CoA - saturation: saturated (CHEBI:231546) and unsaturated (CHEBI:51006), with mono- and polyunsaturated as subtypes of unsaturated - carbon-number parity: even- and odd-numbered fatty acyl-CoA CHEBI identifiers were verified against the ChEBI database; neutral grouping classes lacking a confident CHEBI term (linear, mono-/polyunsaturated, even/odd parity) use chemrof-local IRIs. All examples validate via 'make test-examples'. @dragon-ai-agent Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zKcqz7Dwyj75Dy5BYhkNC
Adds linkml-run-examples output (json/yaml) for the new fatty acyl-CoA MoleculeGroupingClass examples and refreshes README.md. Also picks up generated output for previously-added examples that had not been regenerated. @dragon-ai-agent Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zKcqz7Dwyj75Dy5BYhkNC
…examples Adds a generic 'description' slot (dcterms:description) to the GroupingClass hierarchy so molecule grouping classes can carry human-readable definitions. The pre-existing 'description' slot had a stray reaction-specific string_serialization template and was not attached to any class; it is redefined as a proper string-valued description slot. Populates each of the fatty acyl-CoA beta-oxidation MoleculeGroupingClass examples with a description. Regenerated examples/output accordingly. (Generated artifacts under schema/ are not regenerated here to avoid unrelated toolchain-drift churn; src/chemrof/schema/chemrof.yaml is the source of truth.) @dragon-ai-agent Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zKcqz7Dwyj75Dy5BYhkNC
Turns the fatty acyl-CoA beta-oxidation groupings from labelled buckets into grouping classes carrying machine-readable defining constraints, following chemrof's existing defining_slots idiom (as used by ChemicalSaltGroupingClass, MolecularDerivativeGroupingClass, etc.). Schema additions: - CarbonNumberParityEnum (even / odd) - slots: min_carbon_number, max_carbon_number, min_carbon_carbon_double_bond_number, max_carbon_carbon_double_bond_number (is_branched reused from existing slot) - grouping subclasses with defining_slots: - FattyAcylChainLengthGroupingClass (min/max_carbon_number) - FattyAcylSaturationGroupingClass (min/max C=C double-bond number) - FattyAcylBranchingGroupingClass (is_branched) - FattyAcylCarbonParityGroupingClass (carbon_number_parity) The facet examples are reclassified onto these classes and given concrete defining values, e.g. long-chain = carbon number 13-22, saturated = 0 C=C, monounsaturated = exactly 1 C=C, branched = is_branched true, odd-numbered = parity odd. A program or reasoner can now compute grouping membership from these constraints. Note: as with the existing defining_slots classes, the current OWL export renders these as rdfs:subClassOf necessary-condition restrictions rather than owl:equivalentClass; emitting full necessary-and-sufficient axioms would be a separate generator enhancement. Generated schema/ artifacts are not regenerated here (toolchain-drift churn); chemrof.yaml is the source of truth. All examples validate via 'make test-examples'. @dragon-ai-agent Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zKcqz7Dwyj75Dy5BYhkNC
Adds smarts_string to the groupings where a whole-molecule SMARTS is reliable (verified against reference acyl-CoA structures with RDKit): - fatty acyl-CoA (root): the acyl-CoA pantetheine thioester substructure, i.e. the structural signature shared by all fatty acyl-CoAs. - unsaturated / monounsaturated / polyunsaturated: an aliphatic, non-carbonyl carbon-carbon double bond ([CX3;!$(C=O)]=[CX3;!$(C=O)]), which matches a fatty-acyl alkene without false-matching CoA's carbonyls or aromatic adenine. RDKit check: 0 matches for stearoyl-CoA (18:0), 1 for oleoyl-CoA (18:1), 3 for linolenoyl-CoA (18:3). Saturated, linear and branched are intentionally left to the numeric/boolean constraints (min/max_carbon_carbon_double_bond_number, is_branched): a single SMARTS cannot reliably assert the global ABSENCE of unsaturation, and a branching SMARTS would false-match coenzyme A's own gem-dimethyl (pantoate) group. @dragon-ai-agent Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zKcqz7Dwyj75Dy5BYhkNC
Adds owl.template annotations to the four fatty acyl-CoA facet grouping classes so the linkml-owl OWLDumper path (chemrof convert --format owl) renders each as a necessary-and-sufficient EquivalentClasses axiom, the same mechanism MonoatomicIon/AtomCation use. Each definition is genus-differentia: genus CHEBI:37554 (fatty acyl-CoA) intersected with a restriction on a member-level property. - FattyAcylChainLengthGroupingClass -> DataSomeValuesFrom(carbon_number, integer[minInclusive/maxInclusive]); min-only classes (very-long-chain) omit the upper bound. - FattyAcylSaturationGroupingClass -> DataSomeValuesFrom( carbon_carbon_double_bond_number, integer range); saturated = exactly 0. - FattyAcylBranchingGroupingClass -> DataHasValue(is_branched, boolean). - FattyAcylCarbonParityGroupingClass -> DataHasValue(carbon_number_parity). Adds the member-level properties carbon_number and carbon_carbon_double_bond_number that the chain-length/saturation restrictions quantify over (the grouping min/max bounds translate into the range restriction). A DL reasoner can now auto-classify a fatty acyl-CoA molecule carrying these properties into the groupings. Templates verified against the example data via OWLDumper; locked with new tests in tests/test_owl_output.py (17 passing). Note: standard gen-owl (schema T-Box) does not process owl.template; the equivalentClass axioms are produced on the instance/A-box path, consistent with existing chemrof behavior. @dragon-ai-agent Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zKcqz7Dwyj75Dy5BYhkNC
Contributor
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Rework grouping-class modeling so the SCHEMA holds only reusable, high-level
grouping meta-patterns, while the concrete fatty acyl-CoA groupings live as
DATA instances that still convert to OWL. This avoids per-domain class
explosion: adding a new family (steroids, glycans, ...) is now new data, not
new schema classes.
Schema:
- Remove the four bespoke domain classes (FattyAcyl{ChainLength,Saturation,
Branching,CarbonParity}GroupingClass) and their abstract parent, plus the
domain-specific bound slots (min/max_carbon_number,
min/max_carbon_carbon_double_bond_number).
- Add three generic meta-pattern classes, each with a parameterized
owl.template:
- GroupingBySmarts (genus [+ smarts_string]) -> SubClassOf(genus); SMARTS is
a computational, non-DL criterion carried as an annotation.
- GroupingByGenusAndRangeRestriction (genus, on_property, min_value,
max_value) -> EquivalentClasses genus + integer range restriction.
- GroupingByGenusAndPropertyValue (genus, on_property, value,
value_datatype) -> EquivalentClasses genus + DataHasValue.
- Add generic slots genus, on_property, min_value, max_value, value,
value_datatype; keep carbon_number, carbon_carbon_double_bond_number,
carbon_number_parity and is_branched as the member-level properties the
restrictions quantify over.
Data (examples): the 13 fatty acyl-CoA groupings are re-expressed as instances
of the generic patterns (genus CHEBI:37554; fatty acyl-CoA itself as a
GroupingBySmarts with genus acyl-CoA CHEBI:17984). OWL output is unchanged in
shape (verified via OWLDumper): e.g. long-chain -> carbon_number in [13,22],
saturated -> [0,0], linear -> is_branched false^^xsd:boolean, even -> parity
even^^xsd:string.
Tests updated to exercise the generic patterns (TestGenericGroupingEquivalent
Classes). make test-examples passes (13/13); full suite 150 passed
(pre-existing unrelated failure in tests/chem_model_test.py ignored).
@dragon-ai-agent
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015zKcqz7Dwyj75Dy5BYhkNC
Contributor
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive support for fatty acyl-CoA grouping classes to the ChemRof schema, enabling classification of fatty acyl-CoA molecules by structural features relevant to beta-oxidation substrate classification.
Key Changes
Schema Updates (
src/chemrof/schema/chemrof.yaml)FattyAcylCoAGroupingClassabstract base class for fatty acyl-CoA groupingsFattyAcylChainLengthGroupingClass- classifies by carbon chain length (short, medium, long, very-long chain)FattyAcylSaturationGroupingClass- classifies by degree of unsaturation (saturated, monounsaturated, polyunsaturated)FattyAcylBranchingGroupingClass- classifies by branching (linear vs. branched)FattyAcylCarbonParityGroupingClass- classifies by carbon number parity (even vs. odd)EquivalentClassesaxiomsmin_carbon_number,max_carbon_number,min_carbon_carbon_double_bond_number,max_carbon_carbon_double_bond_number,carbon_number_parity,is_brancheddescriptionslot toMoleculeGroupingClassfor semantic documentationExamples and Test Data
examples/output/src/data/examples/valid/Reaction-methionine_adenosyltransferase,Collection-methionine_cycle_excerpt)AtomCation-copper1,AtomCation-copper2,AtomCation-calcium2)MoleculeGroupingClass-phosphatidylinositol_3_phosphate_r1_r2exampleTest Coverage
TestFattyAcylGroupingEquivalentClassestest class intests/test_owl_output.pyImplementation Details
The fatty acyl-CoA grouping classes use OWL templates to generate computable definitions. Each template creates an
EquivalentClassesaxiom that intersects the parent class (CHEBI:37554 - fatty acyl-CoA) with datatype restrictions on member-level properties. This enables:The grouping classes support both required constraints (e.g., exact parity value) and optional range constraints (e.g., min/max carbon numbers), with proper handling in OWL template expansion.
https://claude.ai/code/session_015zKcqz7Dwyj75Dy5BYhkNC