This is a read-only mirror of pymolwiki.org

Difference between revisions of "Save"

From PyMOL Wiki
Jump to navigation Jump to search
m (1 revision)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
===DESCRIPTION===
+
'''save''' writes selected atoms to a file.   
'''save''' writes selected atoms to a file.  The file format is
 
autodetected if the extesion is ".pdb", ".pse", ".mol", ".mmod", or
 
".pkl"
 
 
Note that if the file extension ends in ".pse" (PyMOL Session), the
 
complete PyMOL state is always saved to the file (the selection and
 
state parameters are thus ignored).
 
  
If aligning two structures
+
=Details=
<source lang="python">
+
* The file format is autodetected if the extension is .pdb, .pqr, .mol, .sdf, .pkl, .pkla, .mmd, .out, .dat, .mmod, .pmo, .pov, .png, .pse, .psw, .aln, .fasta, .obj, .mtl, .wrl, .idtf, .dae, or .mol2.
align proteinA, proteinB, object=A_on_B
+
* If the file extension is ".pse" (PyMOL Session), the complete PyMOL state is always saved to the file (the selection and state parameters are thus ignored).
 +
* CLUSTALW formatted alignments can be written by PyMOL as well. Once you perform an alignment like the following,
 +
::<source lang="python">
 +
align proteinA, proteinB, object=A_on_B
 
</source>
 
</source>
a clustal formatted alignment file can be written
+
::the alignment can be written using:
<source lang="python">
+
::<source lang="python">
 
save A_aligned_with_B.aln, A_on_B
 
save A_aligned_with_B.aln, A_on_B
 
</source>
 
</source>
Line 21: Line 17:
 
save file [,(selection) [,state [,format]] ]
 
save file [,(selection) [,state [,format]] ]
 
</source>
 
</source>
 +
 +
=== EXAMPLES ===
 +
<source lang="python">
 +
# save only the alpha carbons
 +
save onlyCAs.pdb, n. CA
 +
 +
# save my MD trajectory file to disk
 +
save myTraj.pdb, myMDTrajectory, state=0
 +
 +
# save a PyMOL session
 +
save thisSession.pse
 +
</source>
 +
 
===PYMOL API===
 
===PYMOL API===
 
<source lang="python">
 
<source lang="python">
cmd.save(file, selection, state, format)
+
cmd.save(filename[, selection[, state[, format]]])
 
</source>
 
</source>
  
 
===NOTES===
 
===NOTES===
 
* When saving a session file, then "state" has no effect.
 
* When saving a session file, then "state" has no effect.
* When state = 0 (default), only the current state is written.
+
* Default is state = -1, which saves only the current state.
* When state = -1, then a multi-state output file is written (PDB only).
+
* When state = 0, all states in the file are written. If you have more than one state, this produces a multi-state PDB file.
  
* In versions 1.XX, a multi-state output file is written when state = 0 (which is not default)
 
 
===SEE ALSO===
 
===SEE ALSO===
  [[Load]], [[Get Model]]
+
[[Load]], [[Get Model]]
  
 
[[Category:Commands|Save]]
 
[[Category:Commands|Save]]
 
[[Category:States|Save]]
 
[[Category:States|Save]]
 
[[Category:Input Output Module|Save]]
 
[[Category:Input Output Module|Save]]

Latest revision as of 00:07, 17 October 2016

save writes selected atoms to a file.

Details

  • The file format is autodetected if the extension is .pdb, .pqr, .mol, .sdf, .pkl, .pkla, .mmd, .out, .dat, .mmod, .pmo, .pov, .png, .pse, .psw, .aln, .fasta, .obj, .mtl, .wrl, .idtf, .dae, or .mol2.
  • If the file extension is ".pse" (PyMOL Session), the complete PyMOL state is always saved to the file (the selection and state parameters are thus ignored).
  • CLUSTALW formatted alignments can be written by PyMOL as well. Once you perform an alignment like the following,
align proteinA, proteinB, object=A_on_B
the alignment can be written using:
save A_aligned_with_B.aln, A_on_B

USAGE

save file [,(selection) [,state [,format]] ]

EXAMPLES

# save only the alpha carbons
save onlyCAs.pdb, n. CA

# save my MD trajectory file to disk
save myTraj.pdb, myMDTrajectory, state=0

# save a PyMOL session
save thisSession.pse

PYMOL API

cmd.save(filename[, selection[, state[, format]]])

NOTES

  • When saving a session file, then "state" has no effect.
  • Default is state = -1, which saves only the current state.
  • When state = 0, all states in the file are written. If you have more than one state, this produces a multi-state PDB file.

SEE ALSO

Load, Get Model