This is a read-only mirror of pymolwiki.org

Difference between revisions of "Load Traj"

From PyMOL Wiki
Jump to navigation Jump to search
m (1 revision)
 
(12 intermediate revisions by 7 users not shown)
Line 1: Line 1:
===DESCRIPTION===
+
'''load_traj''' loads a trajectory as "states" into an already loaded molecular object.
'''load_traj''' reads trajectory files (currently just AMBER files).  The file extension is used to determine the format.  AMBER files must end in ".trj"
 
  
In newer builds of PyMOL (namely, version 1.0 or newer), several additional formats are accepted. CHARMM trajectories (".dcd") are also valid files and only require a structure to be loaded first while the trajectory file gets loaded as sequential states into the associated object.  However, it should be noted that, unless the [[defer_builds_mode]] is set (to 3), loading a large trajectory may take up a lot of RAM.
+
Since version 1.0, PyMOL uses the [http://www.ks.uiuc.edu/Research/vmd/plugins/molfile/ Molfile Plugin] backend, which supports a variety of trajectory file formats. Older versions only supported the ascii AMBER format (".trj" file extension).
 +
 
 +
Loading a large trajectory may take up a lot of RAM, unless the [[defer_builds_mode]] is set to 3.
 +
 
 +
== Usage ==
  
===USAGE===
 
 
<source lang="python">
 
<source lang="python">
 
load_traj filename [,object [,state [,format [,interval [,average ]
 
load_traj filename [,object [,state [,format [,interval [,average ]
 
                   [,start [,stop [,max [,selection [,image [,shift  
 
                   [,start [,stop [,max [,selection [,image [,shift  
 +
                  [, plugin ]
 
                   ]]]]]]]]]
 
                   ]]]]]]]]]
 
</source>
 
</source>
  
===PYMOL API===
+
== Arguments ==
<source lang="python">
+
 
cmd.load_traj(filename,object='',state=0,format='',interval=1,
+
* '''filename''' = str: trajectory file path
          average=1,start=1,stop=-1,max=-1,selection='all',image=1,
+
* '''object''' = str: name of the molecular object where the trajectory should be appended as states {default: guess from filename}
          shift="[0.0,0.0,0.0]")
+
* '''state''' = int: object state where to start appending states. To discard the currently loaded coordinates, use ''state=1''. To append new states, use ''state=0'' {default: 0}
</source>
+
* '''format''' = str: specify file type instead of guessing from file extension (only affects AMBER .trj format, use "plugin" argument for Molfile Plugin types) {default: }
 +
 
 +
== Examples ==
 +
 
 +
<syntaxhighlight lang="python">
 +
# topology from PDB file, trajectory from DCD file
 +
load      sampletrajectory.pdb
 +
load_traj sampletrajectory.dcd
 +
 
 +
# gromacs trajectory, using "mytraj" as object name
 +
load      sampletrajectory.gro, mytraj
 +
load_traj sampletrajectory.xtc, mytraj
 +
 
 +
# desmond trajectory
 +
load      sample-out.cms, mytraj
 +
load_traj sample_trj/clickme.dtr, mytraj
 +
 
 +
# playing through states, memory optimized (but eventually slower)
 +
set defer_builds_mode, 3
 +
mplay
 +
</syntaxhighlight>
  
===NOTES===
+
== Notes ==
*You must first load a corresponding topology file before attempting to load a trajectory file.
+
*PyMOL does not know how to wrap the truncated octahedron used by Amber You will need to use the [http://ambermd.org/tutorials/analysis/tutorial0/index.htm cpptraj] program first to do this.
*PyMOL does not know how to wrap the truncated octahedron used by Amber You will need to use the [http://amber.scripps.edu/tutorials/basic/tutorial5/index.html ptraj] program first to do this.
 
 
*The average option is not a running average.  To perform this type of average, use the [[smooth]] command after loading the trajectory file.
 
*The average option is not a running average.  To perform this type of average, use the [[smooth]] command after loading the trajectory file.
 
*For quickly viewing Trajectories as a movie, use the [[mset]] command to map each state to a movie frame.
 
*For quickly viewing Trajectories as a movie, use the [[mset]] command to map each state to a movie frame.
  
===SEE ALSO===
+
useful notes from the email list:
 +
<br/>
 +
http://www.mail-archive.com/pymol-users@lists.sourceforge.net/msg04272.html
 +
<br/>
 +
http://www.mail-archive.com/pymol-users@lists.sourceforge.net/msg10266.html
 +
 
 +
in one line convert dcd and psf to pdb :
 +
 
 +
catdcd -o all.pdb -otype pdb -s autopsf.psf -stype psf out.dcd
 +
 
 +
== See Also ==
 
[[Load]], [[defer_builds_mode]]
 
[[Load]], [[defer_builds_mode]]
  

Latest revision as of 03:14, 5 March 2018

load_traj loads a trajectory as "states" into an already loaded molecular object.

Since version 1.0, PyMOL uses the Molfile Plugin backend, which supports a variety of trajectory file formats. Older versions only supported the ascii AMBER format (".trj" file extension).

Loading a large trajectory may take up a lot of RAM, unless the defer_builds_mode is set to 3.

Usage

load_traj filename [,object [,state [,format [,interval [,average ]
                   [,start [,stop [,max [,selection [,image [,shift 
                   [, plugin ]
                   ]]]]]]]]]

Arguments

  • filename = str: trajectory file path
  • object = str: name of the molecular object where the trajectory should be appended as states {default: guess from filename}
  • state = int: object state where to start appending states. To discard the currently loaded coordinates, use state=1. To append new states, use state=0 {default: 0}
  • format = str: specify file type instead of guessing from file extension (only affects AMBER .trj format, use "plugin" argument for Molfile Plugin types) {default: }

Examples

# topology from PDB file, trajectory from DCD file
load      sampletrajectory.pdb
load_traj sampletrajectory.dcd

# gromacs trajectory, using "mytraj" as object name
load      sampletrajectory.gro, mytraj
load_traj sampletrajectory.xtc, mytraj

# desmond trajectory
load      sample-out.cms, mytraj
load_traj sample_trj/clickme.dtr, mytraj

# playing through states, memory optimized (but eventually slower)
set defer_builds_mode, 3
mplay

Notes

  • PyMOL does not know how to wrap the truncated octahedron used by Amber You will need to use the cpptraj program first to do this.
  • The average option is not a running average. To perform this type of average, use the smooth command after loading the trajectory file.
  • For quickly viewing Trajectories as a movie, use the mset command to map each state to a movie frame.

useful notes from the email list:
http://www.mail-archive.com/pymol-users@lists.sourceforge.net/msg04272.html
http://www.mail-archive.com/pymol-users@lists.sourceforge.net/msg10266.html

in one line convert dcd and psf to pdb :

catdcd -o all.pdb -otype pdb -s autopsf.psf -stype psf out.dcd

See Also

Load, defer_builds_mode