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
Calculate dihedral angles from xtc trajectory #1335
Comments
I've never really used timeseries myself, I think the following should work.. from MDAnalysis import Universe
u = Universe(gro, xtc)
selection = 'resname {} and resid {} and name {}'
ALA2N = selection.format('ALA', 2, 'N')
ALA2CA = selection.format('ALA', 2, 'CA')
ALA2C = selection.format('ALA', 2, 'C')
TYR3N = selection.format('TYR', 3, 'N')
psi = [ALA2N, ALA2CA, ALA2C, TYR3N]
psi_angle = sum([u.select_atoms(atom) for atom in psi]) # sum of Atoms creates an AtomGroup
psi_angle = psi_angle.dihedral # convert AtomGroup to Dihedral object
psi_list = []
for ts in u.trajectory:
psi_list.append(psi_angle.value())
|
@richardjgowers Thank you. It solved my problem. |
The timeseries feature only works for dcd files or a trajectory copied into memory. |
As @kain88-de says, Typically we recommend using |
Expected behaviour
I'm interested in calculating the time dependent change of a particular dihedral angle from a xtc trajectory and I expect to get a list of angles. I copied the example from https://github.com/MDAnalysis/MDAnalysisCookbook/blob/master/examples/backbone_dihedral.py
Actual behaviour
Code to reproduce the behaviour
I'm not quite sure why you need to call this correl function? I guess to calculate the dihedral angle, you only need four cartesian coordinates?
Something like
Currently version of MDAnalysis:
py35, 0.16.0
The text was updated successfully, but these errors were encountered: