mispr.lammps.firetasks package¶

Submodules¶

mispr.lammps.firetasks.parse_outputs module¶

Define firetasks for reading output of Ambertools programs and LAMMPS.

class mispr.lammps.firetasks.parse_outputs.CalcCN(*args, **kwargs)[source]¶

Bases: FiretaskBase

Calculate the coordination number (CN) of a system. The CN is calculated for each atom type in the system and saved to a file. The CN can be calculated for atomic or molecular systems.

Parameters:¶
working_dir : str, optional

Path to the working directory. Defaults to the current working directory.

cn_settings : dict, optional

A dictionary containing the settings for the CN calculation based on the calc_atomic_cn and calc_molecular_cn functions. Refer to the mdproptools.structural.rdf_cn module for more information.

run_task(fw_spec)[source]¶

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:¶
fw_spec : dict¶

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:¶

(FWAction)

class mispr.lammps.firetasks.parse_outputs.CalcDiff(*args, **kwargs)[source]¶

Bases: FiretaskBase

Calculate the diffusion coefficient of a system using the mean squared displacement (MSD) method. The MSD is either calculated from the trajectory dump files or read from the log file. The diffusion coefficient is then calculated from the MSD using the Einstein relation.

Parameters:¶
working_dir : str, optional

Path to the working directory. Defaults to the current working directory.

diff_settings : dict, optional

A dictionary containing the settings for the diffusion calculation based on the Diffusion object. Refer to the mdproptools.dynamical.diffusion module for more information. The dictionary might contain the following keys:

  • timestep (float): The timestep used in the simulation.

  • units (str): The unit type used in the LAMMPS simulations.

  • msd_method (str): The method used to calculate the MSD. Supported methods are “from_dump” and “from_log”.

  • num_mols (list, optional): A list containing the number of molecules of each type in the system. Required if the msd_method is “from_dump”.

  • num_atoms_per_mol (list, optional): A list containing the number of atoms in each molecule. Required if the msd_method is “from_dump”.

  • mass (list, optional): A list containing the masses of each LAMMPS atom type in the system. Required if the msd_method is “from_dump”.

  • file_pattern (str, optional): The pattern used to match the dump files. Defaults to “dump.nvt.*.dump” if calculating from dump and “log.lammps*” if calculating from log.

  • avg_interval (bool, optional): Whether to calculate the MSD for individual particles or not. If False, the MSD will be averaged for each particle type. Defaults to False. Only used if the msd_method is “from_dump”.

  • diff_dist (bool, optional): Whether to calculate the diffusion distribution. Defaults to False. Only used if the msd_method is “from_dump”.

  • outputs_dir (str, optional): Path to the directory containing the dump files. Defaults to “working_dir/../../nvt”.

run_task(fw_spec)[source]¶

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:¶
fw_spec : dict¶

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:¶

(FWAction)

class mispr.lammps.firetasks.parse_outputs.ExtractClusters(*args, **kwargs)[source]¶

Bases: FiretaskBase

Extract atomic clusters from a trajectory file. The clusters are extracted based on the cutoff radius and saved to separate files. The clusters can be extracted from the full trajectory or a single frame.

Parameters:¶
working_dir : str, optional

Path to the working directory. Defaults to the current working directory.

cluster_settings : dict, optional

A dictionary containing the settings for the cluster extraction based on the get_clusters and get_unique_configurations functions. Refer to the mdproptools.structural.cluster_analysis module for more information.

run_task(fw_spec)[source]¶

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:¶
fw_spec : dict¶

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:¶

(FWAction)

class mispr.lammps.firetasks.parse_outputs.GetRDF(*args, **kwargs)[source]¶

Bases: FiretaskBase

Calculate the radial distribution function (RDF) of a system. The RDF is calculated for each atom type in the system and saved to a file. The RDF can be calculated for atomic or molecular systems.

Parameters:¶
working_dir : str, optional

Path to the working directory. Defaults to the current working directory.

rdf_settings : dict, optional

