This repository was archived by the owner on Mar 10, 2026. It is now read-only.
Conversation
…ion and management
…proved residue management
…ed fields and methods
…managing molecular data
23 tasks
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a comprehensive suite of molecular data models for the scream-core crate, including Atom, Residue, Chain, Bond, and a fluent MolecularSystemBuilder API, along with comprehensive unit tests. Key changes include:
- The introduction of hierarchical models and their supporting parsers and display implementations.
- The addition of a fluent builder API to safely construct molecular systems.
- Integration of the nalgebra dependency to handle 3D coordinates.
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/scream-core/src/models/topology.rs | Implements Bond and BondOrder models with parsing and display traits. |
| crates/scream-core/src/models/system.rs | Introduces the MolecularSystem and builder API for constructing systems. |
| crates/scream-core/src/models/residue.rs | Defines the Residue structure along with atom mapping logic. |
| crates/scream-core/src/models/chain.rs | Implements Chain and ChainType models with parsing and display support. |
| crates/scream-core/src/models/atom.rs | Defines the Atom model and Element enum with robust parsing logic. |
| crates/scream-core/Cargo.toml | Adds the nalgebra dependency to support 3D coordinate operations. |
Comments suppressed due to low confidence (1)
crates/scream-core/src/models/system.rs:136
- Consider adding a check to ensure that an atom serial number is unique before inserting it into atom_serial_map. This would help prevent accidental overwrites if duplicate serials are added.
self.system.atom_serial_map.insert(serial, atom_idx);
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 comprehensive suite of data models to represent molecular structures within the
scream-corecrate. It establishes a foundational, hierarchical data layer consisting ofMolecularSystem,Chain,Residue, andAtomentities, along with topological information likeBond. A fluentMolecularSystemBuilderis also provided for a safe and intuitive way to construct these complex systems.Changes:
Implemented Hierarchical Data Models:
Atom: Created a struct to represent an individual atom, including itsElementtype, 3D coordinates (usingnalgebra::Point3), partial charge, and name.Element: Implemented an exhaustiveenumfor chemical elements with a robustFromStrparser to handle various symbols and aliases (e.g., "Cl", "D", "2H").Residue: Defined a struct to represent a group of connected atoms, such as an amino acid or a nucleotide.Chain: Implemented a struct to represent a sequence of residues, categorized byChainType(e.g., Protein, DNA, RNA).MolecularSystem: Introduced the top-level container that aggregates all atoms, chains, and bonds into a single, cohesive system.Defined Molecular Topology:
Bondstruct to define chemical connectivity between two atoms.BondOrderenum (Single,Double, etc.) with aFromStrparser for easy interpretation from various formats.Introduced a Fluent Builder API:
MolecularSystemBuilderto provide a step-by-step, fluent interface for constructing aMolecularSystem.Added Comprehensive Unit Tests:
Integrated
nalgebraDependency:nalgebracrate as a core dependency to efficiently handle 3D coordinates and related linear algebra operations.