Closed smileyujun closed 11 years ago
So I'm not sure what's going on here. I think the first step towards debugging is opening up a trajectory in an interactive python session. Run ipython --pylab and then enter the following:
>>> from msmbuilder import Trajectory
>>> traj = Trajectory.load_from_lhdf("./Trajectories/trj0.lh5")
>>> traj["XYZList"].shape
>>> traj["XYZList"] = traj["XYZList"][0:5]
>>> traj.save_to_pdb("./test_output.pdb")
This will load a trajectory from your project, check its shape (tell us the shape that you see), grab the first five frames, and save to a PDB. I just want to make sure your trajectories are OK.
Thank you very much for your reply.
Then ,how can i open up a trajectory in an interactive python session?What command i need to type in an interactive python session? I'm sorry that i am a beginner ,but i'm interested in it.Hope get your reply,thanks.
yours sincerely
yujun
At 2013-05-07 02:54:08,kyleabeauchamp notifications@github.com wrote:
So I'm not sure what's going on here. I think the first step towards debugging is opening up a trajectory in an interactive python session. Run ipython --pylab and then enter the following:
from msmbuilder import Trajectory traj = Trajectory.load_from_lhdf("./Trajectories/trj0.lh5") traj["XYZList"].shape
traj["XYZList"] = traj["XYZList"][0:5] traj.save_to_pdb("./test_output.pdb")
This will load a trajectory from your project, check its shape (tell us the shape that you see), grab the first five frames, and save to a PDB. I just want to make sure your trajectories are OK.
— Reply to this email directly or view it on GitHub.
sudo apt-get install ipython
ipython --pylab
good luck!
This is the outcome:
[root@localhost 2oqp4-msm]# ipython --pylab
Python 2.7.3 (default, Mar 27 2013, 10:49:52)
Type "copyright", "credits" or "license" for more information.
IPython 0.13.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
Welcome to pylab, a matplotlib-based Python environment [backend: TkAgg].For more information, type 'help(pylab)'.
In [1]: from msmbuilder import Trajectory
In [2]: traj = Trajectory.load_from_lhdf("./Trajectories/trj0.lh5")
In [3]: traj["XYZList"].shape
Out[3]: (501, 22, 3)
In [4]: traj["XYZList"] = traj["XYZList"][0:5]
In [5]: traj.save_to_pdb("./test_output.pdb")
---------------------------------------------------------------------------IndexError Traceback (most recent call last)<ipython-input-5-8ac5f186f0ac> in <module>()
----> 1 traj.save_to_pdb("./test_output.pdb")
/usr/local/lib/python2.7/site-packages/msmbuilder-2.6.0-py2.7-linux-i686.egg/msmbuilder/Trajectory.pyc in save_to_pdb(self, Filename)
248
249 for i in range(len(self["XYZList"])):
--> 250 PDB.WritePDBConformation(Filename, self["AtomID"], self["AtomNames"], self["ResidueNames"], self["ResidueID"], self["XYZList"][i], self["ChainID"])
251
252 def save_to_xyz(self, Filename):
/usr/local/lib/python2.7/site-packages/msmbuilder-2.6.0-py2.7-linux-i686.egg/msmbuilder/PDB.pyc in WritePDBConformation(Filename, ATOMNUMS, ATOMS, RESNAMES, RESNUMS, XYZ, CHAIN)
2600 line[22:26]=array(list(str(RESNUMS[i]).rjust(4)))
2601
-> 2602 x=10*XYZ[i][0]
2603 y=10*XYZ[i][1]
2604 z=10*XYZ[i][2]
IndexError: index 22 is out of bounds for axis 0 with size 22
In [6]:
The next,how can i solve the problem?
You realize that you are dealing with the tutorial data, not your own protein, right? This line:
In [3]: traj["XYZList"].shape
Out[3]: (501, 22, 3)
Indicates that the trajectory contains 501 frames and 22 atoms, which means that it's alanine dipeptide. Regardless, there is still some kind of issue going on. We are looking into it.
Also, not that this is really relevant to the question at hand, but why are you logged in as root? That seems like a curious choice.
It might be that your trajectory was not created correctly.
How did you create that trajectory file?
Can you do this in ipython and paste the output here:
print traj['AtomID'].shape
Yes,you are right. i use my own protein, but when i run the first command: ConvertDataToHDF.py -s my.pdb -i XTC, in this command, XTC comes from the msmbuilder2.6 tutorial.So i may be wrong here.
Then, if i run my own protein,where do i obtain XTC from?
(I know the frist command:ConvertDataToHDF.py -s my.pdb -i XTC is very important,because it generates the following files:projectInfo.h5 , Trajectories/ , Data/)
The XTC input directory should point to wherever you stored your MD simulations, run using Gromacs.
If you're not familiar with running gromacs, there are some nice tutorials at http://www.gromacs.org/Documentation/Tutorials, but in general, proper setup and running the MD simulations is beyond the scope of msmbuilder.
Does it mean that i must install Gromacs,soon after let Gromacs generate XTC?
'XTC' is just a folder that contains the results of an MD simulation. Have you done an MD simulation for the protein you are interested in studying? MSMBuilder cannot generate this data for you; it is a way to analyze the results.
MSMBuilder is a tool to analyze molecular dynamics ("MD") simulations -- it requires, as input, one or more MD trajectories. Gromacs is one of the many software packages available for running MD simulations. So yes, to run an MD simulation you must install gromacs, or one of the other MD packages such as CHARMM, AMBER, OpenMM or others.
Thanks very much, i see,and i will try. Please forgive me that i'm a learner in the first stage,so i don't know much about it.
Thank all of you again for giving me these directions.
Okay. I'm going to close this issue now. It seems like it's been resolved.
It haves only one xtc file, that is .xtc(generated by Gromacs), then can i run MSMBuilder?For example,run ConvertDataToHDF.py -s my.pdb -i XTC
At 2013-05-07 10:49:00,"Robert McGibbon" notifications@github.com wrote:
You realize that you are dealing with the tutorial data, not your own protein, right? This line:
In [3]: traj["XYZList"].shape Out[3]: (501, 22, 3)
Indicates that the trajectory contains 501 frames and 22 atoms, which means that it's alanine dipeptide. Regardless, there is still some kind of issue going on. We are looking into it.
— Reply to this email directly or view it on GitHub.
First,I provide my info about my project: 1, it is a protein 2, there are 134 amino acids and 2184 atoms in my PDB file
my problem is the following:
I dont know where my fault is, and how do i know how many atoms in the trajectories? which file i need look at for it?