qmmmrebind.parameterize
Module Contents
Classes
A class used to segregate the QM and MM regions. |
|
A class used to prepare the QM engine input file (Gaussian) |
|
A class used to prepare the QM engine input file (Gaussian) for |
|
A class used to obtain force field parameters for the ligand (bond, |
|
A class used to prepare the QM engine input file (Gaussian) |
|
A class used to obtain force field parameters for the QM region |
|
A class used to generate a template force field XML file for the ligand |
|
A class used to generate a template force field XML file for the receptor |
|
A class used to run the OpenMM simulation on any specified system. |
|
A class used to merge the host and guest topology and coordinate |
|
A class used to create a filetree for torsion scan |
|
A class used to parameterize the torsional parameters |
|
A class used to integrate the parameterized topology |
|
A class used to generate a force field XML file for the system |
|
A class used to generate a force field XML file for the system |
Functions
|
Returns vibrational scaling factor given the functional |
|
Calculates unit normal vector perpendicular to plane ABC. |
|
|
|
|
|
Reads the host PDB file and returns the |
|
|
|
Copies a file from a source to the destination. |
|
Returns decomposed OPENMM energies for the |
|
Returns the vector in the plane A,B,C and perpendicular to AB. |
|
Calculates force constant according to Equation 14 of |
|
Returns the dot product of two vectors. |
|
Calculates force constant according to Equation 14 |
|
Calculates the bond force constant for the bonds in the |
|
Returns the vector in the plane A,B,C and perpendicular to AB. |
|
Returns the reversed form of a given list. |
|
Returns a list with only unique elements from a list |
|
Search for the given string in file and return lines |
|
Converts an input list with mapped characters (every |
|
Returns a scaled list with the minimum value |
|
Convert the elements in the list from |
|
Convert the elements in the list from |
|
Returns an xyz file from a torsiondrive formatted |
|
Converts a XYZ file to a PDB file. |
|
Generates an openforcefield xml file from the pdb file. |
|
Generates an openforcefield xml file from the pdb |
|
Returns dihedrals from the torsiondrive scan file. |
|
Returns QM optimized energies from the torsiondrive |
|
Generate PDBs from the torsiondrive scan file |
|
Delete all generated PDB files. |
|
Returns sum of all the non-torsional energies (that |
|
Returns potential energy of the system from the PDB file |
|
Returns the difference between two lists as a list. |
|
Expression for the dihedral energy. |
|
Root Mean Squared Error. |
|
Boltzmann Root Mean Squared Error. |
|
Initial guess for the torsional parameter. |
|
Objective function for the torsional parameter fitting. |
|
Optimization of the objective function. |
|
Returns the fitted torsional parameters. |
|
Returns the torsional lines for the XML forcefield file. |
|
Returns a PDB file with chain ID = A |
|
Minimizing the initial PDB file with the given topology |
|
Returns a float or an integer with an exact number |
|
Adds periodic box dimensions to the inpcrd file |
|
Adds periodic box dimensions flag in the prmtop file. |
|
Changes the value of IFBOX if needed for the prmtop / parm file. |
|
Adds the flag solvent pointers to the topology file. |
|
Standardizes the topology files |
|
Runs OpenMM simulation with inpcrd and prmtop files. |
|
Runs OpenMM simulation with pdb and prmtop files. |
|
Moves QMMMReBind generated topology and parameter files |
Moves QM engine generated files to a new directory . |
|
Moves all QMMMREBind files to a new directory. |
Attributes
- qmmmrebind.parameterize.element_list = [['1 ', 'H ', 'Hydrogen'], ['2 ', 'He', 'Helium'], ['3 ', 'Li', 'Lithium'], ['4 ', 'Be',...[source]
- qmmmrebind.parameterize.get_vibrational_scaling(functional, basis_set)[source]
Returns vibrational scaling factor given the functional and the basis set for the QM engine.
- Parameters
functional (str) – Functional
basis_set (str) – Basis set
- Returns
vib_scale – Vibrational scaling factor corresponding to the given the basis_set and the functional.
- Return type
float
Examples
>>> get_vibrational_scaling("QCISD", "6-311G*") 0.957
- qmmmrebind.parameterize.unit_vector_N(u_BC, u_AB)[source]
Calculates unit normal vector perpendicular to plane ABC.
- Parameters
u_BC ((.. , 1, 3) array) – Unit vector from atom B to atom C.
u_AB ((…, 1, 3) array) – Unit vector from atom A to atom B.
- Returns
u_N – Unit normal vector perpendicular to plane ABC.
- Return type
(…, 1, 3) array
Examples
>>> u_BC = [0.34040355, 0.62192853, 0.27011169] >>> u_AB = [0.28276792, 0.34232697, 0.02370306] >>> unit_vector_N(u_BC, u_AB) array([-0.65161629, 0.5726879 , -0.49741811])
- qmmmrebind.parameterize.delete_guest_angle_params(guest_qm_params_file='guest_qm_params.txt')[source]
- qmmmrebind.parameterize.remove_bad_angle_params(guest_qm_params_file='guest_qm_params.txt', angle=1.0, k_angle=500)[source]
- qmmmrebind.parameterize.get_num_host_atoms(host_pdb)[source]
Reads the host PDB file and returns the total number of atoms.
- qmmmrebind.parameterize.copy_file(source, destination)[source]
Copies a file from a source to the destination.
- qmmmrebind.parameterize.get_openmm_energies(system_pdb, system_xml)[source]
Returns decomposed OPENMM energies for the system.
- Parameters
system_pdb (str) – Input PDB file
system_xml (str) – Forcefield file in XML format
- qmmmrebind.parameterize.u_PA_from_angles(atom_A, atom_B, atom_C, coords)[source]
Returns the vector in the plane A,B,C and perpendicular to AB.
- Parameters
atom_A (int) – Index of atom A (left, starting from 0).
atom_B (int) – Index of atom B (center, starting from 0).
atom_C (int) – Index of atom C (right, starting from 0).
coords ((…, N, 3) array) – An array which contains the coordinates of all the N atoms.
- qmmmrebind.parameterize.force_angle_constant(atom_A, atom_B, atom_C, bond_lengths, eigenvalues, eigenvectors, coords, scaling_1, scaling_2)[source]
Calculates force constant according to Equation 14 of Seminario calculation paper; returns angle (in kcal/mol/rad^2) and equilibrium angle (in degrees).
- Parameters
atom_A (int) – Index of atom A (left, starting from 0).
atom_B (int) – Index of atom B (center, starting from 0).
atom_C (int) – Index of atom C (right, starting from 0).
bond_lengths ((N, N) array) – An N * N array containing the bond lengths for all the possible pairs of atoms.
eigenvalues ((N, N, 3) array) – A numpy array of shape (N, N, 3) containing eigenvalues of the hessian matrix, where N is the total number of atoms.
eigenvectors ((3, 3, N, N) array) – A numpy array of shape (3, 3, N, N) containing eigenvectors of the hessian matrix.
coords ((N, 3) array) – A numpy array of shape (N, 3) having the X, Y and Z coordinates of all N atoms.
scaling_1 (float) – Factor to scale the projections of eigenvalues for AB.
scaling_2 (float) – Factor to scale the projections of eigenvalues for BC.
- Returns
k_theta (float) – Force angle constant calculated using modified seminario method.
k_0 (float) – Equilibrium angle between AB and BC.
- qmmmrebind.parameterize.dot_product(u_PA, eig_AB)[source]
Returns the dot product of two vectors.
- Parameters
u_PA ((…, 1, 3) array) – Unit vector perpendicular to AB and in the plane of A, B, C.
eig_AB ((…, 3, 3) array) – Eigenvectors of the hessian matrix for the bond AB.
- qmmmrebind.parameterize.force_angle_constant_special_case(atom_A, atom_B, atom_C, bond_lengths, eigenvalues, eigenvectors, coords, scaling_1, scaling_2)[source]
Calculates force constant according to Equation 14 of Seminario calculation paper when the vectors u_CB and u_AB are linearly dependent and u_N cannot be defined. It instead takes samples of u_N across a unit sphere for the calculation; returns angle (in kcal/mol/rad^2) and equilibrium angle in degrees.
- Parameters
atom_A (int) – Index of atom A (left, starting from 0).
atom_B (int) – Index of atom B (center, starting from 0).
atom_C (int) – Index of atom C (right, starting from 0).
bond_lengths ((N, N) array) – An N * N array containing the bond lengths for all the possible pairs of atoms.
eigenvalues ((N, N, 3) array) – A numpy array of shape (N, N, 3) containing eigenvalues of the hessian matrix, where N is the total number of atoms.
eigenvectors ((3, 3, N, N) array) – A numpy array of shape (3, 3, N, N) containing eigenvectors of the hessian matrix.
coords ((N, 3) array) – A numpy array of shape (N, 3) having the X, Y, and Z coordinates of all N atoms.
scaling_1 (float) – Factor to scale the projections of eigenvalues for AB.
scaling_2 (float) – Factor to scale the projections of eigenvalues for BC.
- Returns
k_theta (float) – Force angle constant calculated using modified seminario method.
k_0 (float) – Equilibrium angle between AB and BC.
- qmmmrebind.parameterize.force_constant_bond(atom_A, atom_B, eigenvalues, eigenvectors, coords)[source]
Calculates the bond force constant for the bonds in the molecule according to equation 10 of seminario paper, given the bond atoms’ indices and the corresponding eigenvalues, eigenvectors and coordinates matrices.
- Parameters
atom_A (int) – Index of Atom A.
atom_B (int) – Index of Atom B.
eigenvalues ((N, N, 3) array) – A numpy array of shape (N, N, 3) containing eigenvalues of the hessian matrix, where N is the total number of atoms.
eigenvectors ((3, 3, N, N) array) – A numpy array of shape (3, 3, N, N) containing the eigenvectors of the hessian matrix.
coords ((N, 3) array) – A numpy array of shape (N, 3) having the X, Y, and Z coordinates of all N atoms.
- Returns
k_AB – Bond Force Constant value for the bond with atoms A and B.
- Return type
float
- qmmmrebind.parameterize.u_PA_from_angles(atom_A, atom_B, atom_C, coords)[source]
Returns the vector in the plane A,B,C and perpendicular to AB.
- Parameters
atom_A (int) – Index of atom A (left, starting from 0).
atom_B (int) – Index of atom B (center, starting from 0).
atom_C (int) – Index of atom C (right, starting from 0).
coords ((…, N, 3) array) – An array containing the coordinates of all the N atoms.
- Returns
u_PA – Unit vector perpendicular to AB and in the plane of A, B, C.
- Return type
(…, 1, 3) array
- qmmmrebind.parameterize.reverse_list(lst)[source]
Returns the reversed form of a given list.
- Parameters
lst (list) – Input list.
- Returns
reversed_list – Reversed input list.
- Return type
list
Examples
>>> lst = [5, 4, 7, 2] >>> reverse_list(lst) [2, 7, 4, 5]
- qmmmrebind.parameterize.uniq(input_)[source]
Returns a list with only unique elements from a list containing duplicate / repeating elements.
- Parameters
input_ (list) – Input list.
- Returns
output – List with only unique elements.
- Return type
list
Examples
>>> lst = [2, 4, 2, 9, 10, 35, 10] >>> uniq(lst) [2, 4, 9, 10, 35]
- qmmmrebind.parameterize.search_in_file(file: str, word: str) list[source]
Search for the given string in file and return lines containing that string along with line numbers.
- Parameters
file (str) – Input file.
word (str) – Search word.
- Returns
list_of_results – List of lists with each element representing the line number and the line contents.
- Return type
list
- qmmmrebind.parameterize.list_to_dict(lst)[source]
Converts an input list with mapped characters (every odd entry is the key of the dictionary and every even entry adjacent to the odd entry is its correponding value) to a dictionary.
- Parameters
lst (list) – Input list.
- Returns
res_dct – A dictionary with every element mapped with its successive element starting from index 0.
- Return type
dict
Examples
>>> lst = [5, 9, 3, 6, 2, 7] >>> list_to_dict(lst) {5: 9, 3: 6, 2: 7}
- qmmmrebind.parameterize.scale_list(list_)[source]
Returns a scaled list with the minimum value subtracted from each element of the corresponding list.
- Parameters
list_ (list) – Input list.
- Returns
scaled_list – Scaled list.
- Return type
list
Examples
>>> list_ = [6, 3, 5, 11, 3, 2, 8, 6] >>> scale_list(list_) [4, 1, 3, 9, 1, 0, 6, 4]
- qmmmrebind.parameterize.list_kJ_kcal(list_)[source]
Convert the elements in the list from kiloJoules units to kiloCalories units.
- Parameters
list_ (list) – List with elements in units of kJ.
- Returns
converted_list – List with elements in units of kcal.
- Return type
list
Examples
>>> list_ = [6, 3, 5] >>> list_kJ_kcal(list_) [1.4340344168260037, 0.7170172084130019, 1.1950286806883366]
- qmmmrebind.parameterize.list_hartree_kcal(list_)[source]
Convert the elements in the list from hartree units to kiloCalories units.
- Parameters
list_ (list) – List with elements in units of hartree.
- Returns
converted_list – List with elements in units of kcal.
- Return type
list
Examples
>>> list_ = [6, 3, 5] >>> list_hartree_kcal(list_) [3765.0564000000004, 1882.5282000000002, 3137.547]
- qmmmrebind.parameterize.torsiondrive_input_to_xyz(psi_input_file, xyz_file)[source]
Returns an xyz file from a torsiondrive formatted input file.
- Parameters
psi_input_file (str) – Input file for the psi4 QM engine.
xyz_file (str) – XYZ format file to write the coords of the system.
- qmmmrebind.parameterize.xyz_to_pdb(xyz_file, coords_file, template_pdb, system_pdb)[source]
Converts a XYZ file to a PDB file.
- Parameters
xyz_file (str) – XYZ file containing the coordinates of the system.
coords_file (str) – A text file containing the coordinates part of XYZ file.
template_pdb (str) – A pdb file to be used as a template for the required PDB.
system_pdb (str) – Output PDB file with the coordinates updated in the template pdb using XYZ file.
- qmmmrebind.parameterize.generate_xml_from_pdb_sdf(system_pdb, system_sdf, system_xml)[source]
Generates an openforcefield xml file from the pdb file.
- Parameters
system_pdb (str) – Input PDB file.
system_sdf (str) – SDF file of the system.
system_xml (str) – XML force field file generated using PDB and SDF files.
- qmmmrebind.parameterize.generate_xml_from_charged_pdb_sdf(system_pdb, system_init_sdf, system_sdf, num_charge_atoms, index_charge_atom_1, charge_atom_1, system_xml)[source]
Generates an openforcefield xml file from the pdb file via SDF file and openforcefield.
- Parameters
system_pdb (str) – Input PDB file.
system_init_sdf (str) – SDF file for the system excluding charge information.
system_sdf (str) – SDF file of the system.
num_charge_atoms (int) – Total number of charged atoms in the PDB.
index_charge_atom_1 (int) – Index of the first charged atom.
charge_atom_1 (float) – Charge on first charged atom.
system_xml (str) – XML force field file generated using PDB and SDF files.
- qmmmrebind.parameterize.get_dihedrals(qm_scan_file)[source]
Returns dihedrals from the torsiondrive scan file.
- Parameters
qm_scan_file (str) – Output scan file containing torsiondrive scans.
- Returns
dihedrals – List of all the dihedral values from the qm scan file.
- Return type
list
- qmmmrebind.parameterize.get_qm_energies(qm_scan_file)[source]
Returns QM optimized energies from the torsiondrive scan file.
- Parameters
qm_scan_file (str) – Output scan file containing torsiondrive scans.
- Returns
qm_energies – List of all the qm optimiseed energies extracted from the torsiondrive scan file.
- Return type
list
- qmmmrebind.parameterize.generate_mm_pdbs(qm_scan_file, template_pdb)[source]
Generate PDBs from the torsiondrive scan file based on a template PDB.
- qmmmrebind.parameterize.remove_mm_files(qm_scan_file)[source]
Delete all generated PDB files.
- Parameters
qm_scan_file (str) – Output scan file containing torsiondrive scans.
- qmmmrebind.parameterize.get_non_torsion_mm_energy(system_pdb, load_topology, system_xml)[source]
Returns sum of all the non-torsional energies (that includes HarmonicBondForce, HarmonicAngleForce and NonBondedForce) of the system from the PDB file given the topology and the forcefield file.
- Parameters
system_pdb (str) – System PDB file to load the openmm system topology and coordinates.
load_topology ({“openmm”, “parmed”}) – Argument to specify how to load the topology.
system_xml (str) – XML force field file for the openmm system.
- Return type
Sum of all the non-torsional energies of the system.
- qmmmrebind.parameterize.get_mm_potential_energies(qm_scan_file, load_topology, system_xml)[source]
Returns potential energy of the system from the PDB file given the topology and the forcefield file.
- Parameters
qm_scan_file (str) – Output scan file containing torsiondrive scans.
load_topology ({“openmm”, “parmed”}) – Argument to spcify how to load the topology.
system_xml (str) – XML file to load the openmm system.
- Returns
mm_potential_energies – List of all the non torsion mm energies for the generated PDB files.
- Return type
list
- qmmmrebind.parameterize.list_diff(list_1, list_2)[source]
Returns the difference between two lists as a list.
- Parameters
list_1 (list) – First list
list_2 (list) – Second list.
- Returns
diff_list – List containing the diferences between the elements of the two lists.
- Return type
list
Examples
>>> list_1 = [4, 2, 8, 3, 0, 6, 7] >>> list_2 = [5, 3, 1, 5, 6, 0, 4] >>> list_diff(list_1, list_2) [-1, -1, 7, -2, -6, 6, 3]
- qmmmrebind.parameterize.dihedral_energy(x, k1, k2, k3, k4=0)[source]
Expression for the dihedral energy.
- qmmmrebind.parameterize.error_function_boltzmann(delta_qm, delta_mm, T)[source]
Boltzmann Root Mean Squared Error.
- qmmmrebind.parameterize.gen_init_guess(qm_scan_file, load_topology, system_xml)[source]
Initial guess for the torsional parameter.
- Parameters
qm_scan_file (str) – Output scan file containing torsiondrive scans.
load_topology ({“openmm”, “parmed”}) – Argument to speify how to load the topology.
system_xml (str) – XML force field file for the system.
- Returns
k_init_guess – Initial guess for the torsional parameters.
- Return type
list
- qmmmrebind.parameterize.objective_function(k_array, x, delta_qm)[source]
Objective function for the torsional parameter fitting.
- qmmmrebind.parameterize.fit_params(qm_scan_file, load_topology, system_xml, method)[source]
Optimization of the objective function.
- qmmmrebind.parameterize.get_tor_params(qm_scan_file, template_pdb, load_topology, system_xml, method)[source]
Returns the fitted torsional parameters.
- qmmmrebind.parameterize.get_torsional_lines(template_pdb, system_xml, qm_scan_file, load_topology, method, dihedral_text_file)[source]
Returns the torsional lines for the XML forcefield file.
- qmmmrebind.parameterize.singular_resid(pdbfile, qmmmrebind_init_file)[source]
Returns a PDB file with chain ID = A
- Parameters
pdbfile (str) – Input PDB file
qmmmrebind_init_file (str) – Output PDB file
- qmmmrebind.parameterize.relax_init_structure(pdbfile, prmtopfile, qmmmrebindpdb, sim_output='output.pdb', sim_steps=100000)[source]
Minimizing the initial PDB file with the given topology file
- Parameters
pdbfile (str) – Input PDB file.
prmtopfile (str) – Input prmtop file.
qmmmrebind_init_file (str) – Output PDB file.
sim_output (str) – Simulation output trajectory file.
sim_steps (int) – MD simulation steps.
- qmmmrebind.parameterize.truncate(x)[source]
Returns a float or an integer with an exact number of characters.
- Parameters
x (str) – input value
- qmmmrebind.parameterize.add_vectors_inpcrd(pdbfile, inpcrdfile)[source]
Adds periodic box dimensions to the inpcrd file
- Parameters
pdbfile (str) – PDB file containing the periodic box information.
inpcrdfile (str) – Input coordinate file.
- qmmmrebind.parameterize.add_dim_prmtop(pdbfile, prmtopfile)[source]
Adds periodic box dimensions flag in the prmtop file.
- Parameters
prmtopfile (str) – Input prmtop file.
pdbfile (str) – PDB file containing the periodic box information.
- qmmmrebind.parameterize.add_period_prmtop(parm_file, ifbox)[source]
Changes the value of IFBOX if needed for the prmtop / parm file. Set to 1 if standard periodic box and 2 when truncated octahedral.
- qmmmrebind.parameterize.add_solvent_pointers_prmtop(non_reparams_file, reparams_file)[source]
Adds the flag solvent pointers to the topology file.
- qmmmrebind.parameterize.prmtop_calibration(prmtopfile='system_qmmmrebind.prmtop', inpcrdfile='system_qmmmrebind.inpcrd')[source]
Standardizes the topology files
- Parameters
prmtopfile (str) – Input prmtop file.
inpcrdfile (str) – Input coordinate file.
- qmmmrebind.parameterize.run_openmm_prmtop_inpcrd(pdbfile='system_qmmmrebind.pdb', prmtopfile='system_qmmmrebind.prmtop', inpcrdfile='system_qmmmrebind.inpcrd', sim_output='output.pdb', sim_steps=10000)[source]
Runs OpenMM simulation with inpcrd and prmtop files.
- Parameters
pdbfile (str) – Input PDB file.
prmtopfile (str) – Input prmtop file.
inpcrdfile (str) – Input coordinate file.
sim_output (str) – Output trajectory file.
sim_steps (int) – Simulation steps.
- qmmmrebind.parameterize.run_openmm_prmtop_pdb(pdbfile='system_qmmmrebind.pdb', prmtopfile='system_qmmmrebind.prmtop', sim_output='output.pdb', sim_steps=10000)[source]
Runs OpenMM simulation with pdb and prmtop files.
- Parameters
pdbfile (str) – Input PDB file.
prmtopfile (str) – Input prmtop file.
sim_output (str) – Output trajectory file.
sim_steps (int) – Simulation steps.
- qmmmrebind.parameterize.move_qmmmmrebind_files(prmtopfile='system_qmmmrebind.prmtop', inpcrdfile='system_qmmmrebind.inpcrd', pdbfile='system_qmmmrebind.pdb')[source]
Moves QMMMReBind generated topology and parameter files to a new directory .
- Parameters
prmtopfile (str) – QMMMReBind generated prmtop file.
inpcrdfile (str) – QMMMReBind generated inpcrd file.
pdbfile (str) – QMMMReBind generated PDB file.
- qmmmrebind.parameterize.move_qm_files()[source]
Moves QM engine generated files to a new directory .
- qmmmrebind.parameterize.move_qmmmrebind_files()[source]
Moves all QMMMREBind files to a new directory.
- class qmmmrebind.parameterize.PrepareQMMM(init_pdb, distance, num_residues, guest_resname, cleaned_pdb='system.pdb', guest_init_pdb='guest_init.pdb', host_pdb='host.pdb', guest_pdb='guest_init_II.pdb', guest_xyz='guest_coord.txt', residue_list='residue_list.txt', host_qm_atoms='host_qm.txt', host_mm_atoms='host_mm.txt', host_qm_pdb='host_qm.pdb', host_mm_pdb='host_mm.pdb', qm_pdb='qm.pdb', mm_pdb='mm.pdb', host_mm_region_I_atoms='host_mm_region_I.txt', host_mm_region_II_atoms='host_mm_region_II.txt', host_mm_region_I_pdb='host_mm_region_I.pdb', host_mm_region_II_pdb='host_mm_region_II.pdb')[source]
A class used to segregate the QM and MM regions.
This class contain methods to remove the solvent, ions and all entities that are exclusive of receptor and the ligand. It also defines the Quantum Mechanical (QM) region and the Molecular Mechanical (MM) region based upon the distance of the ligand from the receptor and the chosen number of receptor residues. It is also assumed that the initial PDB file will have the receptor followed by the ligand.
…
- Variables
init_pdb (str) – Initial PDB file containing the receptor-ligand complex with solvent, ions, etc.
cleaned_pdb (str) – Formatted PDB file containing only the receptor and the ligand.
guest_init_pdb (str) – A separate ligand PDB file with atom numbers not beginning from 1.
host_pdb (str) – A separate receptor PDB file with atom numbers beginning from 1.
guest_resname (str) – Three letter residue ID for the ligand.
guest_pdb (str, optional) – Ligand PDB file with atom numbers beginning from 1.
guest_xyz (str, optional) – A text file of the XYZ coordinates of the ligand.
distance (float, optional) – The distance required to define the QM region of the receptor. This is the distance between the atoms of the ligand and the atoms of the receptor.
residue_list (str, optional) – A text file of the residue numbers of the receptor within the proximity (as defined by the distance) from the ligand.
host_qm_atoms (str, optional) – A text file of the atom numbers of the receptors in the QM region.
host_mm_atoms (str, optional) – A text file of the atom numbers of the receptors in the MM region (all atoms except atoms in the QM region)
host_qm_pdb (str, optional) – PDB file for the receptor’s QM region.
host_mm_pdb (str, optional) – PDB file for the receptor’s MM region.
qm_pdb (str, optional) – PDB file for the QM region (receptor’s QM region and the ligand).
mm_pdb (str, optional) – PDB file for the MM region.
host_mm_region_I_atoms (str, optional) – A text file of the atom numbers of the receptors in the MM region preceeding the QM region.
host_mm_region_II_atoms (str, optional) – A text file of the atom numbers of the receptors in the MM region following the QM region.
host_mm_region_I_pdb (str, optional) – PDB file of the receptor in the MM region preceeding the QM region.
host_mm_region_II_pdb (str, optional) – PDB file of the receptor in the MM region following the QM region.
num_residues (int, optional) – Number of residues required in the QM region of the receptor.
- clean_up(self)[source]
Reads the given PDB file, removes all entities except the receptor and ligand and saves a new pdb file.
- get_qm_resids(self)[source]
Saves a text file of the residue numbers of the receptor within the proximity (as defined by the distance) from the ligand.
- get_host_qm_mm_atoms(self)[source]
Saves a text file of the atom numbers of the receptors in the QM region and MM region separately.
- save_host_pdbs(self)[source]
Saves a PDB file for the receptor’s QM region and MM region separately.
- get_host_mm_region_atoms(self)[source]
Saves a text file for the atoms of the receptor’s MM region preceding the QM region and saves another text file for the atoms of the receptor’s MM region folllowing the QM region.
- class qmmmrebind.parameterize.PrepareGaussianGuest(charge=0, multiplicity=1, guest_pdb='guest_init_II.pdb', n_processors=12, memory=50, functional='B3LYP', basis_set='6-31G', optimisation='OPT', frequency='FREQ', add_keywords_I='INTEGRAL=(GRID=ULTRAFINE)', add_keywords_II='POP(MK,READRADII)', add_keywords_III='IOP(6/33=2,6/42=6)', gauss_out_file='guest.out', fchk_out_file='guest_fchk.out')[source]
A class used to prepare the QM engine input file (Gaussian) for the ligand and run QM calculations with appropriate keywords.
This class contain methods to write an input file (.com extension) for the QM engine. It then runs a QM calculation with the given basis set and functional. Checkpoint file is then converted to a formatted checkpoint file. Output files (.log, .chk, and .fhck) will then be used to extract ligand’s force field parameters.
…
- Variables
charge (int, optional) – Charge of the ligand.
multiplicity (int, optional) – Spin Multiplicity (2S+1) of the ligand where S represents the total spin of the ligand.
guest_pdb (str, optional) – Ligand PDB file with atom numbers beginning from 1.
n_processors (int, optional) – Number of processors to be used for Gaussian program to run and set in %NProcShared command of Gaussian.
memory (int, optional) – Memory (in GB) to be used set in %Mem command of Gaussian.
functional (str, optional) – Exchange/Correlation or hybrid functional to use in the Gaussian QM calculation.
basis_set (str, optional) – Basis set to use for the Gaussian QM calculation.
optimisation (str, optional) – set to “OPT” to perform a geometry optimization on the ligand specified in the system; else set to an empty string.
frequency (str, optional) – set to “FREQ” for Gaussian to perform a frequency calculation; else set to an empty string.
add_keywords_I (str, optional) – Specifies the integration grid.
add_keywords_II (str, optional) – Specifies the QM engine to select one of the methods for analyzing the electron density of the system. Methods used are based on fitting the molecular electrostatic potential. Methods used are : POP=CHELPG (Charges from Electrostatic Potentials using a Grid based method) and POP=MK (Merz-Singh-Kollman scheme)
add_keywords_III (str, optional) – Used to include the IOp keyword (to set the internal options to specific values) in the Gaussian command.
gauss_out_file (str, optional) – This file contains the output script obtained after running the Gaussian QM calculation.
fchk_out_file (str, optional) – Formatted checkpoint file obtained from the checkpoint file using formchk command.
- class qmmmrebind.parameterize.PrepareGaussianHostGuest(charge=0, multiplicity=1, guest_pdb='guest_init_II.pdb', host_qm_pdb='host_qm.pdb', n_processors=12, memory=50, functional='B3LYP', basis_set='6-31G', optimisation='', frequency='', add_keywords_I='INTEGRAL=(GRID=ULTRAFINE)', add_keywords_II='POP(MK,READRADII)', add_keywords_III='IOP(6/33=2,6/42=6) SCRF=PCM', gauss_system_out_file='system_qm.out', fchk_system_out_file='system_qm_fchk.out', host_guest_input='host_guest.com', qm_guest_charge_parameter_file='guest_qm_surround_charges.txt', qm_host_charge_parameter_file='host_qm_surround_charges.txt', qm_guest_atom_charge_parameter_file='guest_qm_atom_surround_charges.txt')[source]
A class used to prepare the QM engine input file (Gaussian) for the receptor - ligand complex and run the QM calculations with the appropriate keywords.
This class contain methods to write an input file (.com extension) for the QM engine for the receptor - ligand complex. It then runs a QM calculation with the given basis set and functional. Checkpoint file is then converted to a formatted checkpoint file. Output files (.log, .chk, and .fhck) will then be used to extract charges for the ligand and the receptor.
…
- Variables
charge (int, optional) – Total charge of the receptor - ligand complex.
multiplicity (int, optional) – Spin Multiplicity (2S+1) of the ligand where S represents the total spin of the ligand.
guest_pdb (str, optional) – Ligand PDB file with atom numbers beginning from 1.
host_qm_pdb (str, optional) – PDB file for the receptor’s QM region.
n_processors (int, optional) – Number of processors to be used for Gaussian program to run and set in %NProcShared command of Gaussian.
memory (int, optional) – Memory (in GB) to be used set in %Mem command of Gaussian.
functional (str, optional) – Exchange/Correlation or hybrid functional to use in the Gaussian QM calculation.
basis_set (str, optional) – Basis set to use for the Gaussian QM calculation.
optimisation (str, optional) – set to “OPT” to perform a geometry optimization on the ligand specified in the system; else set to an empty string.
frequency (str, optional) – set to “FREQ” for Gaussian to perform a frequency calculation; else set to an empty string.
add_keywords_I (str, optional) – Specifies the integration grid.
add_keywords_II (str, optional) – Specifies the QM engine to select one of the methods for analyzing the electron density of the system. Methods used are based on fitting the molecular electrostatic potential. Methods used are : POP=CHELPG (Charges from Electrostatic Potentials using a Grid based method) and POP=MK (Merz-Singh-Kollman scheme)
add_keywords_III (str, optional) – Used to include the IOp keyword (to set the internal options to specific values) in the Gaussian command.
gauss_system_out_file (str, optional) – This file contains the output script obtained after running the Gaussian QM calculation.
fchk_system_out_file (str, optional) – Formatted checkpoint file obtained from the checkpoint file using formchk command.
host_guest_input (str, optional) – Gaussian input file (.com extension) for the receptor - ligand QM region.
qm_guest_charge_parameter_file (str, optional) – File containing the charges of ligand atoms and their corresponding atoms. Charge obtained are the polarised charged due to the surrounding receptor’s region.
qm_host_charge_parameter_file (str, optional) – File containing the charges of the QM region of the receptor.
qm_guest_atom_charge_parameter_file (str, optional) – File containing the charges of ligand atoms. Charge obtained are the polarised charged due to the surrounding receptor’s region.
- run_gaussian(self)[source]
Runs the Gaussian QM calculation for the ligand - receptor region locally.
- class qmmmrebind.parameterize.ParameterizeGuest(xyz_file='guest_coords.xyz', coordinate_file='guest_coordinates.txt', unprocessed_hessian_file='guest_unprocessed_hessian.txt', bond_list_file='guest_bond_list.txt', angle_list_file='guest_angle_list.txt', hessian_file='guest_hessian.txt', atom_names_file='guest_atom_names.txt', bond_parameter_file='guest_bonds.txt', angle_parameter_file='guest_angles.txt', charge_parameter_file='guest_qm_surround_charges.txt', guest_pdb='guest_init_II.pdb', proper_dihedral_file='proper_dihedrals.txt', functional='B3LYP', basis_set='6-31G')[source]
A class used to obtain force field parameters for the ligand (bond, angle and charge parameters) from QM calculations.
This class contain methods to process the output files of the Gaussian QM output files (.chk, .fchk and .log files). Methods in the class extract the unprocessed hessian matrix from the Gaussian QM calculations, processes it and uses the Modified Seminario Method to ontain the bond and angle parameters. The class also extracts the QM charges from the log file.
…
- Variables
xyz_file (str, optional) – XYZ file for ligand coordinates obtained from its corresponding formatted checkpoint file.
coordinate_file (str, optional) – Text file containing the ligand coordinates (extracted from the formatted checkpoint file).
unprocessed_hessian_file (str, optional) – Unprocessed hessian matrix of the ligand obtained from the formatted checkpoint file.
bond_list_file (str, optional) – Text file containing the bond information of the ligand extracted from the log file.
angle_list_file (str, optional) – Text file containing the angle information of the ligand extracted from the log file.
hessian_file (str, optional) – Processed hessian matrix of the ligand.
atom_names_file (str, optional) – Text file containing the list of atom names from the fchk file.
bond_parameter_file (str, optional) – Text file containing the bond parameters for the ligand obtained using the Modified Seminario method.
angle_parameter_file (str, optional) – Text file containing the angle parameters of the ligand obtained using the Modified Seminario method..
charge_parameter_file (str, optional) – Text file containing the QM charges of the ligand.
guest_pdb (str, optional) – Ligand PDB file with atom numbers beginning from 1.
proper_dihedral_file (str, optional) – A text file containing proper dihedral angles of the ligand.
functional (str, optional) – Exchange/Correlation or hybrid functional to use in the Gaussian QM calculation.
basis_set (str, optional) – Basis set to use for the Gaussian QM calculation.
- get_unprocessed_hessian(self)[source]
Saves a text file of the unprocessed hessian matrix from the formatted checkpoint file.
- get_bond_angles(self)[source]
Saves a text file containing bonds and angles from the gaussian log file.
- get_hessian(self)[source]
Extracts hessian matrix from the unprocessed hessian matrix and saves into a new file.
- get_bond_angle_params(self)[source]
Saves the bond and angle parameter files obtained from the formatted checkpoint file.
- class qmmmrebind.parameterize.PrepareGaussianHost(charge=0, multiplicity=1, host_qm_pdb='host_qm.pdb', n_processors=12, memory=50, functional='B3LYP', basis_set='6-31G', optimisation='OPT', frequency='FREQ', add_keywords_I='INTEGRAL=(GRID=ULTRAFINE) SCF=(maxcycles=4000) SYMMETRY=NONE', add_keywords_II='POP(MK,READRADII)', add_keywords_III='IOP(6/33=2,6/42=6)', gauss_out_file='host_qm.out', fchk_out_file='host_qm_fchk.out')[source]
A class used to prepare the QM engine input file (Gaussian) for the receptor and run QM calculations with appropriate keywords.
This class contain methods to write an input file (.com extension) for the QM engine. It then runs a QM calculation with the given basis set and functional. Checkpoint file is then converted to a formatted checkpoint file. Output files (.log, .chk, and .fhck) will then be used to extract receptors’s force field parameters.
…
- Variables
charge (int, optional) – Charge of the receptor.
multiplicity (int, optional) – Spin Multiplicity (2S+1) of the receptor where S represents the total spin of the receptor.
host_qm_pdb (str, optional) – PDB file of the receptor’s QM region with atom numbers beginning from 1.
n_processors (int, optional) – Number of processors to be used for Gaussian program to run and set in %NProcShared command of Gaussian.
memory (int, optional) – Memory (in GB) to be used set in %Mem command of Gaussian.
functional (str, optional) – Exchange/Correlation or hybrid functional to use in the Gaussian QM calculation.
basis_set (str, optional) – Basis set to use for the Gaussian QM calculation.
optimisation (str, optional) – set to “OPT” to perform a geometry optimization on the receptor specified in the system; else set to an empty string.
frequency (str, optional) – set to “FREQ” for Gaussian to perform a frequency calculation; else set to an empty string.
add_keywords_I (str, optional) – Specifies the integration grid.
add_keywords_II (str, optional) – Specifies the QM engine to select one of the methods for analyzing the electron density of the system. Methods used are based on fitting the molecular electrostatic potential. Methods used are : POP=CHELPG (Charges from Electrostatic Potentials using a Grid based method) and POP=MK (Merz-Singh-Kollman scheme)
add_keywords_III (str, optional) – Used to include the IOp keyword (to set the internal options to specific values) in the Gaussian command.
gauss_out_file (str, optional) – This file contains the output script obtained after running the Gaussian QM calculation.
fchk_out_file (str, optional) – Formatted checkpoint file obtained from the checkpoint file using formchk command.
- class qmmmrebind.parameterize.ParameterizeHost(xyz_file='host_qm_coords.xyz', coordinate_file='host_qm_coordinates.txt', unprocessed_hessian_file='host_qm_unprocessed_hessian.txt', bond_list_file='host_qm_bond_list.txt', angle_list_file='host_qm_angle_list.txt', hessian_file='host_qm_hessian.txt', atom_names_file='host_qm_atom_names.txt', bond_parameter_file='host_qm_bonds.txt', angle_parameter_file='host_qm_angles.txt', charge_parameter_file='host_qm_surround_charges.txt', host_qm_pdb='host_qm.pdb', functional='B3LYP', basis_set='6-31G')[source]
A class used to obtain force field parameters for the QM region of the receptor (bond, angle and charge parameters) from QM calculations.
This class contain methods to process the output files of the Gaussian QM output files (.chk, .fchk and .log files). Methods in the class extract the unprocessed hessian matrix from the Gaussian QM calculations, processes it and uses the Modified Seminario Method to ontain the bond and angle parameters. The class also extracts the QM charges from the log file.
…
- Variables
xyz_file (str, optional) – XYZ file for ligand coordinates obtained from its corresponding formatted checkpoint file.
coordinate_file (str, optional) – Text file containing the receptor coordinates (extracted from the formatted checkpoint file).
unprocessed_hessian_file (str, optional) – Unprocessed hessian matrix of the receptor obtained from the formatted checkpoint file.
bond_list_file (str, optional) – Text file containing the bond information of the receptor extracted from the log file.
angle_list_file (str, optional) – Text file containing the angle information of the receptor extracted from the log file.
hessian_file (str, optional) – Processed hessian matrix of the receptor.
atom_names_file (str, optional) – Text file containing the list of atom names from the fchk file.
bond_parameter_file (str, optional) – Text file containing the bond parameters for the receptor obtained using the Modified Seminario method.
angle_parameter_file (str, optional) – Text file containing the angle parameters of the receptor.
charge_parameter_file (str, optional) – Text file containing the QM charges of the receptor.
host_qm_pdb (str, optional) – PDB file for the receptor’s QM region.
functional (str, optional) – Exchange/Correlation or hybrid functional to use in the Gaussian QM calculation.
basis_set (str, optional) – Basis set to use for the Gaussian QM calculation.
- get_unprocessed_hessian(self)[source]
Saves a text file of the unprocessed hessian matrix from the formatted checkpoint file.
- get_bond_angles(self)[source]
Saves a text file containing bonds and angles from the gaussian log file.
- get_hessian(self)[source]
Extracts hessian matrix from the unprocessed hessian matrix and saves into a new file.
- class qmmmrebind.parameterize.GuestAmberXMLAmber(charge=0, num_charge_atoms='', charge_atom_1='', index_charge_atom_1='', system_pdb='guest_init_II.pdb', system_mol2='guest.mol2', system_in='guest.in', system_frcmod='guest.frcmod', prmtop_system='guest.prmtop', inpcrd_system='guest.inpcrd', system_leap='guest.leap', system_xml='guest_init.xml', system_smi='guest.smi', system_sdf='guest.sdf', system_init_sdf='guest_init.sdf', index_charge_atom_2=' ', charge_atom_2=' ', charge_parameter_file='guest_qm_surround_charges.txt', system_qm_pdb='guest_init_II.pdb', bond_parameter_file='guest_bonds.txt', angle_parameter_file='guest_angles.txt', system_qm_params_file='guest_qm_params.txt', reparameterised_intermediate_system_xml_file='guest_intermediate_reparameterised.xml', system_xml_non_bonded_file='guest_xml_non_bonded.txt', system_xml_non_bonded_reparams_file='guest_xml_non_bonded_reparams.txt', reparameterised_system_xml_file='guest_reparameterised.xml', non_reparameterised_system_xml_file='guest_init.xml', prmtop_system_non_params='guest_non_params.prmtop', inpcrd_system_non_params='guest_non_params.inpcrd', prmtop_system_params='guest_params.prmtop', inpcrd_system_params='guest_params.inpcrd', load_topology='openmm')[source]
A class used to generate a template force field XML file for the ligand in order regenerate the reparameterised forcefield XML file.
This class contain methods to generate a template XML force field through openforcefield. XML template generation can be obtained through different file formats such as PDB, SDF, and SMI. Methods support charged ligands as well. Re-parameterized XML force field files are then generated from the template files. Different energy components such as the bond, angle, torsional and non-bonded energies are computed for the non-reparametrized and the reparameterized force fields. Difference between the non-reparameterized and reparameterized force field energies can then be analyzed. …
- Variables
charge (int) – Charge of the ligand.
num_charge_atoms (int, optional) – Number of charged atoms in the molecule.
charge_atom_1 (int, optional) – Charge on the first charged atom.
index_charge_atom_1 (int, optional) – Index of the first charged atom.
system_pdb (str, optional) – Ligand PDB file with atom numbers beginning from 1.
system_mol2 (str, optional) – Ligand Mol2 file obtained from PDB file.
system_in (str, optional) – Prepi file as required by antechamber.
system_frcmod (str, optional) – FRCMOD file as required by antechamber.
prmtop_system (str, optional) – Topology file obtained from the ligand PDB.
inpcrd_system (str, optional) – Coordinate file obtained from the ligand PDB using the command saveamberparm.
system_leap (str, optional) – Amber generated leap file for generating and saving topology and coordinate files.
system_xml (str, optional) – Serialized XML force field file of the ligand.
system_smi (str, optional) – Ligand SMILES format file.
system_sdf (str, optional) – Ligand SDF (structure-data) format file.
system_init_sdf (str, optional) – Ligand SDF (structure-data) format file. This file will be generated only if the ligand is charged.
index_charge_atom_2 (int, optional) – Index of the second charged atom of the ligand.
charge_atom_2 (int, optional) – Charge on the second charged atom of the ligand.
charge_parameter_file (str, optional) – File containing the charges of ligand atoms and their corresponding atoms.
system_qm_pdb (str, optional) – Ligand PDB file with atom numbers beginning from 1.
bond_parameter_file (str, optional) – Text file containing the bond parameters for the ligand.
angle_parameter_file (str, optional) – Text file containing the angle parameters of the ligand.
system_qm_params_file (str, optional) – A text file containing the QM obtained parameters for the ligand.
reparameterised_intermediate_system_xml_file (str, optional) – XML foce field file with bond and angle parameter lines replaced by corresponding values obtained from the QM calculations.
system_xml_non_bonded_file (str, optional) – Text file to write the NonBondedForce Charge Parameters from the non-parameterised system XML file.
system_xml_non_bonded_reparams_file (str, optional) – Text file containing the non-bonded parameters parsed from the XML force field file.
reparameterised_system_xml_file (str, optional) – Reparameterized force field XML file obtained using openforcefield.
non_reparameterised_system_xml_file (str, optional) – Non-reparameterized force field XML file obtained using openforcefield.
prmtop_system_non_params (str, optional) – Amber generated topology file saved from the non-reparameterized force field XML file for the ligand.
inpcrd_system_non_params (str, optional) – Amber generated coordinate file saved from the non-reparameterized force field XML file for the ligand.
prmtop_system_params (str, optional) – Amber generated topology file saved from the reparameterized force field XML file for the ligand.
inpcrd_system_params (str, optional) – Amber generated coordinate file saved from the reparameterized force field XML file for the ligand.
load_topology (str, optional) – Argument to specify how to load the topology. Can either be “openmm” or “parmed”.
- generate_xml_antechamber(self)[source]
Generates an XML forcefield file from the PDB file through antechamber.
- generate_xml_from_pdb_smi(self)[source]
Generates an XML forcefield file from the SMILES file through openforcefield.
- generate_xml_from_pdb_sdf(self)[source]
Generates an XML forcefield file from the SDF file through openforcefield.
- generate_xml_from_charged_pdb_sdf(self)[source]
Generates an XML forcefield file for a singly charged ligand molecule from the SDF file through openforcefield.
- generate_xml_from_doubly_charged_pdb_sdf(self)[source]
Generates an XML forcefield file for a singly charged ligand molecule from the SDF file through openforcefield.
- write_system_params(self)[source]
Saves the parameters obtained from the QM log files in a text file.
- write_intermediate_reparameterised_system_xml(self)[source]
Writes a reparameterised XML force field file for ligand but without the QM obtained charges.
- write_reparameterised_system_xml(self)[source]
Writes a reparameterised XML force field file for the ligand.
- class qmmmrebind.parameterize.HostAmberXMLAmber(system_pdb='host.pdb', system_sdf='host.sdf', charge=0, system_mol2='host.mol2', system_in='host.in', system_frcmod='host.frcmod', prmtop_system='host.prmtop', inpcrd_system='host.inpcrd', system_leap='host.leap', system_xml='host.xml', sim_output='sim_output.pdb', sim_steps=1000, charge_parameter_file='host_qm_surround_charges.txt', system_qm_pdb='host_qm.pdb', bond_parameter_file='host_qm_bonds.txt', angle_parameter_file='host_qm_angles.txt', system_qm_params_file='host_qm_params.txt', reparameterised_intermediate_system_xml_file='host_intermediate_reparameterised.xml', system_xml_non_bonded_file='host_xml_non_bonded.txt', system_xml_non_bonded_reparams_file='host_xml_non_bonded_reparams.txt', reparameterised_system_xml_file='host_reparameterised.xml', non_reparameterised_system_xml_file='host.xml', prmtop_system_non_params='host_non_params.prmtop', inpcrd_system_non_params='host_non_params.inpcrd', prmtop_system_params='host_params.prmtop', inpcrd_system_params='host_params.inpcrd', load_topology='openmm')[source]
A class used to generate a template force field XML file for the receptor in order regenerate the reparameterised forcefield XML file.
This class contain methods to generate a template XML force field through openforcefield. Re-parameterized XML force field files are then generated from the template files. Different energy components such as bond, angle, torsional and non-bonded energies are computed for the non-reparametrized and the reparameterized force fields. Difference between the non-reparameterized and reparameterized force field energies can then be analyzed. …
- Variables
system_pdb (str, optional) – Receptor PDB file with atom numbers beginning from 1.
system_sdf (str, optional) – Receptor SDF (structure-data) format file.
charge (int) – Charge of the ligand.
system_mol2 (str, optional) – Receptor Mol2 file obtained from PDB file.
system_in (str, optional) – Prepi file as required by antechamber.
system_frcmod (str, optional) – FRCMOD file as required by antechamber.
prmtop_system (str, optional) – Topology file obtained from the receptor PDB.
inpcrd_system (str, optional) – Coordinate file obtained from the receptor PDB using the command saveamberparm.
system_leap (str, optional) – Amber generated leap file for generating and saving topology and coordinate files.
system_xml (str, optional) – Serilazed XML force field file of the receptor.
sim_output (str, optional) – PDB file containing the trajectory coordinates for the OpenMM simulation.
sim_steps (str, optional) – Number of steps in the OpenMM MD simulation.
charge_parameter_file (str, optional) – File containing the charges of receptor atoms and their corresponding atoms.
system_qm_pdb (str, optional) – Receptor QM region’s PDB file with atom numbers beginning from 1.
bond_parameter_file (str, optional) – Text file containing the bond parameters for the receptor.
angle_parameter_file (str, optional) – Text file containing the angle parameters of the receptor.
system_qm_params_file (str, optional) – A text file containing the QM obtained parameters for the receptor.
reparameterised_intermediate_system_xml_file (str, optional) – XML force field file with bond and angle parameter lines replaced by corresponding values obtained from the QM calculations.
system_xml_non_bonded_file (str, optional) – Text file to write the NonBondedForce Charge Parameters from the non-parameterised system XML file.
system_xml_non_bonded_reparams_file (str, optional) – Text file containing the non-bonded parameters parsed from the XML force field file.
reparameterised_system_xml_file (str, optional) – Reparameterized force field XML file obtained using openforcefield.
non_reparameterised_system_xml_file (str, optional) – Non-reparameterized force field XML file obtained using openforcefield.
prmtop_system_non_params (str, optional) – Amber generated topology file saved from the non-reparameterized force field XML file for the receptor.
inpcrd_system_non_params (str, optional) – Amber generated coordinate file saved from the non-reparameterized force field XML file for the receptor.
prmtop_system_params (str, optional) – Amber generated topology file saved from the reparameterized force field XML file for the receptor.
inpcrd_system_params (str, optional) – Amber generated coordinate file saved from the reparameterized force field XML file for the receptor.
load_topology (str, optional) – Argument to specify how to load the topology. Can either be “openmm” or “parmed”.
- generate_xml_from_pdb_sdf(self)[source]
Generates an XML forcefield file from the SDF file through openforcefield.
- generate_xml_antechamber(self)[source]
Generates an XML forcefield file from the PDB file through antechamber.
- write_system_params(self)[source]
Saves the parameters obtained from the QM log files in a text file.
- class qmmmrebind.parameterize.RunOpenMMSims(system_prmtop, system_inpcrd, system_pdb, system_xml, system_output='sim_output.pdb', sim_steps=1000)[source]
A class used to run the OpenMM simulation on any specified system.
This class contain methods to run a MD simulation to confirm the proper structure of the reparameterized forcefield files.
…
- Variables
system_prmtop (str) – Topology file of the system (receptor, ligand or receptor - ligand complex)
system_inpcrd (str) – Coordinate file of the system (receptor, ligand or receptor - ligand complex)
system_pdb (str) – PDB file of the system to run MD simulation (receptor, ligand or receptor - ligand complex).
system_xml (str) – Serialised XML file for the system.
sim_output (str, optional) – PDB file containing the trajectory coordinates for the OpenMM simulation.
sim_steps (str, optional) – Number of steps in the OpenMM MD simulation.
- class qmmmrebind.parameterize.MergeHostGuestTopology(host_prmtop, guest_prmtop, host_inpcrd, guest_inpcrd, system_prmtop, system_inpcrd)[source]
A class used to merge the host and guest topology and coordinate files.
…
- Variables
host_prmtop (str) – Topology file of the receptor.
guest_prmtop (str) – Topology file of the ligand.
host_inpcrd (str) – Coordinate file of the receptor.
guest_inpcrd (str) – Coordinate file of the ligand.
system_prmtop (str) – Topology file of the receptor - ligand complex.
system_inpcrd (str) – Coordinate file of the receptor - ligand complex.
- class qmmmrebind.parameterize.TorsionDriveSims(charge=0, multiplicity=1, reparameterised_system_xml_file='guest_reparameterised.xml', torsion_xml_file='guest_torsion_xml.txt', xyz_file='guest_coords.xyz', psi_input_file='torsion_drive_input.dat', memory=50, basis_set='6-31G', functional='B3LYP', iterations=2000, method_torsion_drive='native_opt', system_bonds_file='guest_bonds.txt', tor_dir='torsion_dir', dihedral_text_file='dihedrals.txt', template_pdb='guest_init_II.pdb', torsion_drive_run_file='run_command', dihedral_interval=15, engine='psi4', energy_threshold=1e-05)[source]
A class used to create a filetree for torsion scan using torsionsdrive for the dihedral angles of the ligand.
This class creates a directory for carrying out torsiondrive calculations followed by fitting of torsional parameters. Methods in this class are used to run torsiondrive calculations either for all of the torsional angles, or for non-hydrogen / heavy atoms contributing to the torsional angle.
…
- Variables
charge (int, optional) – Charge of the ligand.
multiplicity (int, optional) – Spin Multiplicity (2S+1) of the ligand where S represents the total spin of the ligand.
reparameterised_system_xml_file (str, optional) – Reparamaterixed XML force field for the ligand.
torsion_xml_file (str, optional) – A text file containing torsional parameters from reparameterised XML file.
xyz_file (str, optional) – XYZ file containing the coordinates of the guest molecule.
psi_input_file (str, optional) – Input file for psi4 QM engine.
memory (int, optional) – Memory (in GB) to be used.
basis_set (str, optional) – Basis set to use for the QM engine.
functional (str, optional) – Exchange/Correlation or hybrid Functional for the QM engine.
iterations (int, optional) – Maximum number of geometry optimization steps.
method_torsion_drive (str, optional) – The algorithm/package to use while running the torsiondrive scan. Using –native_opt uses QM program native constrained optimization algorithm and turns off geomeTRIC package.
system_bonds_file (str, optional) – Text file containing bond parameters for the ligand.
tor_dir (str, optional) – Torsiondrive directory containing separate torsiondrive folders, each containing files for a separate torsiondrive calculation for a particular dihedral angle.
dihedral_text_file (str, optional) – Dihedral information file for torsiondrive.
template_pdb (str, optional) – Guest PDB with atoms beginning from 1 to be used as a template PDB to retrieve atom indices and symbols.
torsion_drive_run_file (str, optional) – bash file for torsiondrive calculations.
dihedral_interval (int, optional) – Grid spacing for dihedral scan, i.e. every n degrees (where n is an integer), multiple values will be mapped to each dihedral angle.
engine (str, optional) – Engine for running torsiondrive scan.
energy_threshold (float, optional) – Only activate grid points if the new optimization is lower than the previous lowest energy (in a.u.).
- write_torsion_drive_run_file(self)[source]
Saves a bash file for running torsion scans for torsiondrive.
- write_tor_params_txt(self)[source]
Saves a text file containing torsional parameters from the reparameterized XML force field file.
- create_torsion_drive_dir(self)[source]
Creates a directory for carrying out torsiondrive calculations for all the proper dihedral angles.
- create_non_H_torsion_drive_dir(self)[source]
Creates a directory for carrying out torsiondrive calculations for all non-hydrogen torsional angles.
- class qmmmrebind.parameterize.TorsionDriveParams(num_charge_atoms='', index_charge_atom_1='', charge_atom_1='', tor_dir='torsion_dir', reparameterized_torsional_params_file='reparameterized_torsional_params.txt', psi_input_file='torsion_drive_input.dat', xyz_file='torsion_drive_input.xyz', coords_file='torsion_drive_input.txt', template_pdb='guest_init_II.pdb', system_pdb='torsion_drive_input.pdb', system_sdf='torsion_drive_input.sdf', system_xml='torsion_drive_input.xml', qm_scan_file='scan.xyz', load_topology='openmm', method='L-BFGS-B', dihedral_text_file='dihedrals.txt', system_init_sdf='torsion_drive_input_init.sdf', reparameterised_system_xml_file='guest_reparameterised.xml', reparameterised_torsional_system_xml_file='guest_torsional_reparameterized.xml')[source]
A class used to parameterize the torsional parameters of the ligand by fitting the torsional parameters obtained from torsiondrive calculations.
Previously obtained reparameterized XML forcefield file did not have the torsional parameters obtained from QM calculations. The torsional parameters obtained from torsiondrive scans are fitted and a new XML forcefield file is generated.
…
- Variables
num_charge_atoms (int, optional) – Number of charged atoms in the molecule.
index_charge_atom_1 (int, optional) – Index of the first charged atom.
charge_atom_1 (int, optional) – Charge on the first charged atom.
tor_dir (str, optional) – Torsiondrive directory containing separate torsiondrive folders, each containing files for a separate torsiondrive calculation for a particular dihedral angle.
reparameterized_torsional_params_file (str, optional) – Text file containing the forcefield parameters for the ligand previously obtained without torsional reparameterization.
psi_input_file (str, optional) – Input file for psi4 QM engine.
xyz_file (str, optional) – XYZ file for ligand coordinates.
coords_file (str, optional) – Text file containing the XYZ coordinates of the ligand.
template_pdb (str, optional) – Ligand PDB with atoms beginning from 1 to be used as a template PDB to retrieve atom indices and symbols.
system_pdb (str, optional) – PDB file for the torsiondrive torsion scans
system_sdf (str, optional) – Maximum number of geometry optimization steps.
system_xml (str, optional) – XML force field file for the ligand.
qm_scan_file (str, optional) – Output scan file for the torsiondrive scans.
load_topology (str, optional) – Argument to specify how to load the topology. Can either be “openmm” or “parmed”.
method (str, optional) – Minimization method for fitting of torsional parameters.
dihedral_text_file (str, optional) – Dihedral information file for torsiondrive.
system_init_sdf (str, optional) – Ligand SDF (structure-data) format file. This file will be generated only if the ligand is charged.
reparameterised_system_xml_file (str, optional) – Reparameterized force field XML file obtained using openforcefield without torsional reparamaterization.
reparameterised_torsional_system_xml_file (str, optional) – XML force field file for the ligand obtained with torsional reparamaterization.
- write_reparams_torsion_lines(self)[source]
Saves a text file containing torsional parameters for the ligand obtained through openforcefield.
- class qmmmrebind.parameterize.PrepareSolvatedParams(init_pdb, intermediate_pdb='intermediate.pdb', solvent_pdb='solvent.pdb', solvent_prmtop='solvent.prmtop', solvent_inpcrd='solvent.inpcrd', solvent_amber_pdb='solvent_amber.pdb', solvent_leap='solvent.leap', system_prmtop='system_torsional_params.prmtop', system_inpcrd='system_torsional_params.inpcrd', system_output='sim_output.pdb', sim_steps=1000, system_solvent_prmtop='system_qmmmrebind.prmtop', system_solvent_inpcrd='system_qmmmrebind.inpcrd', system_solvent_pdb='system_qmmmrebind.pdb')[source]
A class used to integrate the parameterized topology files of the receptor - ligand complex and the solvent.
This class contain methods to concatanate the solvent (and ions ) and the receptor - ligand complex in a single parameterized topology file (prmtop and inpcrd).
…
- Variables
init_pdb (str) – Initial PDB file containing the receptor-ligand complex with solvent, ions, etc.
intermediate_pdb (str, optional) – An intermediate PDB file formed during pdb4amber processing.
solvent_pdb (str, optional) – PDB file containing the water, ions, etc.
solvent_prmtop (str, optional) – Solvent topology file.
solvent_inpcrd (str, optional) – Solvent coordinate file.
solvent_amber_pdb (str, optional) – Solvent PDB file saved from Amber’s tleap.
solvent_leap (str, optional) – Solvent tleap file for parameterizing the solvent.
system_prmtop (str, optional) – Topology file of the receptor - ligand complex.
system_inpcrd (str, optional) – Coordinate file of the receptor - ligand complex.
system_output (str, optional) – PDB file containing the trajectory coordinates for the OpenMM simulation.
sim_steps (str, optional) – Number of steps in the OpenMM MD simulation.
system_solvent_prmtop (str, optional) – Topology file of the receptor - ligand complex and the solvent.
system_solvent_inpcrd (str, optional) – Coordinate file of the receptor - ligand complex and the solvent.
system_solvent_pdb (str, optional) – PDB file of the receptor - ligand complex and the solvent.
- parameterize_solvent_pdb(self)[source]
Generates a topology file (prmtop) and a coordinate file (inpcrd) for the solvent system.
- run_openmm_solvent_prmtop_inpcrd(self)[source]
Runs OpenMM MD simulation with prmtop and inpcrd file for the solvent.
- run_openmm_solvent_prmtop_pdb(self)[source]
Runs OpenMM MD simulation with prmtop and PDB file for the solvent.
- merge_topology_files_system_solvent(self)[source]
Merge the system and solvent topology and coordinate files.
- class qmmmrebind.parameterize.SystemAmberSystem(host_pdb='host.pdb', system_pdb='', prmtop_system='hostguest.parm7', system_xml='hostguest.xml', charge_parameter_file_guest='guest_qm_surround_charges.txt', guest_qm_pdb='guest_init_II.pdb', bond_parameter_file_guest='guest_bonds.txt', angle_parameter_file_guest='guest_angles.txt', guest_qm_params_file='guest_qm_params.txt', charge_parameter_file_host='host_qm_surround_charges.txt', bond_parameter_file_host='host_qm_bonds.txt', host_qm_pdb='host_qm.pdb', angle_parameter_file_host='host_qm_angles.txt', host_qm_params_file='host_qm_params.txt', host_guest_qm_params_file='host_guest_qm_params.txt', reparameterised_intermediate_system_xml_file='hostguest_intermediate.xml', system_xml_non_bonded_file='hostguest_non_bonded.txt', system_xml_non_bonded_reparams_file='hostguest_non_bonded_reparams.txt', reparameterised_system_xml_file='hostguest_reparameterised.xml', reparameterized_torsional_params_file='reparameterized_torsional_params.txt', reparameterised_intermediate_torsional_system_xml_file='reparameterized_torsional_params.txt', reparameterised_torsional_system_xml_file='hostguest_torsional_reparameterised.xml', load_topology='openmm', non_reparameterised_system_xml_file='hostguest.xml', prmtop_system_non_params='hostguest.parm7', inpcrd_system_non_params='hostguest_non_params.pdb', prmtop_system_intermediate_params='hostguest_intermediate.prmtop', inpcrd_system_intermediate_params='hostguest_intermediate.inpcrd', prmtop_system_params='hostguest_params.prmtop', inpcrd_system_params='hostguest_params.inpcrd')[source]
A class used to generate a force field XML file for the system from the given amber forcefield topology files and regenerate the reparameterised forcefield XML file.
This class contain methods to generate a XML force field through parmed if the amber forcefield topology files are given. Re-parameterized XML force field files are then generated from these XML focefield files. Different energy components such as bond, angle, torsional and non-bonded energies are computed for the non-reparametrized and the reparameterized force fields. Difference between the non-reparameterized and reparameterized force field energies can then be analyzed. …
Attributes
- host_pdb: str, optional
PDB file for the host.
- system_pdb: str, optional
PDB file for the system (host, guest and solvent).
- prmtop_system: str, optional
Topology file for the system (host, guest and solvent).
- system_xml: str, optional
Serialised XML forcefield file generated by parmed.
- charge_parameter_file_guest: str, optional
Receptor PDB file with atom numbers beginning from 1.
- guest_qm_pdb: str, optional
Ligand PDB file with atom numbers beginning from 1.
- bond_parameter_file_guest: str, optional
Text file containing the bond parameters for the ligand.
- angle_parameter_file_guest: str, optional
Text file containing the angle parameters of the ligand.
- guest_qm_params_file: str, optional
Text file containing QM obtained parameters for the ligand.
- charge_parameter_file_host: str, optional
File containing the charges of receptor atoms and their corresponding atoms.
- bond_parameter_file_host: str, optional
Text file containing the bond parameters for the receptor.
- host_qm_pdb: str, optional
Receptor QM region’s PDB file with atom numbers beginning from 1.
- angle_parameter_file_host: str, optional
Text file containing the angle parameters of the receptor.
- host_qm_params_file: str, optional
Text file containing QM obtained parameters for the receptor.
- host_guest_qm_params_file: str, optional
Text file containing QM obtained parameters for the system.
- reparameterised_intermediate_system_xml_file: str, optional
XML force field file with bond and angle parameter lines replaced by corresponding values obtained from the QM calculations.
- system_xml_non_bonded_file: str, optional
Text file to write the NonBondedForce Charge Parameters from the non-parameterised system XML file.
- system_xml_non_bonded_reparams_file: str, optional
Text file containing the non-bonded parameters parsed from the XML force field file.
- reparameterised_system_xml_file: str, optional
Reparameterized force field XML file obtained using openforcefield.
- reparameterized_torsional_params_filestr, optional
Text file containing the forcefield parameters for the ligand previously obtained without torsional reparameterization.
- reparameterised_intermediate_torsional_system_xml_filestr, optional
XML force field file for the system (without the QM charges) obtained with torsional reparamaterization.
- reparameterised_torsional_system_xml_filestr, optional
XML force field file for the system obtained with torsional reparamaterization.
- load_topology: str, optional
Argument to specify how to load the topology. Can either be “openmm” or “parmed”.
- non_reparameterised_system_xml_file: str, optional
Non-reparameterized force field XML file.
- prmtop_system_non_params: str, optional
Non-reparameterized topology file.
- inpcrd_system_non_params: str, optional
Non-reparameterized INPCRD file.
- prmtop_system_intermediate_params: str, optional
Reparameterized topology file but without the QM charges.
- inpcrd_system_intermediate_params: str, optional
Reparameterized INPCRD file but without the QM charges.
- prmtop_system_params: str, optional
Reparameterized topology file.
- inpcrd_system_params: str, optional
Reparameterized INPCRD file.
- generate_xml_from_prmtop(self)[source]
Generates a serialsed XML forcefield file through parmed, given the PDB file and its corresponding topology file.
- write_guest_params_non_zero(self)[source]
Saves the parameters of the ligand obtained from the QM log files in a text file starting from non-zero ( indexing begins from the index of the last atom of the receptor ).
- write_host_params(self)[source]
Saves the parameters obtained from the QM log files of the receptor in a text file.
- merge_qm_params(self)[source]
Saves the parameters of the ligand obtained from the QM log files in a text file starting from non-zero ( indexing begins from the index of the last atom of the receptor ).
- write_intermediate_reparameterised_system_xml(self)[source]
Writes a reparameterised XML force field file for the system but without the QM obtained charges.
- write_reparameterised_system_xml(self)[source]
Writes a reparameterised XML force field file for the system.
- write_torsional_reparams_intermediate(self)[source]
Generates a XML force field file for the system ( without the QM charges ) with reparameterized torsional parameters of the ligand.
- write_torsional_reparams(self)[source]
Generates a XML force field file for the system with reparameterized torsional parameters of the ligand.
- class qmmmrebind.parameterize.SystemGuestAmberSystem(host_pdb='host.pdb', system_pdb='', prmtop_system='hostguest.parm7', system_xml='hostguest.xml', charge_parameter_file_guest='guest_qm_surround_charges.txt', guest_qm_pdb='guest_init_II.pdb', bond_parameter_file_guest='guest_bonds.txt', angle_parameter_file_guest='guest_angles.txt', guest_qm_params_file='guest_qm_params.txt', reparameterised_intermediate_system_xml_file='hostguest_intermediate.xml', system_xml_non_bonded_file='hostguest_non_bonded.txt', system_xml_non_bonded_reparams_file='hostguest_non_bonded_reparams.txt', reparameterised_system_xml_file='hostguest_reparameterised.xml', reparameterized_torsional_params_file='reparameterized_torsional_params.txt', reparameterised_intermediate_torsional_system_xml_file='reparameterized_torsional_params.txt', reparameterised_torsional_system_xml_file='hostguest_torsional_reparameterised.xml', load_topology='openmm', non_reparameterised_system_xml_file='hostguest.xml', prmtop_system_non_params='hostguest.parm7', inpcrd_system_non_params='hostguest_non_params.pdb', prmtop_system_intermediate_params='hostguest_intermediate.prmtop', inpcrd_system_intermediate_params='hostguest_intermediate.inpcrd', prmtop_system_params='hostguest_params.prmtop', inpcrd_system_params='hostguest_params.inpcrd')[source]
A class used to generate a force field XML file for the system from the given amber forcefield topology files and regenerate the reparameterised forcefield XML file but without the host QM parameters.
This class contain methods to generate a XML force field through parmed if the amber forcefield topology files are given. Re-parameterized XML force field files are then generated from these XML focefield files. Different energy components such as bond, angle, torsional and non-bonded energies are computed for the non-reparametrized and the reparameterized force fields. Difference between the non-reparameterized and reparameterized force field energies can then be analyzed. …
Attributes
- host_pdb: str, optional
PDB file for the host.
- system_pdb: str, optional
PDB file for the system (host, guest and solvent).
- prmtop_system: str, optional
Topology file for the system (host, guest and solvent).
- system_xml: str, optional
Serialised XML forcefield file generated by parmed.
- charge_parameter_file_guest: str, optional
Receptor PDB file with atom numbers beginning from 1.
- guest_qm_pdb: str, optional
Ligand PDB file with atom numbers beginning from 1.
- bond_parameter_file_guest: str, optional
Text file containing the bond parameters for the ligand.
- angle_parameter_file_guest: str, optional
Text file containing the angle parameters of the ligand.
- guest_qm_params_file: str, optional
Text file containing QM obtained parameters for the ligand.
- reparameterised_intermediate_system_xml_file: str, optional
XML force field file with bond and angle parameter lines replaced by corresponding values obtained from the QM calculations.
- system_xml_non_bonded_file: str, optional
Text file to write the NonBondedForce Charge Parameters from the non-parameterised system XML file.
- system_xml_non_bonded_reparams_file: str, optional
Text file containing the non-bonded parameters parsed from the XML force field file.
- reparameterised_system_xml_file: str, optional
Reparameterized force field XML file obtained using openforcefield.
- reparameterized_torsional_params_filestr, optional
Text file containing the forcefield parameters for the ligand previously obtained without torsional reparameterization.
- reparameterised_intermediate_torsional_system_xml_filestr, optional
XML force field file for the system (without the QM charges) obtained with torsional reparamaterization.
- reparameterised_torsional_system_xml_filestr, optional
XML force field file for the system obtained with torsional reparamaterization.
- load_topology: str, optional
Argument to specify how to load the topology. Can either be “openmm” or “parmed”.
- non_reparameterised_system_xml_file: str, optional
Non-reparameterized force field XML file.
- prmtop_system_non_params: str, optional
Non-reparameterized topology file.
- inpcrd_system_non_params: str, optional
Non-reparameterized INPCRD file.
- prmtop_system_intermediate_params: str, optional
Reparameterized topology file but without the QM charges.
- inpcrd_system_intermediate_params: str, optional
Reparameterized INPCRD file but without the QM charges.
- prmtop_system_params: str, optional
Reparameterized topology file.
- inpcrd_system_params: str, optional
Reparameterized INPCRD file.
- generate_xml_from_prmtop(self)[source]
Generates a serialsed XML forcefield file through parmed, given the PDB file and its corresponding topology file.
- write_guest_params_non_zero(self)[source]
Saves the parameters of the ligand obtained from the QM log files in a text file starting from non-zero ( indexing begins from the index of the last atom of the receptor ).
- write_intermediate_reparameterised_system_xml(self)[source]
Writes a reparameterised XML force field file for the system but without the QM obtained charges.
- write_reparameterised_system_xml(self)[source]
Writes a reparameterised XML force field file for the system.
- write_torsional_reparams_intermediate(self)[source]
Generates a XML force field file for the system ( without the QM charges ) with reparameterized torsional parameters of the ligand.
- write_torsional_reparams(self)[source]
Generates a XML force field file for the system with reparameterized torsional parameters of the ligand.