mispr.lammps.utilities package

Submodules

mispr.lammps.utilities.opls module

Implements a core class MaestroRunner for assigning force field parameters on a molecule using Maestro software.

class mispr.lammps.utilities.opls.MaestroRunner(name, input_file, mae_cmd=None, ffld_cmd=None, working_dir=None)[source]

Bases: object

Wrapper for assigning OPLS_2005 force field parameters for a molecule using Maestro software of Schrondinger. The OPLS_2005 parameters are described in:

Banks, J.L.; Beard, H.S.; Cao, Y.; Cho, A.E.; Damm, W.; Farid, R.; Felts, A.K.; Halgren, T.A.; Mainz, D.T.; Maple, J.R.; Murphy, R.; Philipp, D.M.; Repasky, M.P.; Zhang, L.Y.; Berne, B.J.; Friesner, R.A.; Gallicchio, E.; Levy. R.M. Integrated Modeling Program, Applied Chemical Theory (IMPACT). J. Comp. Chem. 2005, 26, 1752.

The OPLS_2005 parameters are located in (you need to replace the version in the path with the correct Schrondinger version installed):

$SCHRODINGER/mmshare-vversion/data/f14/

To use this class, you need to do the following:

  1. Download the free version of Maestro (https://www.schrodinger.com/freemaestro)

  2. Install Maestro and set the environment variable $SCHRODINGER, e.g., ‘export SCHRODINGER=/opt/schrodinger/suites2022-2’. Check https://www.schrodinger.com/kb/1842 for more details.

Parameters:
name : str

Name of the molecule to use when saving the mae and log files generated by Maestro.

input_file : str

Molecule/structure file to use for converting to a mae file. For a full list of supported formats, check https://www.schrodinger.com/kb/1278.

mae_cmd : str

Full command to use for converting the structure format to mae file; if not specified, will try to parse the command from the MISPR configuration file.

ffld_cmd : str

Full command to use for generating the force field parameters from the mae file. If not specified, will try to parse the command from the MISPR configuration file.

working_dir : str

Working directory where the input_file is located and Maestro files to be generated.

cleanup()[source]

Deletes the log and mae files created by Maestro

convert_ff_log_to_json()[source]

Converts the force field parameters in the log file to a dictionary format that is compatible with MISPR.

convert_mol_to_mae()[source]

Converts a structure input file to a mae file.

get_ff_log()[source]

Generates a log file with force field parameters using a mae file.

get_opls_params(cleanup=True)[source]

Wrapper function that converts input structure to mae format, uses it to generate a log file with the force field parameters of the molecule, parses the log file to generate a dictionary of force parameters in a format compatible with the lammps workflow in MISPR, and optionally cleans up the working directory by removing the intermediate files generated in the process.

Parameters:
cleanup : bool

Whether to clean up the working directory. Defaults to True.

Returns:

Dictionary with force field parameters.

Return type:

dict

mispr.lammps.utilities.utilities module

Define lammps utility functions.

mispr.lammps.utilities.utilities.add_ff_labels_to_BADI_lists(ff_list, label)[source]

Add extra string to the end of all atom type labels in lists containing information about Bonds, Angles, Dihedrals, or Impropers (BADI). This function is intended to be used through the add_ff_labels_to_dict.

Parameters:
ff_list : List

The value from ff_dict using one of the following keys: ‘Bonds’, ‘Angles’, ‘Dihedrals’, or ‘Impropers’. The form of this list should be as follows:

[{'coeffs': [Float, ...], 'types': [(Str, ...), ...]}, ...]

label : str

A label for the molecular species that is unique for the system being created.

mispr.lammps.utilities.utilities.add_ff_labels_to_dict(ff_dict, label)[source]
Parameters:
ff_dict

A dictionary containing the force field information for a molecule. The dictionary should have the following form:

{
    "Molecule": pmg.Molecule,
    "Labels": List,
    "Masses": OrderedDict,
    "Nonbond": List,
    "Bonds": [{'coeffs': [a, b], 'types': [('x1', 'x2'), ...]}, ...],
    "Angles": [{'coeffs': [a, b], 'types': [('x1', 'x2', 'x3'), ...]}, ...],
    "Dihedrals": [{'coeffs': [a, b, c], 'types': [('x1', 'x2', 'x3', 'x4), ...]}, ...],
    "Impropers": [{'coeffs': [a, b, c], 'types': [('x1', 'x2', 'x3', 'x4), ...]}, ...],
    "Improper Topologies": List,
    "Charges": np.Array,
    ...
}

label : str

mispr.lammps.utilities.utilities.get_db(input_db=None)[source]
mispr.lammps.utilities.utilities.lammps_mass_to_element(lammps_masses)[source]

Create a dict for mapping atom mass to element.

Parameters:
lammps_masses : list

List of masses in lammps units.

Returns:

dict

mispr.lammps.utilities.utilities.process_ff_doc(parameter_dict, method=None, doi=None, **kwargs)[source]
mispr.lammps.utilities.utilities.process_run(smiles, nmols, box, template_filename, control_settings=None)[source]
mispr.lammps.utilities.utilities.run_fake_lammps(workflow, ref_dirs, control_filenames=None)[source]

Module contents