alignto() does an in-place rotation/translation. By default it does this to the whole universe in which mobile is contained (see the docs for details).
Can you simply write out the, say, protein and look at it. E.g.
ref = Universe(PSF, DCD)
ref.trajectory[-1] # forward to last frame
m = Universe(PDB)
prot = m.selectAtoms('protein')
prot.write('before.pdb')
alignto(prot.atoms.CA, ref.atoms.CA)
prot.write('after.pdb')
On 28 May, 2011, at 20:14, Tyler Reddy wrote:
> Hello,
>
> I've been trying to implement the alignto() MDAnalysis function in one of my scripts, but the coordinates of the 'mobile' AtomGroup do not appear to have changed after issuing the command in any given frame of the trajectory. For example, the CA coordinates selected in the code snippet below exactly match the AtomGroup coordinates created for a different variable name before the alignto() function was executed:
>
> MDAnalysis.analysis.align.alignto(current_protein_CA_selection,reference_protein_CA_selection)
> #after the alignment select the adjusted particle positions:
> aligned_protein_CA_selection = universe_object.selectAtoms(protein_CA_selection_string)
Note that
aligned_protein_CA_selection == current_protein_CA_selection
(this is the same list of atoms, only the underlying coordinates were changed)
> aligned_protein_CA_coordinates = aligned_protein_CA_selection.coordinates()
From your code I don't understand what you're comparing to what.
>
> Since alignto() returns rmsd before and after spatial alignment, I thought it would make sense to check the values returned across the frames of one of my trajectories. It seems that the values are consistently very small (on the order of 10^-6, 10^-7, zero, or even a Python 'nan' value). I've checked that the reference protein CA coordinates are the same in each frame and that they are quite different from the mobile coordinates before alignment. Finally, I checked to ensure that the AtomGroup coordinates of the original pre-alignment selection were not themselves altered, so I am not sure where the altered mobile coordinates are stored.
There's only one coordinate set for a universe and frame.
Once you load a new trajectory frame, these coordinates are overwritten.
Maybe you could make a self-contained test case that demonstrates the problem and file an issue.
Oli
p.s.: I won't be able to do anything for the next couple of days – maybe anyone else has some ideas. Filing an issue would ensure that it does not get forgotten.
>
> Thanks,
> Tyler
>
> --
> You received this message because you are subscribed to the Google Groups "MDnalysis discussion" group.
> To post to this group, send email to mdnalysis-...@googlegroups.com.
> To unsubscribe from this group, send email to mdnalysis-discus...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mdnalysis-discussion?hl=en.
--
Oliver Beckstein * orbe...@gmx.net
skype: orbeckst * orbe...@gmail.com