Getting Started

QMzyme is a Python toolkit aimed at facilitating QM-based calculations. To begin with the QM calculation setup, we need to first set the structure file. Currently, QMzyme supports PDB, prmtop, RST, PQR, and DCD file formats.

In this example, you will see how you can initialize the QMzyme GenerateModel module in various ways, using the pre-packaged QMzyme data and how these loaded structure files can be used!

Classes used in this example

[2]:
# To start with, we'll import the necesary packages.
import QMzyme
import os

Initialize Model

After importing QMzyme, we need to initialize QMzymeModel by providing a structure file. The GenerateModel class can be initialized in any way that an MDAnalysis Universe can be initialized. Here are some ways to initialize QMzymeModel!

[3]:
#1. With a PDB file:

from QMzyme.data import PDB
print("File: ", os.path.basename(PDB))
pdb_model = QMzyme.GenerateModel(PDB)
print("GenerateModel instance: ", pdb_model)
File:  1oh0.pdb

Charge information not present. QMzyme will try to guess region charges based on residue names consistent with AMBER naming conventions (i.e., aspartate: ASP --> Charge: -1, aspartic acid: ASH --> Charge: 0.). See QMzyme.data.residue_charges for the full set.

        Nonconventional Residues Found
        ------------------------------
        EQU --> Charge: UNK, defaulting to 0

You can update charge information for nonconventional residues by running
        >>>QMzyme.data.residue_charges.update({'3LETTER_RESNAME':INTEGER_CHARGE}).
Note your changes will not be stored after you exit your session. It is recommended to only alter the residue_charges dictionary. If you alter the protein_residues dictionary instead that could cause unintended bugs in other modules (TruncationSchemes).

GenerateModel instance:  <QMzymeModel built from <Universe with 4258 atoms> contains 0 region(s)>
[4]:
#2. With a topology file (.prmtop) and a restart file (.rst7) used in an AMBER MM simulation setup.
#   The contained structure inclues the water box, so there are many atoms!

from QMzyme.data import TOP, RST
print("Files: ", os.path.basename(TOP), os.path.basename(RST))
top_rst_model = QMzyme.GenerateModel(TOP, RST, format='RESTRT')
print("GenerateModel instance: ", top_rst_model)
Files:  1oh0_equ.prmtop 1oh0_equ.rst7
GenerateModel instance:  <QMzymeModel built from <Universe with 58553 atoms> contains 0 region(s)>
[6]:
#3. With a PQR file, containing charge information, and a trajectory DCD file:

from QMzyme.data import PQR, DCD
print("Files: ", os.path.basename(PQR), os.path.basename(DCD))
pqr_dcd = QMzyme.GenerateModel(PQR, DCD)
print("GenerateModel instance: ", pqr_dcd)
Files:  1oh0_equ.prod_1.stripped.pqr 1oh0_equ.prod_1.stripped.dcd
GenerateModel instance:  <QMzymeModel built from <Universe with 4258 atoms> contains 0 region(s)>

Congratulations, you have successfully made your first QMzymeModel! The next workflows will walk through how to use QMzyme to generate QM input files for ORCA and Gaussian.