-
Notifications
You must be signed in to change notification settings - Fork 832
ENH: Change DSSP get_hbond_map to use capped_distance and PBC-aware distance calculations
#5182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
BradyAJohnston
wants to merge
26
commits into
MDAnalysis:develop
Choose a base branch
from
BradyAJohnston:dssp-kdtree
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
8f25085
initial port to KDTree based HBond map
BradyAJohnston a3f9ac4
change distance_matrix -> query_ball_tree
BradyAJohnston 617e7de
tweak comments
BradyAJohnston 234ad87
tweak commments and layout
BradyAJohnston 93906df
run black
BradyAJohnston f578aa9
add name to AUTHORS
BradyAJohnston d831ba2
add changelog and return comment
BradyAJohnston 86a045d
add test for donor_mask
BradyAJohnston 26c4ca8
run black
BradyAJohnston 2105bd6
change KDTree -> capped_distances
BradyAJohnston e81d2e2
run black
BradyAJohnston bdaadab
move changelog entry
BradyAJohnston f0b2e23
use before distance calculations
BradyAJohnston 4faa47c
warning for init of default box dimensions
BradyAJohnston 4ccfeb6
Merge branch 'develop' into dssp-kdtree
BradyAJohnston dcf7f89
address PR feedback
BradyAJohnston ebf118f
black format testsuite
BradyAJohnston bfd812d
fix is_proline mask (bool instead of idx)
BradyAJohnston 31db5cb
test coverage for box dimensions warning
BradyAJohnston 217575b
Update package/MDAnalysis/analysis/dssp/dssp.py
BradyAJohnston bb4f60a
Update package/MDAnalysis/analysis/dssp/dssp.py
BradyAJohnston fe63869
remaining docs comments
BradyAJohnston 1694c1d
asv benchmark for dssp
BradyAJohnston e3eb6ec
Merge branch 'develop' into dssp-kdtree
BradyAJohnston f00c5ef
Update testsuite/MDAnalysisTests/analysis/test_dssp.py
orbeckst c1fc511
Merge branch 'develop' into dssp-kdtree
orbeckst File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| import MDAnalysis as mda | ||
|
|
||
| try: | ||
| from MDAnalysisTests.datafiles import TPR, XTC, PDB_janin | ||
| except: | ||
| pass | ||
|
|
||
| try: | ||
| from MDAnalysis.analysis.dssp import DSSP | ||
| from MDAnalysis.analysis.dssp.pydssp_numpy import assign | ||
| except: | ||
| pass | ||
|
|
||
|
|
||
| class DsspBench(object): | ||
| """Benchmarks for MDAnalysis.analysis.dssp.DSSP over a trajectory.""" | ||
|
|
||
| params = ([1, 5, 10], [True, False]) | ||
| param_names = ["n_frames", "guess_hydrogens"] | ||
|
|
||
| def setup(self, n_frames, guess_hydrogens): | ||
| self.u = mda.Universe(TPR, XTC) | ||
| self.dssp = DSSP(self.u, guess_hydrogens=guess_hydrogens) | ||
| self.n_frames = n_frames | ||
|
|
||
| def time_dssp_run(self, n_frames, guess_hydrogens): | ||
| """Benchmark DSSP.run() over n_frames of a trajectory.""" | ||
| self.dssp.run(stop=self.n_frames) | ||
|
|
||
|
|
||
| class DsspAssignBench(object): | ||
| """Benchmarks for the core DSSP assign() function on a single frame. | ||
|
|
||
| Uses PDB_janin as a large test system for number of residues | ||
| """ | ||
|
|
||
| params = [50, 100, 214, 500] | ||
| param_names = ["n_residues"] | ||
|
|
||
| def setup(self, n_residues): | ||
| self.u = mda.Universe(PDB_janin) | ||
| dssp = DSSP(self.u) | ||
| coords = dssp._get_coords() | ||
| self.coords = coords[:n_residues] | ||
|
|
||
| def time_assign(self, n_residues): | ||
| """Benchmark single-frame assign() call.""" | ||
| assign(self.coords) |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for including the benchmark.
Idea for the future: test different backends via test parameters; I tried looking into it but was getting stymied by lack of distopia conda-forge packages for Python 3.14 MDAnalysis/distopia#190 — until we have those it won't run cleanly in our nightly benchmarking environment that looks at 3.11 and 3.14 https://github.com/MDAnalysis/benchmarks/blob/32322d3cc11167f3d5cb5a493db2bfcc2703de43/config/asv_c3potato.conf.json#L36
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I initially tried against different backends but ran into issues with distopia & I haven't had any experience with it so left it. Glad it wasn't just me!