Conversation
…nd PerceptionResult structs
…ChemicalPerception struct
…ar graph representation
… for molecular graph initialization
…ing and refactor atom degree calculation
…on for hybridization state determination
…ybridization inference across all atoms
…ent handling in infer_single_hybridization function
…fine π electron contributions
…tribution calculations
… in processing graph
…ic atoms in processing graph
…y of rings in processing graph
…tron contributions in aromatic rings
…pi electron contributions from individual atoms
…validate aromaticity detection
…c, oxygen, sulfur, and selenium in pi electron contribution calculation
…c, oxygen, sulfur, and selenium in provisional hybridization calculation
…us molecular structures
27 tasks
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a comprehensive chemical feature perception pipeline and rule-based DREIDING atom typing engine. The implementation provides a sophisticated multi-stage molecular analysis system that enriches basic molecular graphs with chemical intelligence including hybridization, ring membership, and aromaticity detection, followed by declarative rule-based atom type assignment.
- Chemical Feature Perception Pipeline: Multi-stage annotator that detects rings, aromaticity, and infers hybridization states
- Rule-Based Typing Engine: Declarative priority-based system for applying DREIDING atom typing rules from TOML configuration
- Comprehensive Data Models: Core structures for molecular graphs, processing graphs, and hierarchical error handling
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib.rs | Exposes new processor and rules modules |
| src/core/mod.rs | Adds None and Unknown variants to Hybridization enum with Display/FromStr support |
| src/core/error.rs | Extends error hierarchy with AnnotationError and enhanced TyperError |
| src/core/graph.rs | Adds comprehensive test coverage for MolecularGraph functionality |
| src/processor/mod.rs | Module declaration for chemical feature perception components |
| src/processor/graph.rs | ProcessingGraph data structure for enriched molecular representations |
| src/processor/rings.rs | Johnson cycle finder algorithm for ring perception |
| src/processor/aromaticity.rs | Hückel rule-based aromaticity detection for 5-7 membered rings |
| src/processor/hybridization.rs | Comprehensive hybridization inference based on bonding patterns |
| src/processor/annotate.rs | Main orchestration of the chemical feature perception pipeline |
| src/rules/mod.rs | Rule parsing engine with TOML deserialization and validation |
| src/rules/default.rs | Embeds default DREIDING ruleset from external TOML file |
| resources/dreiding.rules.toml | Complete DREIDING atom typing ruleset with priority-based rules |
| Cargo.toml | Adds once_cell dependency for lazy static initialization |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…yLock` for default rules initialization
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:
Introduces a complete, self-contained library for DREIDING atom typing. It features a sophisticated, multi-stage chemical feature perception pipeline that annotates a basic molecular graph with advanced properties like hybridization, ring membership, and aromaticity. This annotated graph is then processed by a declarative, priority-based rule engine that assigns DREIDING atom types based on a flexible TOML ruleset. This provides a robust and extensible foundation for molecular topology analysis.
Changes:
Implemented Chemical Feature Perception Pipeline:
processor::annotate) that enriches a molecular graph with chemical intelligence.SP,SP2,SP3,Resonant) of each atom based on its bonding patterns and aromaticity.ProcessingGraphdata structure to store these rich annotations for the rule engine.Created a Declarative Rule-Based Typing Engine:
rulesmodule) that parses and applies typing rules from a TOML file.Rulestructure withpriorityandconditionsto allow for a flexible and ordered application of typing logic.element,degree,hybridization,is_aromatic, and neighbor properties.dreiding.rules.toml) covering common organic and inorganic atoms.Established Core Data Models:
coremodule, includingMolecularGraphfor input, and enums forElement,BondOrder, andHybridization.TyperError,AnnotationError, etc.) to provide clear diagnostics for invalid inputs or rule failures.Added Project Infrastructure:
.gitignorefile to exclude RustRover IDE-specific directories.