A dictionary containing the settings for the RDF calculation based on the calc_atomic_rdf and calc_molecular_rdf functions. Refer to the mdproptools.structural.rdf_cn module for more information.

run_task(fw_spec)[source]¶

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:¶
fw_spec : dict¶

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:¶

(FWAction)

class mispr.lammps.firetasks.parse_outputs.ProcessAnalysis(*args, **kwargs)[source]¶

Bases: FiretaskBase

Process the analysis calculations and saves the results to the database and/or a file.

Parameters:¶
analysis_list : list

A list of the analysis calculations to process. Supported analysis calculations are “diffusion”, “rdf”, “cn”, and “clusters”.

db : str, optional

The connection information of the database to save the analysis results to. If not provided, the connection information will be read from the db.json file.

save_analysis_to_db : bool, optional

Whether to save the analysis results to the database. Defaults to False.

save_analysis_to_file : bool, optional

Whether to save the analysis results to a file in the working_dir. Defaults to True.

working_dir : str, optional

Path to the working directory. Defaults to the current working directory.

run_task(fw_spec)[source]¶

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:¶
fw_spec : dict¶

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:¶

(FWAction)

class mispr.lammps.firetasks.parse_outputs.ProcessPrmtop(*args, **kwargs)[source]¶

Bases: FiretaskBase

Parse the prmtop file to extract force field parameters and saves them to a file and/or database in the format required by the LammpsDataWrapper class in the pymatgen.io.lammps.data module.

Parameters:¶
molecule : Molecule, optional

A pymatgen Molecule object of the molecule. The order of the atoms in the Molecule object should match the order of the atoms used when generating the prmtop file. If not provided, the molecule will be read from the previous calculation in the fw_spec.

working_dir : str, optional

Path to the working directory. Defaults to the current working directory.

db : str, optional

The connection information of the database to save the force field parameters to. If not provided, the connection information will be read from the db.json file.

prmtop_path : str, optional

Path to the prmtop file. If not provided, will try to get the path based on the prmtop_filename and prmtop_dir.

prmtop_filename : str, optional

Name of the prmtop file. Only read if the prmtop_path is not provided.

prmtop_dir : str, optional

Path to the directory containing the prmtop file. Only read if the prmtop_path is not provided. Defaults to working_dir.

unique_molecule_name : str, optional

A unique name for the molecule. If not provided, the formula of the molecule will be used.

system_force_field_dict : dict, optional

A dictionary containing the force field parameters for the system. Will be used as input for LammpsDataWrapper. Only read if this dict is not already in the fw_spec. Will be saved to the fw_spec after processing the prmtop file. Defaults to an empty dict.

doi : str, optional

Digital Object Identifier for the force field used. Defaults to the GAFF DOI.

save_ff_to_db : bool, optional

Whether to save the force field parameters to the database. Defaults to False.

save_ff_to_file : bool, optional

Whether to save the force field parameters to a file in the working_dir. Defaults to True.

ff_filename : str, optional

Name of the file to save the force field parameters to. Defaults to “ff.json”.

run_task(fw_spec)[source]¶

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:¶
fw_spec : dict¶

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:¶

(FWAction)

mispr.lammps.firetasks.run module¶

Define firetasks for running LAMMPS simulations and AmberTools.

class mispr.lammps.firetasks.run.RunAntechamber(*args, **kwargs)[source]¶

Bases: FiretaskBase

Run the Antechamber program. Intented to be used to generate the partial charges for the molecule in a mol2 file from a Gaussian ESP file. Refer to the AmberTools documentation for more information on this program: https://ambermd.org/AmberTools.php.

Parameters:¶
working_dir : str, optional

The directory to run Antechamber in. Defaults to the current working directory.

input_filename_a : str, optional

The name of the input file. Defaults to “mol.esp”.

input_file_type : str, optional

The type of the input file. Defaults to “gesp”.

output_filename_a : str, optional

The name of the output file. Defaults to “mol.mol2”.

output_file_type : str, optional

The type of the output file. Defaults to “mol2”.

charge_method : str, optional

The method to calculate the partial charges. Defaults to “resp”.

