<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pymol.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MartinHediger</id>
	<title>PyMOL Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MartinHediger"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php/Special:Contributions/MartinHediger"/>
	<updated>2026-04-24T10:24:46Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Load&amp;diff=12608</id>
		<title>Load</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Load&amp;diff=12608"/>
		<updated>2012-01-23T15:17:52Z</updated>

		<summary type="html">&lt;p&gt;MartinHediger: /* User Comments/Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
'''load''' reads several file formats.  The file extension is used to determine the format.  PDB files must end in &amp;quot;.pdb&amp;quot;, MOL files must end in &amp;quot;.mol&amp;quot;, Macromodel files must end in &amp;quot;.mmod&amp;quot;, XPLOR maps must end in &amp;quot;.xplor&amp;quot;, CCP4 maps must end in &amp;quot;.ccp4&amp;quot;, Raster3D input (Molscript output) must end in  &amp;quot;.r3d&amp;quot;, PyMOL session files must end in &amp;quot;.pse&amp;quot;, and pickled ChemPy models with a &amp;quot;.pkl&amp;quot; can also be directly read.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===USAGE===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
load filename [,object [,state [,format [,finish [,discrete [,multiplex ]]]]]]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PYMOL API===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
cmd.load( filename [,object [,state [,format [,finish [,discrete [,multiplex ]]]]]] )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===NOTES===&lt;br /&gt;
*You can override the file extension by giving a format string:&lt;br /&gt;
 &lt;br /&gt;
 'pdb' : PDB,  'mmod' : Macromodel, 'xyz' : Tinker, 'cc1' : ChemDraw3D  &lt;br /&gt;
 'mol' : MDL MOL-file, 'sdf' : MDL SD-file&lt;br /&gt;
 'xplor' : X-PLOR/CNS map, 'ccp4' : CCP4 map,&lt;br /&gt;
 'callback' : PyMOL Callback object (PyOpenGL)&lt;br /&gt;
 'cgo' : compressed graphics object (list of floats)&lt;br /&gt;
 'trj' : AMBER trajectory (use load_traj command for more control)&lt;br /&gt;
 'top' : AMBER topology file 'rst' : AMBER restart file&lt;br /&gt;
 'cex' : Metaphorics CEX format&lt;br /&gt;
 'pse' : PyMOL Session file&lt;br /&gt;
 'pqr' : PQR (a modified PDB file with charges and radii)&lt;br /&gt;
 'mol2' : MOL2&lt;br /&gt;
&lt;br /&gt;
* 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,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
load http://www.theurl.com/path/toYourData&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or you can open a remote file just from the command line&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# load a PDB file; I placed one example file on the PyMOL Wiki&lt;br /&gt;
pymol http://www.pymolwiki.org/1rsy.pdb&lt;br /&gt;
&lt;br /&gt;
# PyMOL can also handle the gzipped files on the PDB.  :-)&lt;br /&gt;
pymol ftp://ftp.wwpdb.org/pub/pdb/data/structures/divided/pdb/00/pdb100d.ent.gz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===User Comments/Examples===&lt;br /&gt;
*Load xyz.pdb using the PyMOL API:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
cmd.load(&amp;quot;xyz.pdb&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Loading multiple PDBs into one object with many states:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
load trj0001.pdb, mov&lt;br /&gt;
load trj0002.pdb, mov&lt;br /&gt;
load trj0003.pdb, mov&lt;br /&gt;
etc.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or, if you have too many states to do that by hand,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
for idx in range(1,1001):cmd.load(&amp;quot;trj%04d.pdb&amp;quot;%idx,&amp;quot;mov&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or, you can use &amp;quot;glob&amp;quot; from Python,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from glob import glob&lt;br /&gt;
lst = glob(&amp;quot;trj*.pdb&amp;quot;)&lt;br /&gt;
lst.sort()&lt;br /&gt;
for fil in lst: cmd.load(fil,&amp;quot;mov&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Load a NAMD multi-PDB file.  These are just concatenated PDB files.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
load NAMDtrajFile.pdb, multiplex=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Hint: You can save some time &amp;amp; a lot of memory by loading the file and removing the atoms in a single-line compound statement (with a semicolon&lt;br /&gt;
after the load statement).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
load 1E3M.pdb; remove not A-C+F//&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Decorating the load command to include technical info about the loaded object&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def load_with_props(fileName, objName):&lt;br /&gt;
  # store whatever info you want, like the filename&lt;br /&gt;
  obj_info[objName] = fileName&lt;br /&gt;
  # ... do more recording of properties you choose&lt;br /&gt;
  # ask PyMOL to now load the file&lt;br /&gt;
  cmd.load(fileName,objName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Then on can query obj_info based on the object name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
for obj in cmd.get_names():&lt;br /&gt;
  print obj_info[obj]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SEE ALSO===&lt;br /&gt;
[[Save]] [[Load Traj]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Commands|Load]]&lt;br /&gt;
[[Category:States|Load]]&lt;br /&gt;
[[Category:Input Output Module|Load]]&lt;/div&gt;</summary>
		<author><name>MartinHediger</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Load&amp;diff=12607</id>
		<title>Load</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Load&amp;diff=12607"/>
		<updated>2012-01-23T15:17:20Z</updated>

		<summary type="html">&lt;p&gt;MartinHediger: /* User Comments/Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
'''load''' reads several file formats.  The file extension is used to determine the format.  PDB files must end in &amp;quot;.pdb&amp;quot;, MOL files must end in &amp;quot;.mol&amp;quot;, Macromodel files must end in &amp;quot;.mmod&amp;quot;, XPLOR maps must end in &amp;quot;.xplor&amp;quot;, CCP4 maps must end in &amp;quot;.ccp4&amp;quot;, Raster3D input (Molscript output) must end in  &amp;quot;.r3d&amp;quot;, PyMOL session files must end in &amp;quot;.pse&amp;quot;, and pickled ChemPy models with a &amp;quot;.pkl&amp;quot; can also be directly read.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===USAGE===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
load filename [,object [,state [,format [,finish [,discrete [,multiplex ]]]]]]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PYMOL API===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
cmd.load( filename [,object [,state [,format [,finish [,discrete [,multiplex ]]]]]] )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===NOTES===&lt;br /&gt;
*You can override the file extension by giving a format string:&lt;br /&gt;
 &lt;br /&gt;
 'pdb' : PDB,  'mmod' : Macromodel, 'xyz' : Tinker, 'cc1' : ChemDraw3D  &lt;br /&gt;
 'mol' : MDL MOL-file, 'sdf' : MDL SD-file&lt;br /&gt;
 'xplor' : X-PLOR/CNS map, 'ccp4' : CCP4 map,&lt;br /&gt;
 'callback' : PyMOL Callback object (PyOpenGL)&lt;br /&gt;
 'cgo' : compressed graphics object (list of floats)&lt;br /&gt;
 'trj' : AMBER trajectory (use load_traj command for more control)&lt;br /&gt;
 'top' : AMBER topology file 'rst' : AMBER restart file&lt;br /&gt;
 'cex' : Metaphorics CEX format&lt;br /&gt;
 'pse' : PyMOL Session file&lt;br /&gt;
 'pqr' : PQR (a modified PDB file with charges and radii)&lt;br /&gt;
 'mol2' : MOL2&lt;br /&gt;
&lt;br /&gt;
* 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,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
load http://www.theurl.com/path/toYourData&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or you can open a remote file just from the command line&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# load a PDB file; I placed one example file on the PyMOL Wiki&lt;br /&gt;
pymol http://www.pymolwiki.org/1rsy.pdb&lt;br /&gt;
&lt;br /&gt;
# PyMOL can also handle the gzipped files on the PDB.  :-)&lt;br /&gt;
pymol ftp://ftp.wwpdb.org/pub/pdb/data/structures/divided/pdb/00/pdb100d.ent.gz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===User Comments/Examples===&lt;br /&gt;
*Load xyz.pdb using the PyMOL API:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
cmd.load(&amp;quot;xyz.pdb&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Loading multiple PDBs into one object with many states:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
load trj0001.pdb, mov&lt;br /&gt;
load trj0002.pdb, mov&lt;br /&gt;
load trj0003.pdb, mov&lt;br /&gt;
etc.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or, if you have too many states to do that by hand,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
for idx in range(1,1001):cmd.load(&amp;quot;trj%04d.pdb&amp;quot;%idx,&amp;quot;mov&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or, you can use &amp;quot;glob&amp;quot; from Python,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from glob import glob&lt;br /&gt;
lst = glob(&amp;quot;trj*.pdb&amp;quot;)&lt;br /&gt;
lst.sort()&lt;br /&gt;
for fil in lst: cmd.load(fil,&amp;quot;mov&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Load a NAMD multi-PDB file.  These are just concatenated PDB files.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
load NAMDtrajFile.pdb, multiplex=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Hint: You can save some time &amp;amp; a lot of memory by loading the file and removing the atoms in a single-line compound statement (with a semicolon&lt;br /&gt;
after the load statement).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
load 1E3M.pdb; remove not A-C+F//&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Decorating the load command to include technical info about the loaded object&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
def load_with_props(fileName, objName):&lt;br /&gt;
  # store whatever info you want, like the filename&lt;br /&gt;
  obj_info[objName] = fileName&lt;br /&gt;
  # ... do more recording of properties you choose&lt;br /&gt;
  # ask PyMOL to now load the file&lt;br /&gt;
  cmd.load(fileName,objName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Then on can query obj_info based on the object name:&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
for obj in cmd.get_names():&lt;br /&gt;
  print obj_info[obj]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SEE ALSO===&lt;br /&gt;
[[Save]] [[Load Traj]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Commands|Load]]&lt;br /&gt;
[[Category:States|Load]]&lt;br /&gt;
[[Category:Input Output Module|Load]]&lt;/div&gt;</summary>
		<author><name>MartinHediger</name></author>
	</entry>
</feed>