Difference between revisions of "Load"

From PyMOLWiki
Jump to: navigation, search
(DESCRIPTION)
(NOTES)
Line 15: Line 15:
  
 
===NOTES===
 
===NOTES===
You can override the file extension by giving a format string:
+
*You can override the file extension by giving a format string:
 
   
 
   
 
  'pdb' : PDB,  'mmod' : Macromodel, 'xyz' : Tinker, 'cc1' : ChemDraw3D   
 
  'pdb' : PDB,  'mmod' : Macromodel, 'xyz' : Tinker, 'cc1' : ChemDraw3D   
Line 28: Line 28:
 
  'pqr' : PQR (a modified PDB file with charges and radii)
 
  'pqr' : PQR (a modified PDB file with charges and radii)
 
  'mol2' : MOL2
 
  'mol2' : MOL2
 +
 +
* A new feature has been added to load.  You can specify an URL to a PDB and PyMOL will download it.  This is a very handy feature for loading experimental/theoretical data from servers across the web.  Just copy the link they give you and do,
 +
<source lang="python">
 +
load http://www.theurl.com/path/toYourData
 +
</source>
 +
or you can open a remote file just from the command line
 +
<source lang="bash">
 +
# load a PDB file; I placed one example file on the PyMOL Wiki
 +
pymol http://www.pymolwiki.org/1rsy.pdb
 +
 +
# PyMOL can also handle the gzipped files on the PDB.  :-)
 +
pymol ftp://ftp.wwpdb.org/pub/pdb/data/structures/divided/pdb/00/pdb100d.ent.gz
 +
</source>
  
 
===User Comments/Examples===
 
===User Comments/Examples===

Revision as of 15:22, 23 March 2009

DESCRIPTION

load reads several file formats. The file extension is used to determine the format. PDB files must end in ".pdb", MOL files must end in ".mol", Macromodel files must end in ".mmod", XPLOR maps must end in ".xplor", CCP4 maps must end in ".ccp4", Raster3D input (Molscript output) must end in ".r3d", PyMOL session files must end in ".pse", and pickled ChemPy models with a ".pkl" can also be directly read.

If an object is specified, then the file is loaded into that object. Otherwise, an object is created with the same name as the file prefix.

USAGE

load filename [,object [,state [,format [,finish [,discrete [,multiplex ]]]]]]

PYMOL API

cmd.load( filename [,object [,state [,format [,finish [,discrete [,multiplex ]]]]]] )

NOTES

  • You can override the file extension by giving a format string:
'pdb' : PDB,  'mmod' : Macromodel, 'xyz' : Tinker, 'cc1' : ChemDraw3D  
'mol' : MDL MOL-file, 'sdf' : MDL SD-file
'xplor' : X-PLOR/CNS map, 'ccp4' : CCP4 map,
'callback' : PyMOL Callback object (PyOpenGL)
'cgo' : compressed graphics object (list of floats)
'trj' : AMBER trajectory (use load_traj command for more control)
'top' : AMBER topology file 'rst' : AMBER restart file
'cex' : Metaphorics CEX format
'pse' : PyMOL Session file
'pqr' : PQR (a modified PDB file with charges and radii)
'mol2' : MOL2
  • A new feature has been added to load. You can specify an URL to a PDB and PyMOL will download it. This is a very handy feature for loading experimental/theoretical data from servers across the web. Just copy the link they give you and do,
load http://www.theurl.com/path/toYourData

or you can open a remote file just from the command line

# load a PDB file; I placed one example file on the PyMOL Wiki
pymol http://www.pymolwiki.org/1rsy.pdb

# PyMOL can also handle the gzipped files on the PDB.  :-)
pymol ftp://ftp.wwpdb.org/pub/pdb/data/structures/divided/pdb/00/pdb100d.ent.gz

User Comments/Examples

  • Load xyz.pdb using the PyMOL API:
cmd.load("xyz.pdb")
  • Loading multiple PDBs into one object with many states:
load trj0001.pdb, mov
load trj0002.pdb, mov
load trj0003.pdb, mov
etc.

or, if you have too many states to do that by hand,

for idx in range(1,1001):cmd.load("trj%04d.pdb"%idx,"mov")

or, you can use "glob" from Python,

from glob import glob
lst = glob("trj*.pdb")
lst.sort()
for fil in lst: cmd.load(fil,"mov")
  • Load a NAMD multi-PDB file. These are just concatenated PDB files.
load NAMDtrajFile.pdb, multiplex=0

SEE ALSO

Save Load Traj