Difference between revisions of "File formats/Export"
AngelHerraez (talk | contribs) (update for write, write() and write coords) |
AngelHerraez (talk | contribs) (better display) |
||
Line 12: | Line 12: | ||
The syntax (see | The syntax (see | ||
− | [{{ScriptingDoc}}#writemodel reference documentation]) is | + | [{{ScriptingDoc}}#writemodel reference documentation]) is like this: |
− | |||
− | |||
− | |||
− | |||
− | + | {| class="wikitable" | |
− | + | |- | |
− | + | ! commands (synonymous) | |
− | + | ! export the currently selected set of atoms, | |
− | write v3000 myFile.myExt | + | with original coordinates, using this format: |
− | write sdf myFile.myExt | + | |- |
+ | | <pre>write myFile.xyz | ||
+ | write xyz myFile.myExt | ||
+ | write myFile.myExt as xyz</pre> | ||
+ | | {{file|xyz}} format | ||
+ | |- | ||
+ | | <pre>write myFile.pdb | ||
+ | write pdb myFile.myExt | ||
+ | write myFile.myExt as pdb</pre> | ||
+ | | {{file|pdb}} format | ||
+ | |- | ||
+ | | <pre>write myFile.mol | ||
+ | write mol myFile.myExt | ||
+ | write v2000 myFile.myExt | ||
+ | write myFile.myExt as mol | ||
+ | write myFile.myExt as v2000</pre> | ||
+ | | {{file|mol-v2000}} format | ||
+ | |- | ||
+ | | <pre>write v3000 myFile.myExt | ||
+ | write myFile.myExt as v3000</pre> | ||
+ | | {{file|mol-v3000}} format | ||
+ | |- | ||
+ | | <pre>write myFile.sdf | ||
+ | write sdf myFile.myExt | ||
+ | write myFile.myExt as sdf</pre> | ||
+ | | {{file|sdf-v2000}} format | ||
+ | |} | ||
+ | |||
+ | All of the above commands will save the original cooordinates of each atom as they were in the input file. | ||
− | + | There is also the choice (only in MOL format) of saving the '''modified coordinates''' as in the current state of the model: | |
− | + | {| class="wikitable" | |
− | + | |- | |
− | + | ! commands (synonymous) | |
− | + | ! export the currently selected set of atoms, | |
− | + | with modified coordinates, using this format: | |
− | + | |- | |
− | + | | <pre>write coord myFile.mol | |
− | + | write coord mol myFile.myExt</pre> | |
− | + | | {{file|mol-v2000}} format | |
− | + | |- | |
+ | | <pre>write coord v3000 myFile.myExt</pre> | ||
+ | | {{file|mol-v3000}} format | ||
+ | |} | ||
=== <code>write()</code> function === | === <code>write()</code> function === |
Revision as of 10:38, 11 December 2017
Contents
Exporting or saving molecular model files from Jmol
Although Jmol was designed as a viewer, it has now capabilities to save files for the displayed molecular model (or a subset of it).
write
command
Jmol can export the currently selected set of atoms to a file in
- XYZ format
- PDB format
- MOL v2000 format (single model)
- MOL v3000 format (single model)
- SDF v2000 format (single or multiple models)
The last 3 are according to the official format specification from MDL-Accelrys-Symyx.
The syntax (see reference documentation) is like this:
All of the above commands will save the original cooordinates of each atom as they were in the input file.
There is also the choice (only in MOL format) of saving the modified coordinates as in the current state of the model:
write()
function
This function in the Jmol Scripting Language allows to put in a variable data equivalent to what the write
command would save to a file.
First parameter in the function is the format, second if needed is some qualifier, both matching what would be used in the command.
Examples:
a = write("xyz") #incorrect, not implemented, does not work a = write("pdb") #incorrect, not implemented, does not work a = write("mol") #exports to MOL v2000, original untransformed coordinates a = write("v3000") #exports to MOL v3000, original untransformed coordinates a = write("coord") #exports to XYZ, original untransformed coordinates a = write("coord","mol") #exports to MOL v2000, transformed coordinates a = write("coord","v3000") #exports to MOL v3000, transformed coordinates
These are available:
File > Save > Save a copy of file
File > Save > Save as PNG/JMOL (image+zip)
File > Save > Save JVXL isosurface
File > Export > Export PNG+JMOL image
The 2nd and 4th are equivalent and contain, in compressed form, a snapshot PNG image, the coordinates file and the state script file.
Save isosurface
The pop-up menu entry will svae the last isosurface selected or generated. More flexibility is allowed by using the write isosurface
command.