-
Notifications
You must be signed in to change notification settings - Fork 647
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
concatenating ResidueGroups #532
Comments
So I think a lot of what is going on is that there's rarely checks that two MDA objects are from the same Universe when things are used (AtomGroups added, in functions etc) With the u = self.atoms[0].universe
indices = self.atoms.indices
positions = u.trajectory.ts.positions[indices]
return positions To make this work properly, you'd need to instead do a list comprehension over the atoms, so each atom pulled the coordinate from its original Universe A good fix for this would be to add a line to |
Can we add a quick fix (along the lines of what @richardjgowers suggests) to at least prevent weird things from happening silently? It would be worthwhile to think through what the requirements are to make system building work seamlessly (such as a checklist of features and uses that "should just work") and then we could think how the underlying data representations have to be structured to make that work. My suspicion is that this will be tangled up with #363 . |
#363 is going to make things like this worse, as it moves from list comprehensions of attributes (asking each I think the ultimate solution is to Merge first, and then work from there, and never (be able to) use mixed Universe objects. |
Prevents addition of AtomGroups from different Universes
So I've added the check for adding AtomGroups from different Universes. This should now not work and make lots of noise. I think the rest of this is wontfix and/or use Merge so I'm gonna close this. |
What has set_positions method been changed to? This doesn't work anymore |
@aphagstrom for general questions please use the mailing list https://groups.google.com/forum/#!forum/mdnalysis-discussion . We're happy to answer questions there. We reserve the issue tracker for bugs and enhancements. Thanks! |
In a topology building context with two matching ResidueGroup selections, when you attempt to concatenate the ResidueGroups and write them to file, strange things happen (see below). This is probably related to the atom indices matching between the two groups despite changes to the resids. If you do this naively, you will restore the changed coordinates in the output file even though the concatenated group shows different coordinate contents (which also seem to be wrong in this example!).
Although one can simply state that
MDAnalysis.Merge()
should be used in these cases, is it really sensible for this kind of behaviour to happen silently? If building topology in this manner is really discouraged, maybe some kind of warning would be useful when concatenating groups with matching atom indices? Also, the docs seem to suggest thatindices
is a read only property, so I'm guessing a quick manual setting, even for an experienced user, might be tricky? Maybe one could go down to theatom.index
level directly though.The text was updated successfully, but these errors were encountered: