3.2. ligandparam.recipes.freeligand

class ligandparam.recipes.freeligand.FreeLigand(in_filename: Path | str, cwd: Path | str, *args, **kwargs)[source]

Bases: Recipe

This is a class for parametrizing a ligand that is free in solution.

This class is designed to follow what has been the York group’s best practices for parametrizing ligands. If your ligand is weird in any way, you should use a different class.

This class does a parametrization using Gaussian and Antechamber, using also a multi-state RESP calculation.

The steps are:

  1. Initialize the ligand using the PDB file.

  2. Normalize the charges to preserve neutrality.

  3. Minimize the ligand using Gaussian (a) At a low level of theory (b) At a high level of theory (c) Calculate the RESP charges using Gaussian at the low level of theory.

  4. Rotate the ligand to sample grid-based errors in resp charges

  5. Add the gaussian charges to a mol2 file.

  6. Perform a multi-state RESP fit.

  7. Update the charges in the mol2 file from the multistate fit.

  8. Normalize the charges to preserve neutrality.

  9. Update the atom types in the mol2 file to match the gaussian output.

  10. Use parmchk to generate the frcmod file.

  11. Generate the lib file with leap.

Methods

add_stage(stage)

Add a stage to the list of stages to run.

clean()

Clean up the files created by the stages.

execute([dry_run, nproc, mem])

Execute the stages in the list of stages to run.

insert_stage(newstage, stage_name[, print_info])

Insert a stage into the list of stages to run before the specified stage.

list_stages()

Print out the list of stages to run.

remove_stage(stage_name)

Remove a stage from the list of stages to run.

add_leaprc

setup

The rough approach to using this class is to generate a new Parametrization class, and then generate self.stages as a list of stages that you want to run. :param in_filename: The in_filename of the ligand. :type in_filename: str :param cwd: The current working directory. :type cwd: Union[Path, str] :param *args: Additional positional arguments. :param **kwargs: Additional keyword arguments.

Keyword Arguments:
  • name (str) – The base name for the ligand.

  • inputoptions (dict) – A dictionary of input options, which should include ‘name’ or ‘pdb_filename’.

Raises:

ValueError – If neither ‘name’ nor ‘pdb_filename’ is provided in inputoptions.

Methods

add_stage(stage)

Add a stage to the list of stages to run.

clean()

Clean up the files created by the stages.

execute([dry_run, nproc, mem])

Execute the stages in the list of stages to run.

insert_stage(newstage, stage_name[, print_info])

Insert a stage into the list of stages to run before the specified stage.

list_stages()

Print out the list of stages to run.

remove_stage(stage_name)

Remove a stage from the list of stages to run.

add_leaprc

setup

execute(dry_run=False, nproc: int | None = None, mem: int | None = None) Any[source]

Execute the stages in the list of stages to run.

This function executes the stages in the list of stages to run. The stages are executed in the order that they were added to the list. If a stage fails, the function will print an error message and exit. The stages are

Parameters:

dry_run (bool, optional) – If True, the stages will not be executed, but the function will print the commands that would be executed.

Return type:

None

setup()[source]