|
SOLUTIONS
|
MATHEMATICA IMPORT/EXPORT FORMAT
MOL2 (.mol2)
MIME type: chemical/x-mol2
Tripos MOL2 molecule model files.
Used in cheminformatics applications and on the web for storing and exchanging 3D molecule models.
Native format of the SYBYL cheminformatics application.
Plain text tabular format.
Represents a single chemical compound or multiple chemical compounds.
Stores atomic coordinates, chemical bond information, and metadata.
Tripos MOL2 molecule model files.
Used in cheminformatics applications and on the web for storing and exchanging 3D molecule models.
Native format of the SYBYL cheminformatics application.
Plain text tabular format.
Represents a single chemical compound or multiple chemical compounds.
Stores atomic coordinates, chemical bond information, and metadata.
Import and ExportImport and Export
- Import["file.mol2"] imports a list of molecule models or structure diagrams from a MOL2 file.
- Export["file.mol2", expr] exports elements of molecule models to a MOL2 file.
- Import["file.mol2"] gives a list of Graphics3D objects when reading 3D molecule models, and vector graphics when importing a planar representation of molecules.
- Import["file.mol2", elem] imports the specified element from a MOL2 file.
- Import["file.mol2", {elem, suba, subb, ...}] imports a subelement.
- Import["file.mol2", {{elem1, elem2, ...}}] imports multiple elements.
- The import format can be specified with Import["file", "MOL2"] or Import["file", {"MOL2", elem, ...}].
- Export["file.mol2", expr, elem] creates a MOL2 file by treating expr as specifying element elem.
- Export["file.mol2", {expr1, expr2, ...}, {{elem1, elem2, ...}}] treats each
as specifying the corresponding
. - Export["file.mol2", expr, opt1->val1, ...] exports expr with the specified option elements taken to have the specified values.
- Export["file.mol2", {elem1->expr1, elem2->expr2, ...}, "Rules"] uses rules to specify the elements to be exported.
- See the reference pages for full general information on Import and Export.
- ImportString and ExportString support the MOL2 format.
ElementsElements
- General Import elements:
-
"Elements" list of elements and options available in this file "Rules" full list of rules for each element and option "Options" list of rules for options, properties, and settings - Graphics elements:
-
"Graphics3D" 3D renderings of all molecule models stored in the file "Graphics3D", n 3D renderings of the n
molecule"StructureDiagram" 2D structure formula of all molecule models - Import by default uses the
element if the file represents a 3D model and
for planar compounds. - Data representation elements:
-
"EdgeRules" connectivity data, given as a list of lists of rules "EdgeTypes" bond types, given as a list of lists of strings "VertexCoordinates" atomic coordinates, typically given in picometers "VertexTypes" all atoms or groups constituting the molecule, typically given as a list of chemical element abbreviations "PartialCharges" electric charges of the atoms given as a list of reals "Residues" residue sequences, given as a list of lists of three-letter abbreviations "Sequence" residue sequences given as a list of strings "ResidueAtoms" list of lists of residue atoms "ResidueCoordinates" 3D coordinates of residue atoms "ResidueCharges" charges of the atoms given by 
- Export["file.mol2", {vert, coord}, {{"ResidueAtoms", "ResidueCoordinates"}}] creates a MOL2 file from a specification of atom types and their 2D or 3D coordinates.
OptionsOptions
- General Import options:
-
ImageSize Automatic specifies the overall size of the graphics to display Background White specifies what background color to use ViewPoint Automatic point in space from which the 3D model is to be viewed - With the default setting "ViewPoint"->Automatic, Mathematica automatically calculates the optimal viewing angle for the imported molecule geometry.
- Select a 3D rendering style:
-
"Rendering" "BallAndStick" specifies the visualization method - Possible settings for
are: -
"BallAndStick" displays atoms and bonds as a ball-and-stick model "Spacefilling" atoms shown as overlapping spheres "Wireframe" bonds rendered as lines
ExamplesExamplesopen allclose all
Basic Examples (2)Basic Examples (2)
Import a MOL2 file as a three-dimensional ball-and-stick model:
| In[1]:= |
| Out[1]= | ![]() |
Show the Import elements available in a MOL2 file:
| In[2]:= |
| Out[2]= | ![]() |
This gives a list of atoms that constitute a molecule:
| In[3]:= |
| Out[3]= |
| In[4]:= |
| Out[4]= | ![]() |
Import the molecule and render it as a structure diagram:
| In[5]:= |
| Out[5]= |
This gives the residue atom types and their 3D coordinates for all molecules in this file:
| In[1]:= |
| Out[1]= | ![]() |
This creates a MOL2 file from the previous output (the default value for the residue name is "Unk", the default atom charge is 0):
| In[2]:= |
| Out[2]= | ![]() |
New in 7
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »





