Recent Releases of https://github.com/ladme/groan_rs
https://github.com/ladme/groan_rs - v0.11.1
Version 0.11.1
- Bug fix: Writing individual groups into XTC and TRR files should no longer cause a panic, even if the group does not start with atom index 0.
- Rust
Published by Ladme 11 months ago
https://github.com/ladme/groan_rs - v0.11.0
Version 0.11.0
Groan Selection Language v0.11
- Updated the
@membranemacro, which should now match a wider variety of lipid molecules. - GSL queries with empty quoted blocks no longer panic.
Bug fixes
- GRO, PDB, and PQR files with NaN positions (or velocities) are no longer parsed and instead raise an error.
- Rust
Published by Ladme 11 months ago
https://github.com/ladme/groan_rs - v0.10.0
Version 0.10.0
New XTC Parser
- Now using
mollyfor faster reading of XTC files. Requires themollyfeature to be active, otherwise the standardxdrfilelibrary is used. Withmollyiterating through XTC files is ~50% faster compared toxdrfile. - Implemented an efficient "partial-frame" XTC reader using
molly. It attempts to only read atoms of a specified group while ignoring the rest of the atoms. SeeGroupXtcReaderandSystem::group_xtc_iterfor more information. GroupXtcReaderimplements a new traitTrajGroupReadOpen.
Integration with the chemfiles Library
- All trajectory file formats supported by
chemfilescan be now read usingSystem::traj_iter<ChemfilesReader>. However, only XTC, TRR, TNG, DCD, Amber NetCDF, and LAMMPSTRJ are independently tested bygroan_rs. Be careful when working with other file formats since these may not work properly. - To enable integration with
chemfiles, you have to enable thechemfilesfeature. If you do this, you need to havecmakeversion LOWER than 4.0.
More Precise Center of Geometry/Mass Calculations
- IMPORTANT Breaking changes:
- Implemented the Refined Bai-Breen algorithm similar to the pseudo-center of mass recentering algorithm described in https://arxiv.org/abs/2501.14578.
- Methods
AtomIteratorWithBox::get_centerandAtomIteratorWithBox::get_comusing the original Bai-Breen algorithm have been RENAMED toAtomIteratorWithBox::estimate_centerandAtomIteratorWithBox::estimate_com, respectively. - Similarly,
System::group_get_centerandSystem::group_get_comhave been renamed toSystem::group_estimate_centerandSystem::group_estimate_com. - New functions called
AtomIteratorWithBox::get_center,AtomIteratorWithBox::get_com,System::group_get_center,System::group_get_comuse the Refined Bai-Breen algorithm which consists of 1) calculating the pseudo-center of geometry of the selected atoms, 2) making the group whole in the simulation box, 3) naive calculation of center of geometry or mass in the simulation box. - The refined Bai-Breen algorithm is much more precise than the original Bai-Breen algorithm but only works for groups that are smaller than half the simulation box. It is also ~50% slower than the original Bai-Breen algorithm.
- All internal
groan_rsmethods now use the Refined Bai-Breen algorithm, with the exception ofSystem::atoms_centerandSystem::atoms_center_masswhich continue to use the original Bai-Breen algorithm but are recommended to only be used for visual centering.
CellGrid
- Implemented a
CellGrid(also known as cell lists) structure for efficient pairwise distance calculations within a cutoff. - New atom iterator,
UnorderedAtomIterator, has been implemented. System::guess_bondshas been reimplemented using aCellGridmaking it much more efficient, especially for large systems.- Breaking change:
System::guess_bonds_parallelhas been removed. (But the newSystem::guess_bondsis now much faster thanSystem::guess_bonds_parallelhas been.)
Hydrogen Bond Analysis
- Implemented a way to identify hydrogen bonds (
HBondAnalysis) in a trajectory. The analysis can be performed with any trajectory reader (HBondTrajRead::hbonds_analyze).
Changes to Trajectory Iteration
- Breaking change:
TrajReadOpentrait has been renamed toTrajFullReadOpen. The originalTrajReadOpentrait now requires implementing theinitializemethod which can be used to construct eitherTrajFullReadOpenstructure
Changes to System::traj_iter_map_reduce (as is tradition)
- Breaking changes:
- The
Datastructure inSystem::traj_iter_map_reduceno longer needs to implementAdd. Instead, it needs to implementParallelTrajDatawhich requires the user to specify how the data structures should be reduced (merged).ParallelTrajDataalso allows the user to provide a custominitializefunction which accepts thread ID and is automatically called after spawning a thread. This allows the user to implement thread-specific behavior or to properly sort the final results. System::traj_iter_map_reducecan be now provided a group name in case a "partial-frame" iteration should be performed. In such case, the providedReaderstructure must beGroupXtcReader.- The
Readerstructure inSystem::traj_iter_map_reducestill needs to implementTrajReadOpenbut it's the new trait (see 'Changes to Trajectory Iteration`). - Made error propagation better. If a single thread encounters an error, all other threads will abort within 10 trajectory frames.
- The
Expansion of Utilities for Ignoring PBC
- Introduced
NaiveShapetrait for geometry filtering ignoring PBC and implemented this trait forSphere,Rectangular, andCylinder. - Implemented
ImmutableAtomIterable::filter_geometry_naiveandMutableAtomIterable::filter_geometry_naivefor geometry filtering of atoms from iterators ignoring PBC and box dimensions.
Other Changes
- Introduced
Atom::reset_bondedandSystem::clear_bondsfor simpler removal of bonding information. - Sodium atoms should be less often misclassified as sulfur when guessing elements.
- Reworked how groups are stored inside a system. Introduced a new
Groupsstructure for storing groups. - Bug fix: Fixed undefined behavior in xdrfile jumping which lead to TRR files being read incorrectly when using clang.
- Bug fix: Fixed incorrect parsing of some TPR files generated with Gromacs 2025.
- Rust
Published by Ladme about 1 year ago
https://github.com/ladme/groan_rs - v0.9.0
Version 0.9.0
Atom Index
- Introduced a new
Atomfieldindex, which corresponds to the index of the atom in the system (starting from 0). This field can be accessed usingAtom::get_indexand is only valid if the atom is part of a system. - Several functions have been reworked to improve efficiency by utilizing the new
indexfield. - Breaking change: The keyword
atomidin the Groan Selection Language has been removed to avoid confusion with the newindexfield. Useatomnuminstead. PositionErrorandMassErrornow report the atom index instead of the atom number.
Reworked Trajectory Writing
- Breaking changes:
- Trajectory writing has been completely reworked.
- Trajectory writers are now attached to
Systemstructures, making them memory safe. - A trajectory writer can be initialized and attached to a
SystemusingSystem::traj_writer_init(orSystem::traj_group_writer_initto write information about a specific group). - Multiple trajectory writers can be attached to a single
System. - The system state can be written into all open output trajectory files using
System::traj_write_frameor to a specific file usingSystem::traj_write_frame_to_file.
RMSD Calculation
- Introduced
System::calc_rmsdto calculate RMSD between the current and a reference structure. - RMSD-fitting of a structure to a reference structure can be performed using
System::calc_rmsd_and_fit. - Calculating RMSD and RMSD-fitting for trajectories is more efficient with
RMSDTrajRead::calc_rmsdandRMSDTrajRead::calc_rmsd_and_fit, implemented for all trajectory readers.
Reading GRO Trajectories
- Trajectories in 'gro' format can now be read using
System::gro_iter. - The
with_stepmethod can be used with the 'gro' iterator, but thewith_rangemethod is unavailable since 'gro' trajectories do not guarantee simulation time information. - A
Systemcan now be constructed by callingSystem::from_fileon a trajectory in 'gro' format. Only the first frame is read, and the system is constructed based on the atoms in this frame.
Getters and Setters
- Breaking changes:
- Many 'setter' and 'getter' methods have been renamed:
get_atoms_as_ref->get_atomsget_atoms_as_mut->get_atoms_mutget_groups_as_ref->get_groupsget_box_as_ref->get_boxget_box_as_mut->get_box_mutget_atom_as_ref->get_atomget_atom_as_mut->get_atom_mutget_atom_unchecked_as_ref->get_atom_uncheckedget_atom_unchecked_as_mut->get_atom_unchecked_mutget_labeled_atom_as_ref->get_labeled_atomget_labeled_atom_as_mut->get_labeled_atom_mutget_atoms_mutnow returns a mutable slice&mut [Atom]instead of a mutable vector&mut Vec<Atom>, preventing users from adding or removing atoms.- Signatures of several 'getter' methods originally returning
&strorOption<&str>have been changed to return&StringorOption<&String>, which may cause minor compatibility issues, for instance when comparing strings.
Changes to System::traj_iter_map_reduce
- Breaking change:
System::traj_iter_map_reducenow requires the user to provide the initialDatastructure. TheDatastructure no longer needs to implementDefaultbut must implementClone. System::traj_iter_map_reducenow properly propagates errors and failures from individual threads to the master thread'sProgressPrinter.
Changes to Atom Iterators
- Breaking change: Renamed
MasterAtomIteratorandMasterMutAtomIteratortoAtomIterable. - Introduced new traits:
AtomIteratorWithBoxandMutAtomIteratorWithBoximplemented by all (im)mutable atom iterators containing information about the simulation box. - Added a new trait
OrderedAtomIterator, implemented by all immutable and mutable iterators yielding atoms in the order they appear in the molecular system. - Iterator unions and intersections can be constructed for iterators implementing
OrderedAtomIteratorusingOrderedAtomIterator::unionandOrderedAtomIterator::intersection. - Added
AtomPairIteratorandMutAtomPairIteratorfor iterating over pairs of atoms. These iterators currently support iterating over molecule bonds and can be created usingSystem::molecule_bonds_iterandSystem::molecule_bonds_iter_mutfor immutable and mutable access, respectively. - Note: The design of these iterators and the structure of atom pairs are subject to future refinement and potential expansion.
Bug Fixes and Other Changes
- Introduced
System::make_group_wholeto make a group "whole" in the system (similar toSystem::make_molecules_whole). - Breaking change:
System::group_all_distancesnow returns ndarray'sArray2instead of a vector of vectors. FileTypeis now part of the prelude.- Properly implemented
DerefandDerefMutforVector3D, simplifying access to methods fromnalgebra::Vector3. - Improved the performance of
AtomContainer::isin(and consequentlySystem::group_isin). Vector3Dnow implements theDisplaytrait.- Introduced
Vector3D::averagefor calculating the average 3D vector from a collection of vectors. - Introduced
System::groups_memberto return a vector of all group names an atom with a specified index is a member of. - Values in
GridMapcan now be cleared usingGridMap::clear. - Reworked the loading of
GridMapsfrom files, ensuring invalid coordinates cannot be loaded. - Introduced
System::guess_elements_unknownto assign elements only to atoms without an assigned element. ProgressPrinternow uses a mutex only if theparallelfeature is enabled.- Introduced
Vector3D::rotate,Atom::rotate, andAtom::rotate_nopbcfor performing rotations using rotation matrices. - Added trajectory converters and analyzers, which are trajectory readers that modify and/or analyze the current simulation frame. See
TrajConverter,TrajAnalyzer, andTrajConverterAnalyzerfor more details. These structures are primarily for internal use in thegroan_rscrate. - Introduced center of geometry/mass calculation not taking PBC into consideration (
System::group_get_center_naive,System::group_get_com_naive,AtomIterable::get_center_naive,AtomIterable::get_com_naive). - Bug fix: Regex operators can now be used in regular expression blocks without raising an
InvalidOperatorerror. - Bug fix: Bonds are now properly loaded for TIP3P and similar water models from TPR files.
- Breaking change:
XdrFile::open_xdris no longer public.
- Rust
Published by Ladme over 1 year ago
https://github.com/ladme/groan_rs - v0.8.2
Version 0.8.2
- Methods from the
parallelfeature are now included in the documentation.
- Rust
Published by Ladme almost 2 years ago
https://github.com/ladme/groan_rs -
Version 0.8.1
- Bug fix: Unsupported gromacs simulation box in GRO files no longer causes a panic.
- Rust
Published by Ladme about 2 years ago
https://github.com/ladme/groan_rs -
Version 0.8.0
Reading structures from TPR files
- In addition to system topology and simulation box, the positions, velocities, and forces of atoms, and intermolecular bonds can now also be read from TPR files.
Reworked and expanded Atom iterators
- All custom iterators over atoms now implement one of two traits:
MasterAtomIteratorandMasterMutAtomIterator, depending on whether they provide references or mutable references to atoms. - All mutable atom iterators can now call
MasterMutAtomIterator::translateandMasterMutAtomIterator::wrapmethods which translate and wrap, respectively, the atoms of the iterator. - All immutable atom iterators can now call
MasterAtomIterator::get_centerandMasterAtomIterator::get_commethods to calculate the center of geometry and center of mass, respectively, of the atoms of the iterator. This is useful for the calculation of the local center of mass in the system. - Iterators over atoms of the system can now be constructed directly from selection queries using
System::selection_iter(for iteration over immutable atoms) andSystem::selection_iter_mut(for iteration over mutable atoms). This allows selecting atoms without adding groups to the system. - All custom iterators over atoms now implement
DebugandClone.
Labeled atoms
- Individual atoms can now be labeled with strings using
System::label_atomandSystem::select_and_label. - Labeled atoms can be accessed using their labels via
System::get_labeled_atom_as_ref,System::get_labeled_atom_as_mut, andSystem::get_labeled_atom_copy. - You can iterate through labeled atoms using
System::labeled_atoms_iterandSystem::labeled_atoms_iter_mut. - Labeled atoms can be selected using the Groan Selection Language (
label 'atom X').
GridMap structure
- Implemented the
GridMapstructure for easier analysis of properties of planar surfaces such as membranes. GridMapis a generic 2D array that can be navigated using coordinates of the molecular system.
Serde feature
- Serde support was added for
FileType,Dimension,Sphere,Rectangular,Cylinder, andTriangularPrism. - All (de)serializable
groan_rsstructures/enums now deny unknown fields.
Other changes
- Breaking change: The
Group::name_is_validfunction has been moved to theauxiliarymodule and is no longer public. - Breaking change: Renamed several functions for consistency with commonly used terminology:
System::get_atoms_as_ref_mut->System::get_atoms_as_mutSystem::get_groups_as_ref_mut->System::get_groups_as_mutSystem::get_box_as_ref_mut->System::get_box_as_mutSystem::get_atom_as_ref_mut->System::get_atom_as_mut
- Breaking change:
System::get_atoms_as_mut,System::get_groups_as_mut,System::group_remove, andSystem::group_renameare no longer public (and also no longer marked as unsafe). Users should not be able to add/remove atoms or groups or change the properties and names of groups. Changing properties of atoms is still allowed, but it is better done usingSystem::atoms_iter_mut. - Implemented
System::traj_iter_map_reducefor simple, embarrassingly parallel iteration through simulation trajectories (requires theparallelfeature). - Implemented
System::group_intersection, allowing direct creation of groups that are intersections of other groups. - Implemented
System::from_file_with_format, allowing direct specification of the input file format. - When writing 'gro' and 'pdb' files, large coordinates can no longer overflow the space allocated for them in the file format, and instead, an error is returned.
- Made internal changes to the
ProgressPrinter, potentially allowing it to be used in a multithreaded environment (untested). - Added unchecked (and unsafe) variants of
System::get_atom_*methods.
- Rust
Published by Ladme about 2 years ago
https://github.com/ladme/groan_rs - v0.7.1
Version 0.7.1
- Bug fix: GSL queries containing non-ASCII characters should no longer cause panic.
tpr_io::read_tpris now a public function.TrajReadOpentrait is now included ingroan_rs::prelude.- Replaced the
crossbeam_utilscrate with features from standard library.
- Rust
Published by Ladme over 2 years ago
https://github.com/ladme/groan_rs - v0.7.0
Version 0.7.0
Reading TPR files
- Implemented basic reading of TPR files using the
minitprcrate. TheSystem::from_filefunction can now recognize and parse TPR files. - TPR files can also be explicitly read using the
tpr_io::read_tprfunction (import withuse groan_rs::io::tpr_io). - Currently, only the system name, simulation box dimensions, and the topology of the system (atoms and bonds) are being parsed.
- Atom positions, velocities, and forces are not read from the TPR file by
groan_rs. All atoms in a system created by parsing a TPR file will have undefined positions and velocities. - Reading intermolecular bonds and groups from TPR files is not currently supported.
Reading and writing PQR files
- The
System::from_filefunction now supports reading whitespace-delimited PQR files. - PQR files can also be explicitly read using the
pqr_io::read_pqrfunction (import withuse groan_rs::io::pqr_io). - PQR files can be written with user-specified precision using the
System::write_pqrandSystem::group_write_pqrfunctions.
TrajConcatenator structure
- All trajectory readers implementing certain traits (refer to
trajectory_readers.mdfor more information) can now be concatenated using theSystem::traj_cat_iter. - During concatenation, duplicate frames from trajectory boundaries are removed, allowing for simple iteration through simulation trajectories that directly follow each other.
- The
System::xtc_cat_iterandSystem::trr_cat_iterfunctions are provided for direct concatenation of XTC and TRR files, respectively. - Basic methods associated with trajectory readers, such as
with_range,with_step, orprint_progress, can be applied to the concatenation iterator. - The
TrajConcatenatorstructure ensures that the trajectory range is correctly identified even if it spans multiple trajectory files and that step iteration properly handles trajectory boundaries.
Replaced custom Vector3D implementation with faster Vector3 from nalgebra crate
- Breaking change: When
Vector3D::to_unitis applied to a vector with a length (magnitude) of zero, its fields are now set toNaNinstead of the previously used0.0.
Restructuring of the module system
- Breaking change: The
Selectstructure is now located directly in thegroan_rs::selectmodule, not ingroan_rs::selections::select. - Breaking change: The
Systemstructure is now located directly in thegroan_rs::systemmodule, not ingroan_rs::system::general. This change does not affec users who utilizegroan_rs::prelude.
serde feature
- Added a new feature,
serde, which provides serialization and deserialization for severalgroan_rsstructures, namely Vector3D, SimBox, Atom, AtomContainer, AtomBlock, Group, System, and Select. - Select can be deserialized from a valid Groan Selection Language (GSL) query and serialized into a valid GSL query.
- This feature is not enabled by default and must be activated by using
cargo add groan_rs --features serdeor by addinggroan_rs = { version = "0.7.0", features = ["serde"] }to yourCargo.tomlfile. - Note that automated tests for serialization and deserialization currently only use the YAML file format, but other formats supported by the
serdecrate should also work.
parallel feature
- Introduced a new feature,
parallel, which contains functions that can run on multiple threads. - Activate with
cargo add groan_rs --features parallelor by addinggroan_rs = { version = "0.7.0", features = ["parallel"] }. - Currently, only a parallelized version of
System::guess_bonds, calledSystem::guess_bonds_parallel, has been introduced.
Other changes
- Breaking change: The
parse_queryfunction fromcrate::selections::selecthas been transformed into an associated function of theSelectstructure and should now be called asSelect::parse_query. - Added a basic implementation of the
TriangularPrismshape, which implements theShapetrait. - Added a method,
System::group_create_from_select, allowing groups to be created directly fromSelectstructures. - Clarified changes in the order of groups when removing or renaming a group from the System.
- Rust
Published by Ladme over 2 years ago
https://github.com/ladme/groan_rs - v0.6.2
Version 0.6.2
Bug fix: System::groupsplitbyresid and System::groupsplitbyresname did not work correctly due to incorrect treatment of atom indices. This has now been fixed.
- Rust
Published by Ladme over 2 years ago
https://github.com/ladme/groan_rs - v0.6.1
Version 0.6.1
- Bug fix: When setting
ProgressPrinterto write into a file, the printer did not start a new line once iteration was finished and instead printed new line into standard output. This has been now fixed. ProgressPrintercan be now set to NOT start a new line upon finishing the iteration through the trajectory (seeProgressPrinter::with_newline_at_end).
- Rust
Published by Ladme over 2 years ago
https://github.com/ladme/groan_rs - v0.6.0
Version 0.6.0
Simulation box is now an optional property of the system
- Breaking change: The simulation box is now an optional property of the system.
- This change affects the return type of various functions that access the simulation box.
- High-level methods of the
Systemstructure now return errors if they require a simulation box and it is not present.
Undefined atom positions no longer cause panic
- Breaking change: Higher-level
SystemandAtommethods no longer panic when encountering an atom with an undefined position; instead, they return a recoverable error.
Assigning and guessing elements and bonds
- Added the
Elementsstructure, which defines properties of supported elements. - The
Elementsstructure can be constructed from a YAML file containing element definitions by callingElements::from_file. - Default properties of the elements supported by
groan_rsare stored insrc/config/elements.yaml. A defaultElementsstructure, containing elements and their properties from this YAML file, can be constructed usingElements::default. - The
Elementsstructure can be updated usingElements::update. In this case, anotherElementsstructure must be provided, specifying the changes to be made to the originalElementsstructure. - Elements can be guessed for the atoms of the system using
System::guess_elements. - Bonds can now be guessed for the system using
System::guess_bonds. This requires van der Waals radii to be assigned to individual atoms. Van der Waals radii can be guessed based on the elements.
Changes to the Atom structure
- New optional fields added:
mass,element_name,element_symbol,vdw,expected_max_bonds, andexpected_min_bonds:massspecifies the mass of the atom.element_namespecifies the name of the element assigned to this atom.element_symbolspecifies the symbol of the element.vdwspecifies the van der Waals radius used to guess bonds between atoms.expected_max_bondsspecifies the expected maximum number of bonds this atom may form.expected_min_bondsspecifies the expected minimum number of bonds this atom forms.
- Methods have been added to utilize and access these new fields.
Changes to the Groan Selection Language
- Breaking change: The macro
@hydrogenis no longer supported. Useelement name hydrogeninstead. - Bug fix: Invalid queries containing a command in parentheses followed by anything other than a binary operator (e.g.,
(name CA CB) resname LYS) no longer cause a panic but instead return a proper error. - Atoms can now be selected based on their element name or element symbol (
element name carbonorelement symbol C). This requires atoms to have assigned elements. - Atoms that are part of the same molecule can now be selected using the
molecule withoperator. For example,molecule with serial 13will select all atoms that are part of the same molecule as the atom with number 13. This requires the system to have topology information.
Center of mass calculations
- Introduced
System::group_get_comfor calculating the center of mass of a group of atoms using the Bai and Breen algorithm. Note that all atoms in the target group must have mass information. - Introduced
System::atoms_center_massas an alternative toSystem::atoms_centerbut using center of mass instead of center of geometry.
Other changes
- Breaking change: The
System::set_mol_referencesmethod is no longer public. - Added more tests for the basic
Atomget_*,set_*,reset_*, andwith_*functions. - Documentation examples no longer repeat that you have to use
groan_rs::prelude::*. - Added
Atom::distance_naivefor calculating the distance between atoms without considering periodic boundary conditions. - Bug fix:
Vector3D::wrap_coordinateandVector3D::min_imagenow panic ifbox_lenis 0 instead of looping indefinitely. - The
System::group_get_centerfunction has been refactored and may return a result that is not binary identical to previous versions. - Introduced
System::group_isemptyfunction for checking whether a target group of atoms is empty.
- Rust
Published by Ladme over 2 years ago
https://github.com/ladme/groan_rs - v0.5.0
Version 0.5.0
Important BREAKING CHANGES affecting the entire groan_rs library
- Fields
position,velocity, andforcein theAtomstructure are now of typeOption<Vector3D>.Atom::newinitializes these values toNone. UseAtom::with_position,Atom::with_velocity, orAtom::with_forceto set them.- Accessor methods (
Atom::get_position, etc.) now returnOption<&Vector3D>. - Distance functions require all atoms to have position information; absence leads to panic.
- When writing files, undefined positions (and velocities) are output as 0.0 in all dimensions.
- Reading xtc trajectories sets
velocityandforceof all atoms toNone. - Atoms without
positionare excluded from geometric shape calculations in(Mut)FilterAtomIteratorandSystem::group_create_from_geometry. System::has_forces,System::has_velocities,System::has_positionsreturntrueonly if all atoms have the respective property.- A position with x = 0.0, y = 0.0, z = 0.0 is now considered valid. However, atoms without positions are still written with 0.0 coordinates.
Other changes to the Atom structure
- New optional fields
chargeandbondedadded:charge: Specifies the atom's charge.bonded: Contains indices of atoms bonded to the atom.- Methods added to use and access
chargeandbonded. Atom::wrapmethod introduced for wrapping the atom into the simulation box.
AtomContainer structure
- Breaking Change: Introduction of
AtomContainer:- Describes a collection of atoms in the
Systemstructure. Groupstructure and all atom iterators reworked to useAtomContainer.- Many methods associated with
Groupremoved/renamed/rewritten.
- Describes a collection of atoms in the
Reading and writing PDB files
- Breaking Change:
System::write_pdbandSystem::group_write_pdbnow require an argument for connectivity information. - Potentially Breaking Change: Reading of PDB files now stops at
ENDMDLorEND.ENDkeyword is written correctly at the end of files. - Connectivity section can now be read with
System::add_bonds_from_pdband written withSystem::write_pdb/System::group_write_pdb.
Reading systems with non-orthogonal simulation boxes
- Support added for reading/writing systems with non-orthogonal simulation boxes from/to PDB, XTC, and TRR files.
New System connectivity methods
- New methods introduced:
System::add_bond: Adds a bond between atoms.System::bonded_atoms_iterandSystem::bonded_atoms_iter_mut: Iterates through bonded atoms.System::has_bonds: Checks for available connectivity information.System::molecule_iterandSystem::molecule_iter_mut: Iterates through atoms in the same molecule.System::make_molecules_whole: Fixes molecules broken at periodic boundaries.
Quality-of-Life improvements
ProgressPrinterintroduced for trajectory reading progress. Activated viaTrajMasterRead::print_progress.
Other changes
- Breaking Change: Atom access methods (
System::get_atom_as_ref, etc.) now use index instead ofgmx_atom_number. - Breaking Change:
System::from_filereturnsResult<Self, Box<dyn Error + Send + Sync>>for threading compatibility. System::has_duplicate_atom_numbers: Checks for duplicate atom numbers.System::residues_renumber: Renumbers residues in the system.System::atoms_wrapandSystem::group_wrap: Wraps atoms into the simulation box.System::atoms_distance: Calculates distance between two atoms.- Panic groan errors now specify the originating function.
- Rust
Published by Ladme over 2 years ago
https://github.com/ladme/groan_rs - v0.4.2
- Introduced
System::group_create_from_geometriesfor group creation with multiple geometry constraints. - Excluded test files from the
crates.iocrate distribution. - Removed unnecessary fields from several error variants.
- Added new test for
System::group_create_from_geometry.
- Rust
Published by Ladme over 2 years ago
https://github.com/ladme/groan_rs - v0.4.1
- Added new
TrajMasterReadtrait that is implemented byTrajReader,TrajRangeReader,TrajStepReader, andTrajRangeStepReaderallowing easier usage of these structures in generic functions. - All new traits and structures for trajectory reading are now properly included in the
prelude.
- Rust
Published by Ladme over 2 years ago
https://github.com/ladme/groan_rs - v0.4.0
Changes to the Groan selection language
- Breaking Change: Group names can no longer include the characters '<', '>', or '='.
- Atom, residue, and group names can now be specified using regular expressions in the groan selection language.
- Operators (<, >, <=, and =>) have been introduced for open-ended ranges in the groan selection language.
- Added a new
@hydrogenmacro for automatic hydrogen atom detection. - Implemented a new tokenizer for atom and residue numbers in the groan selection language. #### Changes to reading xtc and trr files
- Breaking Change: Traits for reading xtc and trr files have been completely redone. Most notably,
Xdr* methods, traits, and errors have been renamed toTraj*. - All trajectory readers must now implement
TrajReadtrait and do not have to be iterable. Trajectory iterator is constructed by wrapping theTrajRead-implementing structure intoTrajReader. - Introduced several structures for efficient partial reading of trajectory files:
TrajRangeReaderreads frames in a specified time range. Can be constructed for any structure implementingTrajRangeReadusingwith_rangemethod.TrajStepReaderreads everystepth frame of the trajectory. Can be constructed for any structure implementingTrajStepReadusingwith_stepmethod.TrajRangeStepReaderreads everystepth frame of the trajectory in a specified time range. Can be constructed for any structure implementing bothTrajRangeReadandTrajStepReadusingwith_rangeandwith_stepmethods. #### Other changes
- Added
Atom::has_positionandSystem::has_positionsmethods that check whether the atom or all atoms in the system, respectively, have non-zero position(s). - Added tests for reading double-precision trr files.
- Enhanced documentation for error variants within the
errorsmodule.
- Rust
Published by Ladme over 2 years ago
https://github.com/ladme/groan_rs - v0.3.3
@ionmacro should no longer identify any part of proteins as ions.
- Rust
Published by Ladme over 2 years ago
https://github.com/ladme/groan_rs - v0.3.2
@watermacro should no longer identify N-terminal (or any other) protein hydrogens as water hydrogens.
- Rust
Published by Ladme over 2 years ago
https://github.com/ladme/groan_rs - v0.3.1
- Error message for
GroupError::AlreadyExistsWarningchanged between v0.2.0 and v0.3.0 which caused one test to fail in the 0.3.0 version. This has been now fixed.
- Rust
Published by Ladme almost 3 years ago
https://github.com/ladme/groan_rs - v0.3.0
- Breaking Change: Renamed functions
System::group_by_residandSystem::group_by_resnametoSystem::atoms_split_by_residandSystem::atoms_split_by_resname, respectively. - Breaking Change: Revised the return type of
System::group_createfromResult<(), Box<dyn Error>>toResult<(), GroupError>. This change simplifies pattern matching when handling the result of the function. Additionally, the error typeSelectError, previously returned by the function, is now encapsulated within the new error variantGroupError::InvalidQuery. - Updated selection macros according to Gromacs definitions, and introduced new macros for identifying DNA (
@dna) and RNA (@rna). - Introduced new functions:
System::group_split_by_residfor splitting groups of atoms by their residue ID andSystem::group_split_by_resnamefor splitting by residue name. - Added functions
System::group_removefor removing groups andSystem::group_renamefor renaming them. - Introduced
System::group_create_from_geometrywhich allows to construct groups of atoms that are inside some geometric shape in the current simulation frame. - Restructured codebase:
- Split the
system.rsfile into multiple smaller files. - Grouped files related to IO operations into a dedicated directory.
- Organized files containing
System-related methods into a separate directory. - Placed files defining fundamental data structures into their own directory.
- Split the
- Made minor documentation tweaks.
- Rust
Published by Ladme almost 3 years ago
https://github.com/ladme/groan_rs - v0.2.0
- Added functionality to write atom groups into xtc and trr files using the
XdrGroupWritertrait along with theXtcGroupWriterandTrrGroupWriterstructures. - Introduced an optional property
chainto theAtomstructure, allowing specification of the chain ID to which the atom belongs. This property is automatically loaded from pdb files containing chain identifiers and it can also be set manually using theAtom::with_chainfunction. - When writing pdb files, if the
chainproperty is set for theAtom, it is now written into the pdb file. - A new keyword
chainhas been added to the Groan Selection Language (GSL) that allows to select atoms based on the chain they belong to. - Made the constructors for
AtomIteratorandMutAtomIteratorpublic. - Implemented operations for ndx-writable and ndx-nonwritable groups, including
System::group_make_writable,System::group_make_nonwritable, andSystem::group_names_writable. - Performed small code refactors.
- Made minor documentation fixes.
- Rust
Published by Ladme almost 3 years ago