This repository was archived by the owner on Mar 10, 2026. It is now read-only.
Conversation
…ion based on parameters
…ion based on parameters
…SP3 hydrogen positions based on neighbor vectors
…e deviation between two sets of coordinates
…een named coordinate sets
… maximum deviation between two sets of named coordinates
…hedral angle and hydrogen generation
…e proper angle calculation
…nced data structure support
… and conversion methods
…nce residue creation tests
…parsing of three-letter codes
…roved flexibility
…for enhanced flexibility
… for improved residue handling
…nts and functions
16 tasks
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds a new utils module for geometric and identifier utilities, and extends the core data model with a strongly-typed ResidueType.
- Introduces
utils::geometryfor structural calculations (dihedral angles, RMSD, hydrogen placement). - Implements
utils::identifierswith PHF-based maps to classify and order atoms. - Extends
ResidueandMolecularSystemto carry an optionalResidueType, updating parser and tests accordingly.
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/scream-core/src/core/utils/mod.rs | Exposes new geometry and identifiers submodules |
| crates/scream-core/src/core/utils/identifiers.rs | Adds fast, static maps and lookup/order functions for atom names |
| crates/scream-core/src/core/utils/geometry.rs | Implements geometric functions and comprehensive unit tests |
| crates/scream-core/src/core/models/system.rs | Updates add_residue to accept res_type, adjusts calls/tests |
| crates/scream-core/src/core/models/residue.rs | Introduces ResidueType enum, parsing, and extends Residue API |
| crates/scream-core/src/core/io/bgf.rs | Passes parsed res_type into the system when reading BGF files |
| crates/scream-core/src/core/mod.rs | Registers the utils module |
| crates/scream-core/Cargo.toml | Adds phf dependency for identifier utilities |
Comments suppressed due to low confidence (2)
crates/scream-core/src/core/models/residue.rs:146
- Add a unit test for Residue::new to verify that the res_type field is initialized correctly when provided.
pub(crate) fn new(
crates/scream-core/src/core/utils/geometry.rs:1
- [nitpick] Consider adding Rust doc comments for public functions and types in the geometry module to improve documentation and discoverability of the utilities.
use nalgebra::{Point3, Rotation3, Unit, Vector3};
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 foundational
utilsmodule containing essential tools for geometric calculations and standardized atom/residue identification. It includes ageometrysubmodule with functions for structural analysis and manipulation (e.g., dihedral angles, RMSD) and anidentifierssubmodule for fast, standardized atom classification and sorting using perfect hash functions. Additionally, enhances the core data model by introducing a strongly-typedResidueTypeenum, providing a more robust and semantic understanding of standard amino acids.Changes:
Added Geometry Utilities (
utils::geometry):nalgebra:dihedral_angle: Calculates the dihedral angle between four points.calculate_cb_position: Computes the C-beta atom position based on backbone geometry.calculate_hn_position: Determines the position of the amide proton.generate_sp3_hydrogens: Generates hydrogen atoms for sp3-hybridized centers.calculate_rmsd: Calculates the Root Mean Square Deviation between two sets of coordinates.calculate_named_rmsd: A variant of RMSD that operates on named atoms inHashMap.find_max_atom_deviation: Finds the atom with the largest positional difference.Implemented Identifier Utilities (
utils::identifiers):phfcrate to create high-performance, compile-time static maps and sets for atom name lookups.is_backbone_atom: A function to quickly check if an atom is part of the protein backbone.is_heavy_atom: A utility to distinguish heavy atoms from hydrogens.residue_atom_order: Provides a canonical sorting order for atoms within a residue, crucial for standardized file formats and analysis.Introduced a Strong Typing System for Residues:
ResidueTypeenum to represent standard amino acids (e.g., Alanine, Glycine) and their variants (e.g., Histidine protonation states).FromStrfor parsing three-letter codes intoResidueType.Residuestruct to include anOption<ResidueType>, adding rich semantic information.MolecularSystemandBgfFileparser to handle and store this newResidueType.Added Dependencies and Scaffolding:
phfas a new dependency for identifier utilities.