antechamber_cmd : str, optional

The command to run Antechamber. If not provided, the command will be read from the “config.ini” file.

run_task(fw_spec)[source]¶

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:¶
fw_spec : dict¶

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:¶

(FWAction)

class mispr.lammps.firetasks.run.RunLammpsDirect(*args, **kwargs)[source]¶

Bases: FiretaskBase

Run a LAMMPS simulation from a single control file.

Parameters:¶
working_dir : str, optional

The directory to run the simulation in. Defaults to the current working directory. file.

control_filename : str, optional

Name of the LAMMPS control file. Defaults to “complex.lammpsin”.

lammps_cmd : str, optional

The command to run LAMMPS. If not provided, the command will attempt to read from the “config.ini” file.

net_ntasks : int, optional

The number of processors to run the simulation on. If not provided, the number of processors will be read from the fw_spec based on the number of nodes used and the number of tasks per node.

run_task(fw_spec)[source]¶

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:¶
fw_spec : dict¶

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:¶

(FWAction)

class mispr.lammps.firetasks.run.RunLammpsFake(*args, **kwargs)[source]¶

Bases: FiretaskBase

Run a fake LAMMPS simulation.

Parameters:¶
ref_dir : str

The directory containing the reference LAMMPS files.

working_dir : str, optional

The directory to run the fake simulation in. Defaults to the current working directory.

control_filename : str, optional

The name of the LAMMPS control file. Defaults

"complex.lammpsin". : to

run_task(fw_spec)[source]¶

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:¶
fw_spec : dict¶

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:¶

(FWAction)

class mispr.lammps.firetasks.run.RunMaestro(*args, **kwargs)[source]¶

Bases: FiretaskBase

Run the Maestro program using the MaestroRunner class in the mispr.lammps.utilities.opls module to generate OPLS force field parameters for a molecule. After generating the parameters, add these parameters to the spec. Refer to the Maestro documentation for more information on this program: https://www.schrodinger.com/maestro.

Parameters:¶
input_file : str

The path to the input file.

label : str, optional

The label for the molecule. Defaults to the molecule’s formula.

molecule : Molecule, optional

The molecule to generate force field parameters for. If not provided, the molecule will be read from the input file.

mae_cmd : str, optional

The command to run the structconvert utility program. If not provided, the command will be read from the “config.ini” file.

ffld_cmd : str, optional

The command to run the ffld_server utility program. If not provided, the command will be read from the “config.ini” file.

working_dir : str, optional

The directory to run Maestro in. Defaults to the current working directory.

maestro_cleanup : bool, optional

Whether to clean up the Maestro files after running. Defaults to False.

db : str, optional

The connection information of the database to save the force field parameters to. If not provided, the connection information will be read from the “db.json” file.

save_ff_to_db : bool, optional

Whether to save the force field parameters to a database. Defaults to False.

save_ff_to_file : bool, optional

Whether to save the force field parameters to a file. Defaults to True.

ff_filename : str, optional

The name of the file to save the force field parameters to. Defaults to “ff.json”.

system_force_field_dict : dict, optional

A dictionary to store the force field parameters for multiple molecules. This is only needed if this dictionary is not already in the fw_spec. If this dict is not in the fw_spec or provided by the user, an empty dict will be created.

run_task(fw_spec)[source]¶

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:¶
fw_spec : dict¶

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:¶

(FWAction)

class mispr.lammps.firetasks.run.RunParmchk(*args, **kwargs)[source]¶

Bases: FiretaskBase

Run the Parmchk program. Intended to be used to generate a frcmod file from a mol2 file. Refer to the AmberTools documentation for more information on the Parmchk program: https://ambermd.org/AmberTools.php.

Parameters:¶
working_dir : str, optional

The directory to run Parmchk in. Defaults to the current working directory.

input_filename_p : str, optional

The name of the input file. Defaults to “mol.mol2”.

output_filename_p : str, optional

The name of the output file. Defaults to “mol.frcmod”.

parmchk_cmd : str, optional

The command to run Parmchk. If not provided, the command will be read from the “config.ini” file.

