Conversation
Add a new function `mdtools.check.box_mat` that checks if the input array satisfies the conditions for a (triclinic) simulation box matrix.
Fix and format the function `mdtools.check.array`. The test whether `amax` is greater than `amin` didn't took into account that `amax` and `amin` can be arrays.
Fix and format the function `mdtools.check.pos_array`. The dimensionality must be checked before the shape of any dimension is checked, because the dimension might not exist in the input array.
Fix and format the function `mdtools.check.box`. The dimensionality must be checked before the shape of any dimension is checked, because the dimension might not exist in the input array.
Fix and format the function `mdtools.check.dtrj`. Also check for 0-dimensional arrays.
Fix the function `mdtools.numpy_helper_functions.take` that wrongly raised an error if a negative axis was equal to the number of dimensions of the array.
Add a new function `mdtools.box.triclinic_box` that converts the matrix representation of a simulation box to the length-angle representation.
Add a new function `mdtools.box.triclinic_vectors` that converts the length-angle representation of a simulation box to the matrix representation.
Add a new function `mdtools.box.cart2box` that transforms Cartesian coordinates to box coordinates.
Add a new function `mdtools.box.box2cart` that transforms box coordinates to Cartesian coordinates.
New Features: * Add support for triclinic simulation boxes to the function `mdtools.box.vdist` that calculates the distance vectors between two position arrays with the option to account for the minimum image convention. * Add the `dtype` argument to `mdtools.box.vdist` that allows the user to specify the data type of the output array. * Add the `out_tmp` argument to `mdtools.box.vdist` that allows the user to parse a pre-allocated array to store temporary results to speed up the calculation if the function is called multiple times. Breaking changes: * If `box` has shape ``(k, 6)`` a two-dimensional position array is not any longer interpreted to have the shape ``(k, 3)``. Instead it is now interpreted to have shape ``(n, 3)``. Here k is the number of frames and n is the number of particles.
Update the docstring of the function `mdtools.structure.rmsd`. Because `mdtools.box.vdist` now supports triclinic simulation boxes, `mdtools.structure.rmsd` does so, too.
New Features: * Add support for triclinic simulation boxes to the function `mdtools.box.wrap_pos` that shifts all particle positions into the primary unit cell. * Add the `out` argument to `mdtools.box.wrap_pos` that allows the user to parse a pre-allocated array into which to store the result. * Add the `dtype` argument to `mdtools.box.wrap_pos` that allows the user to specify the data type of the output array. Breaking changes: * Remove the `mda_backend` argument, because `mdtools.box.wrap_pos` no longer uses `MDAnalysis.lib.distances.apply_PBC`. * If `box` has shape ``(k, 6)`` a two-dimensional position array is not any longer interpreted to have the shape ``(k, 3)``. Instead it is now interpreted to have shape ``(n, 3)``. Here k is the number of frames and n is the number of particles.
…pos` Adapt `mdtools.structure.wcenter_pos` to the changes in `mdtools.box.wrap_pos`. New Features: * Add support for triclinic simulation boxes to the function `mdtools.structure.wcenter_pos` that calculates the weighted center of an position array. * Add the `dtype` argument to `mdtools.structure.wcenter_pos` that allows the user to specify the data type of the output array. Breaking changes: * Remove the `mda_backend` argument, because `mdtools.box.wrap_pos` no longer uses supports it. * If `box` has shape ``(k, 6)`` a two-dimensional position array is not any longer interpreted to have the shape ``(k, 3)``. Instead it is now interpreted to have shape ``(n, 3)``. Here k is the number of frames and n is the number of particles. * If centers are calculated for multiple frames, always return an array of shape ``(k, 1, 3)`` instead of ``(k, 3)``.
Adapt `mdtools.structure.rmsd` to the changes in `mdtools.structure.wcenter_pos`.
Update docstring, sort imports and fix linter warnings.
Fix the function `mdtools.box.make_whole`: Remove the `debug` argument that was parsed to `MDAnalysis.core.groups.AtomGroup.unwrap` although `MDAnalysis.core.groups.AtomGroup.unwrap` has no `debug` argument. Fix wrongly rendered docstring.
Create a LibreOffice Calc Spread Sheet to test different unwrapping algorithms.
Create a new function `mdtools.box.unwrap_frame` that unwraps a single trajectory frame. The new functions implements five different unwrapping algorithms: "scaling", "heuristic", "displacement", "hybrid", "in-house". See * Sören von Bülow, Jakob Tómas Bullerjahn, and Gerhard Hummer, Systematic errors in diffusion coefficients from long-time molecular dynamics simulations at constant pressure, The Journal of Chemical Physics, 2020, 153, 021101, * Martin Kulke and Josh V. Vermaas, Reversible Unwrapping Algorithm for Constant-Pressure Molecular Dynamics Simulations, Journal of Chemical Theory and Computation, 2022, 18, 10, 6161-6171.
Completely rewrite the script `unwrap_trj.py` to use the new function
`mdtools.box.unwrap_frame`.
* Add the following command-line arguments:
* `-b`: First frame to read.
* `--every`: Read every n-th frame.
* `--method`: The unwrapping method to use.
* Rename the following command-line arguments:
* `--otrj` to `--trj-out`: Output trajectory.
* `--otop` to `--top-out`: Output topology.
* `--compound` to `--cmp`: The compounds to make whole.
* Remove the following command-line arguments:
* `--make-whole`.
* `--keep-whole`.
* Add docstring.
fcffea7 to
0c5eed4
Compare
Create summary doc page for all scripts that manipulate MD trajectories.
Add a new make option `install_mdt` that (re-)installs MDTools. Re-installing MDTools is necessary when changing the docstring of a script. Otherwise the changes won't be recognized by Sphinx.
Add a note that doc pages of scripts might not get updated if you simply run `make html` after changing a script's docstring. Instead, you need to re-install MDTools first even if you have installed it in editable mode.
Add a note that doc pages of scripts might not get updated if you simply run `make html` after changing a script's docstring. Instead, you need to re-install MDTools first even if you have installed it in editable mode.
Remove the function `mdtools.box.unwrap` because it is replaced by the new function `mdtools.box.unwrap_frame`.
Remove the function `mdtools.box.unwrap_trj` because it uses the displacement unwrapping method that only works for constant simulation boxes and was only implemented for orthorhombic boxes. Use the script `unwrap_trj` or the function `mdtools.box.unwrap_frame` instead.
Create a new script that calculates the Root Mean Square Deviation (RMSD) between two trajectories for each frame.
0c5eed4 to
2a39429
Compare
15 tasks
andthum
added a commit
that referenced
this pull request
Mar 10, 2023
Fix some errors introduced by PR #151
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.
Fix Trajectory Unwrapping
Type of change
Proposed changes
Breaking Changes:
unwrap_trj.py: Completely rewrite the script to use the new functionmdtools.box.unwrap_frame.Add the following command-line arguments:
-b: First frame to read.--every: Read every n-th frame.--method: The unwrapping method to use.Rename the following command-line arguments:
--otrjto--trj-out: Output trajectory.--otopto--top-out: Output topology.--compoundto--cmp: The compounds to make whole.Remove the following command-line arguments:
--make-whole.--keep-whole.mdtools.box.unwrapbecause it is replaced by the new functionmdtools.box.unwrap_frame.mdtools.box.unwrap_trjbecause it uses the displacement unwrapping method that only works for constant simulation boxes and was only implemented for orthorhombic boxes. Use the scriptunwrap_trjor the functionmdtools.box.unwrap_frameinstead.mdtools.box.vdist: Ifboxhas shape(k, 6)a two-dimensional position array is not any longer interpreted to have the shape(k, 3). Instead it is now interpreted to have shape(n, 3). Here k is the number of frames and n is the number of particles.mdtools.box.wrap_pos: Remove themda_backendargument, becausemdtools.box.wrap_posno longer usesMDAnalysis.lib.distances.apply_PBCinternally.mdtools.box.wrap_pos: Ifboxhas shape(k, 6)a two-dimensional position array is not any longer interpreted to have the shape(k, 3). Instead it is now interpreted to have shape(n, 3). Here k is the number of frames and n is the number of particles.mdtools.structure.wcenter_pos: Remove themda_backendargument.mdtools.structure.wcenter_pos: Ifboxhas shape(k, 6)a two-dimensional position array is not any longer interpreted to have the shape(k, 3). Instead it is now interpreted to have shape(n, 3). Here k is the number of frames and n is the number of particles.mdtools.structure.wcenter_pos: If centers are calculated for multiple frames, always return an array of shape(k, 1, 3)instead of(k, 3).New Features:
rmsd_trj_trj.pythat calculates the Root Mean Square Deviation (RMSD) between two trajectories for each frame.mdtools.box.unwrap_framethat unwraps a single trajectory frame. The new functions implements five different unwrapping algorithms: "scaling", "heuristic", "displacement", "hybrid", "in-house". SeeSystematic errors in diffusion coefficients from long-time moleculardynamics simulations at constant pressure,
The Journal of Chemical Physics, 2020, 153, 021101,
Reversible Unwrapping Algorithm for Constant-Pressure Molecular Dynamics Simulations,
Journal of Chemical Theory and Computation, 2022, 18, 10, 6161-6171.
mdtools.box.vdist: Add support for triclinic simulation boxes.mdtools.box.wrap_pos: Add support for triclinic simulation boxes.mdtools.structure.rmsd: Add support for triclinic simulation boxes.mdtools.structure.wcenter_pos: Add support for triclinic simulation boxes.mdtools.box.cart2boxthat transforms Cartesian coordinates to box coordinates.mdtools.box.box2cartthat transforms box coordinates to Cartesian coordinates.mdtools.box.triclinic_vectorsthat converts the length-angle representation of a simulation box to the matrix representation.mdtools.box.triclinic_boxthat converts the matrix representation of a simulation box to the length-angle representation.mdtools.check.box_matthat checks if the input array satisfies the conditions for a (triclinic) simulation box matrix.Bug fixes:
mdtools.box.make_whole: Remove thedebugargument that was parsed toMDAnalysis.core.groups.AtomGroup.unwrapalthoughMDAnalysis.core.groups.AtomGroup.unwraphas nodebugargument.mdtools.checkmodule.Documentation changes
install_mdtbuild option to the developer's guide.Maintenance
Makefilefor doc pages: Add a new make build optioninstall_mdtthat (re-)installs MDTools. Re-installing MDTools is necessary when changing the docstring of a script. Otherwise the changes won't be recognized by Sphinx.linkcheckduring the CI workflow.Requested reviewers
@andthum
PR checklist