dimchris / mdanalysis

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

Can't create TRR from GRO #101

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. u = MDAnalysis.Universe("x.gro")
2. TRR = MDAnalysis.Writer("osc.trr", numatoms=u.atoms.numberOfAtoms())
3. TRR.write(u.atoms)
4. TRR.close()

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

Should create a TRR trajectory with a single timestep. Instead it gives a 

  AttributeError: 'Timestep' object has no attribute 'time'

A workaround is to manually add a time to the ts object and use it:

  u.trajectory.ts.time = 1
  TRR.write(u.trajectory.ts)

Not sure yet what the best way to handle this is: Should we have the trajectory 
writers make up a time step if there's none and just increment? Otherwise it is 
difficult to generate trajectories from individual frames.

Original issue reported on code.google.com by orbeckst on 19 Apr 2012 at 10:44

GoogleCodeExporter commented 9 years ago
Same problem exists when reading a single frame PDB file:
u = MDAnalysis.Universe('x.pdb')

Could it be that this could also be connected to a problem I was having with 
single frame PDB files and HydrogenBondAnalysis:
1. u = MDAnalysis.Universe('x.pdb')
2. h = MDAnalysis.analysis.hbonds.HydrogenBondAnalysis(u, selection1, 
selection2)
3. h.run()
gives
  AttributeError: 'bool' object has no attribute 'frame'

Should I open a separate bug or can I leave it here?

Original comment by lukas.gr...@gmail.com on 20 Apr 2012 at 10:09

GoogleCodeExporter commented 9 years ago
Lukas, please open a new issue and should it turn out to be related then we'll 
merge it.

Btw, this issue report also applies to single frame PDB files (and probably any 
of our other single-frame formats):

>>> import MDAnalysis
>>> from MDAnalysis.tests.datafiles import *
>>> u = MDAnalysis.Universe(PDB)
>>> TRR = MDAnalysis.Writer("out.trr", numatoms=u.atoms.numberOfAtoms())
>>> TRR.write(u.atoms)
AttributeError: 'Timestep' object has no attribute 'time'

Thanks,
Oliver

Original comment by orbeckst on 20 Apr 2012 at 3:32

GoogleCodeExporter commented 9 years ago
This issue was closed by revision d25969ac6bcf.

Original comment by orbeckst on 31 May 2012 at 6:19