run_task(fw_spec)[source]¶

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:¶
fw_spec : dict¶

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:¶

(FWAction)

class mispr.lammps.firetasks.run.RunTleap(*args, **kwargs)[source]¶

Bases: FiretaskBase

Run the Tleap program. Intended to be used to generate the GAFF parameters for a single molecular species into a prmtop file from a mol2 file and a frcmod file. Refer to the AmberTools documentation for more information on this program: https://ambermd.org/AmberTools.php.

Parameters:¶
working_dir : str, optional

The directory to run Tleap in. Defaults to the current working directory.

script_filename : str, optional

The name of the script file. Defaults to “tleap.in”.

tleap_cmd : str, optional

The command to run Tleap. If not provided, the command will be read from the “config.ini” file.

run_task(fw_spec)[source]¶

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:¶
fw_spec : dict¶

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:¶

(FWAction)

mispr.lammps.firetasks.write_inputs module¶

Define firetasks for writing LAMMPS input files.

class mispr.lammps.firetasks.write_inputs.LabelFFDict(*args, **kwargs)[source]¶

Bases: FiretaskBase

Append molecule label to all atom labels in the force field dictionary. Ensures that no two molecules can share the same atom labels provided that each molecule has a unique label for the system.

Parameters:¶
mol : Molecule, optional

pymatgen Molecule object; if not provided, the

used. : prev_calc_molecule key from the fw_spec will be

unlabeled_dict : dict, optional

Dictionary containing the force field parameters for the molecule; ignored if the ff_file is provided.

ff_file : str, optional

Path to the json file containing the force field parameters for the molecule.

working_dir : str, optional

Path to the working directory. Defaults to current working directory.

label : str, optional

Label for the molecule. Defaults to the molecular formula.

system_force_field_dict : dict, optional

Dictionary containing the force field parameters for the system that is used as the input for LammpsDataWrapper object; intended to be obtained from the spec; if present in the spec, this will be ignored.

run_task(fw_spec)[source]¶

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:¶
fw_spec : dict¶

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:¶

(FWAction)

class mispr.lammps.firetasks.write_inputs.LabelFFDictFromDB(*args, **kwargs)[source]¶

Bases: FiretaskBase

Append molecule label to all atom labels in a force field dictionary obtained from the database. Ensures that no two molecules can share the same atom labels provided that each molecule has a unique label for the system.

Parameters:¶
filter : dict

Dictionary containing the filter used to query the database.

working_dir : str, optional

Path to the working directory. Defaults to current working directory.

db : dict or str, optional

Information for connecting to the database as either a dictionary of credentials or a path to a json file containing the credentials; if not provided, the database specified in the env will be used.

label : str, optional

Label for the molecule. Defaults to the molecular formula.

system_force_field_dict : dict, optional

Dictionary containing the force field parameters for the system that is used as the input for LammpsDataWrapper object; intended to be obtained from the spec; if present in the spec, this will be ignored.

run_task(fw_spec)[source]¶

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:¶
fw_spec : dict¶

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:¶

(FWAction)

class mispr.lammps.firetasks.write_inputs.WriteControlFile(*args, **kwargs)[source]¶

Bases: FiretaskBase

Write a LAMMPS control file based on a template file or string.

Parameters:¶
working_dir : str, optional

Path to working directory. Default is current working directory.

db : str or dict, optional

Connection information for the calc database; If save_runs_to_db is True, then a document will be stored in the database. Default is None.

control_filename : str, optional

Name of control file to be written. Default is “complex.lammpsin”.

template_filename : str, optional

Name of template control file to be used. Is not used if template_str is provided. Can refer to a custom template or a template name from the mispr/lammps/templates directory.

template_dir : str, optional

Path to directory containing template file. If the template is from mispr/lammps/templates, then this is not needed.

template_str : str, optional

String containing template for control file.

control_settings : dict, optional

Dictionary of settings to be used in the control file. If a mispr template is used, this dictionary will update the corresponding control_settings dictionary in the mispr/lammps/defaults.py file. Default is None.

