djay0529 / mdanalysis

Automatically exported from code.google.com/p/mdanalysis
0 stars 0 forks source link

Helanal doesn't accept GRO/XTC with Finish Argument #188

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

import MDAnalysis, MDAnalysis.analysis
from MDAnalysis.tests.datafiles import GRO,XTC
u = MDAnalysis.Universe(GRO,XTC)
MDAnalysis.analysis.helanal.helanal_trajectory(u, selection='name CA', finish=5)

What is the expected output? What do you see instead?

Expected output something like this:

Analysing 214/11302 residues
              1000.0  ps         11 
Complete
Height: 0.341991464335 SD 2.12514642622 ABDEV 1.88631979414 (Angstroem)
Twist: 114.775666469 SD 28.5939986973 ABDEV 23.3474896327
Residues/turn: 3.50312724972 SD 3.71728742507 ABDEV 0.776642571488
Fitted tilt: 92.1600635178 SD 15.3248790919 ABDEV 9.52867446489
Local bending angles:
...

Actual output:
Analysing 214/11302 residues

Complete
Height: 0 SD 0 ABDEV 0 (Angstroem)
Twist: 0 SD 0 ABDEV 0
Residues/turn: 0 SD 0 ABDEV 0
Fitted tilt: 0 SD 0 ABDEV 0
Local bending angles:
ResID
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/cing/.../Python-2.7.3/lib/python2.7/site-packages/MDAnalysis/analysis/helanal.py", line 420, in helanal_trajectory
    for item in range(4,len(residue_statistics[0])+4):
IndexError: list index out of range

What version of the product are you using? On what operating system?
MDAnalysis-0.8.1

Please provide any additional information below.

MDAnalysis.analysis.helanal.helanal_trajectory(u, selection='name CA') works.
MDAnalysis.analysis.helanal.helanal_trajectory(u, selection='name CA', 
begin=None, finish=None) works.
MDAnalysis.analysis.helanal.helanal_trajectory(u, selection='name CA', begin=5, 
finish=None) works.
MDAnalysis.analysis.helanal.helanal_trajectory(u, selection='name CA', 
begin=None, finish=5) doesn't work.

Original issue reported on code.google.com by ing.ch...@gmail.com on 7 Jul 2014 at 10:45

GoogleCodeExporter commented 9 years ago
The problem here is that your Finish time (in ps) precedes the start time of 
the trajectory, so you can't really stride through in that case. If the finish 
time you specified was greater than the start time this problem wouldn't arise. 
I've now fixed this in the development branch--basically it will raise in 
Exception and tell you what the two times are if you Finish time precedes the 
start time of the trajectory itself.

Original comment by tyler.je.reddy@gmail.com on 8 Jul 2014 at 7:02

GoogleCodeExporter commented 9 years ago
Great! I don't know why I thought the units of begin/finish were steps and not 
picoseconds. 

Original comment by ing.ch...@gmail.com on 8 Jul 2014 at 9:00