-
Notifications
You must be signed in to change notification settings - Fork 676
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
Select dihedrals faster #2706
Select dihedrals faster #2706
Conversation
This looks cool. Would it make sense to put the new logic as a ResidueGroup
method? (Psi_selections)
…On Mon, Jun 1, 2020 at 12:21, Lily Wang ***@***.***> wrote:
Fixes (part of) #2671
<#2671>
Changes made in this Pull Request:
- made phi/psi_selection longer, but faster with manual boolean array
matching of atom names
- made Ramachandran really long and ugly, but really faster with
manual boolean array matching to atom names
- no longer hardcodes phi/psi selection names in Ramachandran
The original Ramachandran.__init__ with the GRO/XTC files was 180 s on my
laptop. When I changed only the phi_selection code, it dropped to 122 s.
When I changed the Ramachandran code, it dropped to 0.25 s.
[image: Screenshot 2020-06-01 at 9 15 50 PM]
<https://user-images.githubusercontent.com/31115101/83404225-9952d100-a44d-11ea-9d75-bc42ae972f76.png>
How much testing does this need?
PR Checklist
- Tests?
- Docs?
- CHANGELOG updated?
- Issue raised/referenced?
------------------------------
You can view, comment on, or merge this pull request online at:
#2706
Commit Summary
- select dihedrals faster
File Changes
- *M* package/MDAnalysis/analysis/dihedrals.py
<https://github.com/MDAnalysis/mdanalysis/pull/2706/files#diff-ad86082633486f3093d80091122b3dc9>
(111)
- *M* package/MDAnalysis/core/topologyattrs.py
<https://github.com/MDAnalysis/mdanalysis/pull/2706/files#diff-96c7f631815d065c6f087f4aea01a4e6>
(123)
Patch Links:
- https://github.com/MDAnalysis/mdanalysis/pull/2706.patch
- https://github.com/MDAnalysis/mdanalysis/pull/2706.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2706>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACGSGB5YOEYUQGI7BVCVYSDRUOFMZANCNFSM4NPXRAXA>
.
|
@richardjgowers that's a great idea, thanks! While we're looking at |
I’m not enough of a bio person to really answer. I do know that resindices
make no promises on ordering, it’s just the unique number we give to each
residue.
…On Mon, Jun 1, 2020 at 12:45, Lily Wang ***@***.***> wrote:
@richardjgowers <https://github.com/richardjgowers> that's a great idea,
thanks! While we're looking at phi/psi_selection, though, and given the
recent discussion on residx vs resids, *should* we be using segid and
resid to select atoms? (I kept this logic in the manual matching for
now). I can see the importance of resid when the protein is missing a
chunk in the middle, but how should segid be treated? If multiple
segments are called the same thing, are they supposed to be treated as the
same segment?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2706 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACGSGBYYNWLB5RHBUMNZPKTRUOIEHANCNFSM4NPXRAXA>
.
|
Codecov Report
@@ Coverage Diff @@
## develop #2706 +/- ##
===========================================
- Coverage 91.19% 91.16% -0.04%
===========================================
Files 174 174
Lines 23700 23881 +181
Branches 3099 3120 +21
===========================================
+ Hits 21614 21771 +157
- Misses 1472 1488 +16
- Partials 614 622 +8
Continue to review full report at Codecov.
|
Edit: closer to 15 lines, actually. |
"""Parameters | ||
---------- | ||
atomgroup : AtomGroup or ResidueGroup | ||
atoms for residues for which :math:`\phi` and :math:`\psi` are | ||
calculated | ||
c_name: str (optional) | ||
name for the backbone C atom |
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.
specify defaults for these in the docstring
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.
and maybe add a line showing how they can be used
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.
I remember discussing this with @orbeckst and coming to the agreement that defaults are in the function signature anyway, so it's easier for docs not to diverge if they're not specified in the docstring. Happy to go either way though
|
||
.. versionadded:: 1.0.0 | ||
""" | ||
u = residues[0].universe | ||
nxres = rview = np.array([None]*len(residues), dtype=object) | ||
nxres = np.array([None]*len(residues), dtype=object) |
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.
fwiw, seems like a candidate for atomgroupgroup #1861
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.
Looks good, I'll let someone else have a look before I merge it
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.
Ok test times look sub 40mins now, thanks @lilyminium !
Fixes (part of) #2671
Changes made in this Pull Request:
The original
Ramachandran.__init__
with the GRO/XTC files was 180 s on my laptop. When I changed only thephi_selection
code (notpsi_selection
), it dropped to 122 s. When I changed the Ramachandran code, it dropped to 0.25 s. Most of that is selecting the protein.How much testing does this need?lotsPR Checklist
To do
c_name
,n_name
etc. as kwargs to those, it's annoying that the names are hard-coded in (edit: will remove pending disapproval from another dev)ResidueGroup
Ramachandran.__init__
to use the group selection methodsEdit: Ramachandran is no longer in the slowest 50 tests.