-
Notifications
You must be signed in to change notification settings - Fork 668
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
Dihedrals and selections #1264
Comments
Hey @mimischi So |
Yes. The expectation is that only complete dihedral angles that are present in an AtomGroup will be returned. The current behavior is quite a surprise for backbone selections. Because to get the dihredrals of the backbone atoms alone I would use |
So should the shortcuts to topology groups ( It's a shame it's not a method, because then we could have had a keyword like |
We can could try to copy the behavior of datreant. |
It probably depends on the usage scenario, whether you want to display topology information from atoms not in the AtomGroup:
|
Reviving an old thread:
Yes! The safer approach is to only create dihedrals fully inside the AtomGroup. The user can always create a bigger selection if this is needed. But they have no way to not get the extended behavior. I'd like to change this; if anyone has a different opinion now is a good time to voice it. Otherwise the conclusion of this issue is that the current behavior should be changed in the way @richardjgowers said #1264 (comment) . |
Ok I think this needs to get added as a deprecation for 2.0 where we can switch the behaviour? I can't really see a clean way to do this except announce a break in behaviour over the 1.x / 2.x versions |
Yes, I agree with you. Not sure how we will add a deprecation warning without adding nasty code that checks the result after we computed the selections. Perhaps in docs and CHANGELOG only? |
What would be a postprocessing workaround, e.g., dih = restrict_bonded(dihedrals, ag) so that len(dih) <= len(dihedrals) and |
When creating a selection, e.g.,
backbone = u.select_atoms('backbone')
and then looking at all the dihedral angles of that selection, MDAnalysis also returns dihedrals between atoms pairs that should not be presented.Initial code
Expected behaviour
Only list dihedral angles between atoms in the selection (here: backbone). Total number of dihedrals: 425.
Actual behaviour
Lists all existing dihedrals that start/end in the selection. Total number of dihedrals: 5845.
Currently version of MDAnalysis:
Both 0.15 and current 0.16-dev
The text was updated successfully, but these errors were encountered: