Tripos MOL2 file reader
Added in version 3.15.5.
For loading molecular structures stored in the Tripos MOL2 format. This section-based text format is widely used in computational drug discovery, molecular docking, and molecular modeling tools such as DOCK, AutoDock, OpenEye OEChem, and the SYBYL software family. OVITO can directly load gzipped MOL2 files (“.gz” suffix).
The file reader processes the following @<TRIPOS> sections:
@<TRIPOS>MOLECULEThe molecule name, molecule type, and charge type are read and stored as global attributes named
MOL2.Molecule,MOL2.MoleculeType, andMOL2.ChargeType.@<TRIPOS>ATOMReads all atoms and the following per-atom data:
Position (x, y, z)
Particle Type — the chemical element symbol derived from the SYBYL atom type (the prefix before the
.separator, e.g.CfromC.ar,NfromN.am). OVITO assigns the standard CPK color for the element.Hybridization State — the full SYBYL atom type string (e.g.
C.3,C.ar,N.am), stored as a typed particle property.Particle Identifier — the atom serial number from the file.
Atom Name — the per-residue atom name (e.g.
CA,N,CD).Molecule Identifier — the substructure (residue/chain) integer ID, if present.
Molecule Type — the substructure name (e.g.
PRO1,LIG), if present.Charge — the partial charge value, if the charge type is not
NO_CHARGES.
@<TRIPOS>BONDReads all bonds and creates the following per-bond properties:
Bond Type — named types Single, Double, Triple, Aromatic, Amide, Dummy, Unknown, and Not Connected, corresponding to the MOL2 bond-type codes
1,2,3,ar/4,am,du,un, andnc.Bond Order — a numeric bond order value derived from the bond type: single→1.0, double→2.0, triple→3.0, aromatic/amide→1.5, others→1.0. This property is used by the Bonds visual element to render double/triple bonds as parallel cylinders and aromatic bonds as dashed cylinders.
@<TRIPOS>CRYSINIf present, reads the crystallographic unit cell parameters (a, b, c, α, β, γ) and converts them to a triclinic simulation cell with periodic boundary conditions enabled in all three directions. If this record is absent, an axis-aligned bounding box may be generated instead (see Generate bounding box if needed option below).
A MOL2 file may contain multiple molecule records (multiple @<TRIPOS>MOLECULE sections);
OVITO will load them as individual animation frames.
All other @<TRIPOS> sections (e.g. @<TRIPOS>SUBSTRUCTURE, @<TRIPOS>UNITY_ATOM_ATTR)
are silently skipped.
Options
- Generate bounding box if needed
If this option is enabled and the MOL2 file does not contain a
@<TRIPOS>CRYSINrecord, OVITO will generate an axis-aligned bounding box enclosing all atoms. This bounding box has open boundary conditions and serves as an approximate simulation cell.- Center simulation cell on coordinate origin
If enabled, OVITO shifts the simulation cell and all atom coordinates so that the geometric center of the cell coincides with the coordinate origin.
Python parameters
The file reader accepts the following optional keyword parameters in a call to the import_file() or load() Python functions.
- import_file(location, bounding_box=False, centering=False)
- Parameters:
bounding_box (bool) – Generate an ad-hoc simulation cell as a bounding box around the imported atoms when the file contains no
@<TRIPOS>CRYSINrecord.centering (bool) – Translate atom coordinates and simulation cell to center them at the coordinate origin.