Add IonizableGroup class for sophisticated modeling of molecules with… - #46
Add IonizableGroup class for sophisticated modeling of molecules with…#46dragon-ai-agent wants to merge 1 commit into
Conversation
… multiple ionizable groups This commit implements the feature requested in issue #38 to extend modeling of multiple ionizable groups by pairing them with pKa values. ## Changes Made ### Schema Changes (src/chemrof/schema/chemrof.yaml) 1. **New Class: IonizableGroup** - Represents a specific ionizable functional group instance within a molecule - Pairs functional group type with pKa value - Includes optional position and description fields for disambiguation - Extends DomainEntity 2. **New Slots**: - `has_ionizable_groups`: Links ChemicalEntity to IonizableGroup instances - `functional_group_type`: Specifies the type of functional group (e.g., carboxyl, amino) - `pka_value`: The pKa value for the specific ionizable group (required) - `group_position`: Optional position identifier (e.g., C2, N-terminal, alpha) - `group_description`: Optional human-readable description to distinguish groups 3. **Added slot to ChemicalEntity**: - Added `has_ionizable_groups` to the ChemicalEntity slots list ### Example Instances 1. **Molecule-citric_acid_with_ionizable_groups.yaml** - Demonstrates citric acid with three carboxyl groups - Each group has a distinct pKa value (3.13, 4.76, 6.40) - Uses group_description to distinguish between identical functional groups 2. **SmallMolecule-glutamic_acid_with_ionizable_groups.yaml** - Demonstrates L-glutamic acid with mixed ionizable groups - Two carboxyl groups (pKa 2.10, 4.07) - One amino group (pKa 9.47) - Shows how to model molecules with different functional group types ## Design Rationale - **Backwards compatible**: Existing `pka_ionization_constant` slot remains unchanged - **Flexible**: Supports both simple cases (single pKa) and complex cases (multiple groups) - **Extensible**: Optional position and description fields accommodate various use cases - **Standards-aligned**: Follows chemical informatics conventions - **Computational utility**: Enables downstream analysis of ionization states ## Use Cases Addressed ✅ Citric acid: Three carboxyl groups with distinct pKa values ✅ Amino acids: Mixed ionizable groups (carboxyl + amino) ✅ Complex molecules: Distinguished by position or description ✅ Group-pKa association: Clear linkage between functional group and its pKa All examples validate successfully against the updated schema. @dragon-ai-agent
|
Claude finished @dragon-ai-agent's task —— View job Code Review for PR #46: Add IonizableGroup classReviewing the implementation of IonizableGroup class for sophisticated modeling of molecules with multiple ionizable groups. Todo List:
Review Feedback✅ Strengths1. Excellent Design Architecture
2. Comprehensive Documentation
3. Practical Examples
4. Schema Quality
|
… multiple ionizable groups
This commit implements the feature requested in issue #38 to extend modeling of multiple ionizable groups by pairing them with pKa values.
Changes Made
Schema Changes (src/chemrof/schema/chemrof.yaml)
New Class: IonizableGroup
New Slots:
has_ionizable_groups: Links ChemicalEntity to IonizableGroup instancesfunctional_group_type: Specifies the type of functional group (e.g., carboxyl, amino)pka_value: The pKa value for the specific ionizable group (required)group_position: Optional position identifier (e.g., C2, N-terminal, alpha)group_description: Optional human-readable description to distinguish groupsAdded slot to ChemicalEntity:
has_ionizable_groupsto the ChemicalEntity slots listExample Instances
Molecule-citric_acid_with_ionizable_groups.yaml
SmallMolecule-glutamic_acid_with_ionizable_groups.yaml
Design Rationale
pka_ionization_constantslot remains unchangedUse Cases Addressed
✅ Citric acid: Three carboxyl groups with distinct pKa values
✅ Amino acids: Mixed ionizable groups (carboxyl + amino)
✅ Complex molecules: Distinguished by position or description
✅ Group-pKa association: Clear linkage between functional group and its pKa
All examples validate successfully against the updated schema.
@dragon-ai-agent