schrodinger.application.transforms.ligprep module

class schrodinger.application.transforms.ligprep.LigandPrep(arg_string: str = '', filter_string: str = '')

Bases: PTransform

A PTransform that ligpreps molecules.

Example usage:

>>> benzene = Chem.MolFromSmiles('c1ccccc1')
>>> with beam.Pipeline() as p:
...     ligprepped_benzene = (p
...         | beam.Create([benzene])
...         | LigandPrep()
...         | beam.Map(lambda mol: Chem.MolToSmiles(mol))
...         | beam.LogElements())
c1ccccc1

NOTE:: If the input is a Mol PCollection, the Mol will first be converted to a Structure and then ligprep will be run on the Structure. The output will be a Mol PCollection. If any structures fail to convert to Mols, they will be dropped from the output.

Parameters:
  • arg_string – command line arguments to pass to ligprep, e.g. ‘-nt’, or ‘-nt -bff 16 -epik -s 32’.

  • filter_string – a filter string to pass to ligprep.

Note: the filter_string is a single string, so if multiple filters are needed they need to be separated by “n”.

__init__(arg_string: str = '', filter_string: str = '')
classmethod validate(arg_string: str = '', ligprep_filter_path: pathlib.Path | str = '') None
Parameters:
  • arg_string – command line arguments to pass to ligprep,

  • ligprep_filter_path – filename or path to the ligprep filter file.

Raises:

ValueError – if any of the arguments are invalid.

Note: the contents of the ligprep filter file is not validated, only its existence is checked.

expand(pcoll: PCollection[T])
classmethod FromFile(path: Union[str, Path], *, arg_string: str)
Parameters:
  • path – the path to the ligprep filter file.

  • arg_string – the command line arguments to pass to ligprep excluding the input and output arguments.

class schrodinger.application.transforms.ligprep.LigandPrepperDoFn(arg_string: str)

Bases: _GetLicenseHintsMixin, LigandPrepperDoFn

schrodinger.application.transforms.ligprep.validate_opls_license(arg_string: str) None

Check if the FFLD_OPLS_MAIN license is available if a opls version > 14 is specified in the command line arguments.

Parameters:

arg_string – command line arguments to pass to ligprep,

schrodinger.application.transforms.ligprep.remove_bff(arg_string: str) str

Remove the -bff argument from the command line arguments.

Parameters:

arg_string – command line arguments to pass to ligprep,

Returns:

the command line arguments without the -bff argument.

schrodinger.application.transforms.ligprep.validate_arg_string(arg_string: str)