save_runs_to_db : bool, optional

Whether to save the run info to the calc database. Default is False.

save_runs_to_file : bool, optional

Whether to save the run info to a file in the working directory. Default is True.

lammpsin_key : str, optional

Key in the fw_spec that corresponds with the run_doc information. Default is “lammpsin”.

run_task(fw_spec)[source]¶

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:¶
fw_spec : dict¶

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:¶

(FWAction)

class mispr.lammps.firetasks.write_inputs.WriteDataFile(*args, **kwargs)[source]¶

Bases: FiretaskBase

Write LAMMPS data file for a bulk system in the current working directory. User can provide a LammpsData object, a LammpsDataWrapper object, or the inputs for instantiating a LammpsDataWrapper object. See the LammpsData and LammpsDataWrapper classes in the pymatgen.io.lammps.data module for more information.

Parameters:¶
working_dir : str, optional

Path to the working directory. Defaults to the current working directory.

data_filename : str, optional

Name of data file to be written. Defaults to “complex.data”.

lammps_data : LammpsData, optional

The LammpsData object to be written as the data file. Can be passed through the fw_spec or input by the user. If both are provided, the one provided directly will be used.

lammps_data_wrapper : LammpsDataWrapper, optional

The wrapper for the LammpsData object to be written as data file. Can be passed through fw_spec or input by the user. If both are provided, the one provided directly will be used. Will be ignored if lammps_data is provided.

system_force_field_dict : dict, optional

The force field parameters for the system. Used as input for LammpsDataWrapper. Intended to be created by the GetForceField task. Can be passed through fw_spec or input by the user. If both are provided, will take the one provided in the fw_spec.

system_mixture_data : dict, optional

The information that will be used to calculate the number of molecules of each type in the system. Used as input for a LammpsDataWrapper object. Can be read from fw_spec or input by the user; If both are provided, will use the one provided in the fw_spec.

system_box_data : float, int, list, ndarray, optional

Information about the system box; the value of this arg is determined by the system_box_data_type. Used as input for a LammpsDataWrapper object. Can be passed through fw_spec or input by the user. If both are provided, will take the one provided in the fw_spec.

system_box_data_type : str, optional

Determines the type for system_box_data. Used as input for a LammpsDataWrapper object. Defaults to “cubic”.

position_seed : int, optional

Seed for randomizing the positions of atoms. Indirectly used as input for packmol through LammpsDataWrapper. Defaults to 150.

system_mixture_data_type : str, optional

Determines the content of system_mixture_data. Used as input for a LammpsDataWrapper object. Defaults to “concentration”.

scale_charges : bool, optional

Whether to scale the partial charges of all molecules that have a non-zero net charge in the system. Only used if building a system from LammpsDataWrapper inputs.

charge_scaling_factor : float

Factor by which to scale charges in the system. Only used if building a system from LammpsDataWrapper inputs and if scale_charges is True.

run_task(fw_spec)[source]¶

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:¶
fw_spec : dict¶

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:¶

(FWAction)

class mispr.lammps.firetasks.write_inputs.WriteTleapScript(*args, **kwargs)[source]¶

Bases: FiretaskBase

Write a tleap script for generating a prmtop and inpcrd file for a molecule. Intended to be used to obtain the parameters from the GAFF force field.

Parameters:¶
working_dir : str

Path to the working directory. Defaults to current working directory.

script_string : str

String containing the tleap script. If not provided, the template_filename and template_dir must be provided.

template_filename : str

Name of the template file. Defaults to “gaff_tleap”.

template_dir : str

Path to the directory containing the template file. Defaults to the mispr/lammps/templates/ directory.

tleap_settings : dict

Dictionary containing the settings for the tleap script. Used to update the TLEAP_SETTINGS dict in mispr/lammps/defaults.py file. Defaults to empty dict.

script_filename : str

Name of the tleap script file. Defaults to “tleap.in”.

run_task(fw_spec)[source]¶

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:¶
fw_spec : dict¶

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:¶

(FWAction)

Module contents¶