Difference between revisions of "File formats/Export"
AngelHerraez (talk | contribs) (→show() chemical function) |
AngelHerraez (talk | contribs) m (preventing line breaks that may confuse reading the syntax) |
||
Line 34: | Line 34: | ||
write v2000 myFile.myExt | write v2000 myFile.myExt | ||
write myFile.myExt as mol | write myFile.myExt as mol | ||
− | write myFile.myExt as v2000</pre> | + | write myFile.myExt as v2000</pre> |
| {{file|mol-v2000}} format | | {{file|mol-v2000}} format | ||
|- | |- | ||
| <pre>write v3000 myFile.myExt | | <pre>write v3000 myFile.myExt | ||
− | write myFile.myExt as v3000</pre> | + | write myFile.myExt as v3000</pre> |
| {{file|mol-v3000}} format | | {{file|mol-v3000}} format | ||
|- | |- | ||
Line 69: | Line 69: | ||
| {{file|mol-v2000}} format | | {{file|mol-v2000}} format | ||
|- | |- | ||
− | | <pre>write coord v3000 myFile.myExt</pre> | + | | <pre>write coord v3000 myFile.myExt</pre> |
| {{file|mol-v3000}} format | | {{file|mol-v3000}} format | ||
|} | |} | ||
Line 98: | Line 98: | ||
| exports to {{file|xyz}} format, original untransformed coordinates | | exports to {{file|xyz}} format, original untransformed coordinates | ||
|- | |- | ||
− | | <pre>a = write("coord","mol")</pre> | + | | <pre>a = write("coord","mol")</pre> |
| exports transformed coordinates to {{file|mol-v2000}} or {{file|mol-v3000}} format, respectively | | exports transformed coordinates to {{file|mol-v2000}} or {{file|mol-v3000}} format, respectively | ||
|- | |- |
Revision as of 16:07, 9 March 2021
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 transformed coordinates as they are in the current state of the model:
write()
function
This function in the Jmol Scripting Language allows to place the output of the write command into a variable, rather than saving to a file. The data can later be loaded using load var a
.
See also show()
below, as an alternative.
First parameter in the function is the format, second if needed is some qualifier, both matching what would be used in the command.
Common examples:
show() chemical
function
The same information that would be exported to a file may be put into a variable using this function. It uses the NCI CACTVS Resolver web service for format conversion, and hence it needs a live internet connection to work.
- Available since Jmol version 14.6.0
- Note: If only a subset of the full model has been selected, only that subset will be included in the exported model. Since the procedure involves a query to the Resolver, and their server tries to interpret it as a full molecule, the result may then not be what you expect. Example:
select _N; show("chemical mol")
returns mol-formatted data for ammonia, no matter which was the original molecule containing several N atoms.
Formats available are:
alc
|
Alchemy (Tripos) | cdxml
|
XML-compliant version of ChemDraw's native file format | cerius
|
Cerius II from Accelrys/MSI |
---|---|---|---|---|---|
charmm
|
CHARMM (Chemistry at HARvard Macromolecular Mechanics) | cif
|
Crystallographic Information File | cml
|
Chemical Markup Language |
ctx
|
Gasteiger group | gjf
|
Gaussian input | gromacs
|
GROMACS |
hyperchem
|
HIV / HIN format from Hyperchem | jme
|
from the JME/JSME Molecular Editor | maestro
|
from Schrödinger |
mol
|
Symyx MDL | mol2
|
Sybyl, Tripos | sybyl2
|
Sybyl, Tripos |
mrv
|
Marvin format, from ChemAxon | pdb
|
from Protein DataBank, but nonstandard | sdf
|
Symyx MDL |
sdf3000
|
Symyx MDL, V3000 | sln
|
SYBYL Line Notation | smiles
|
SMILES string |
xyz
|
the traditional XYZ format |
The syntax is like this:
d = show("chemical xyz") d = show("chemical mol") d = show("chemical hyperchem")
etc.
The result (text string as the value of the variable) may then be displayed, processed, or even may be written to a file using
write var d myFile.hin
. In this way, Jmol is in fact exporting file formats that it cannot export natively, by using the format conversion server at NCI.
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, packed in a single file, 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.