ProtoCaller.Ensemble.Ligand module

The Ligand class keeps track of ligand instantiation, minimisation, protonation and parametrisation. It consists of an RDKit object and, when parametrised, a link to the parameter files.

This means that this class has to be provided with complete atom and bond information. This can be done using: SMILES strings, InChI strings, files which keep track of bond connectivity (such as SDF, MOL, MOL2) or an RDKit object. It is also highly advisable to not use SMILES/InChI strings when possible, since these provide no 3D information which is crucial if there are multiple conformational minima. Different conformations will lead to different force field charges and therefore non-reproducible results. Moreover, 1D identifiers are usually not very good at providing protonation state/tautomer information which can be important, depending on the system.

The user can also instantiate the ligand with parameter coordinate and topology files but still needs to provide some bond connectivity information. In this case SMILES/InChI strings are not an issue.

class ProtoCaller.Ensemble.Ligand.Ligand(input, parametrised_files=None, name=None, protonated=False, minimise=None, workdir='.')

Bases: object

The main class responsible for handling ligands and cofactors in ProtoCaller.

Parameters
  • input (str or rdkit.Chem.rdChem.Mol) – Initialises the ligand from a SMILES string, InChI string, file or an RDKit Mol object.

  • parametrised_files ([str]) – Initialises the parametrised file(s).

  • name (str or None) – Initialises the ligand name.

  • protonated (bool) – Whether the input corresponds to the protonated or deprotonated state of the molecule. Ignored when parametrised files are passed.

  • minimise (bool or None) – Initialises minimise. Ignored when parametrised files are passed.

  • workdir (str, optional) – Initialises workdir.

name

The ligand name. Default: e.g. “ligand1” for the first instantiated Ligand object.

Type

str

workdir

The working directory of the ligand.

Type

ProtoCaller.Utils.fileio.Dir

minimise

Whether to perform a GAFF minimisation using OpenBabel. None means minimisation for molecules initialised from strings and no minimisation for molecules initialised from files.

Type

bool

property molecule

The rdkit.Chem.rdChem.Mol object of the ligand.

property name

The name of the ligand

parametrise(params=None, molecule_type='ligand', id=None, reparametrise=False)

Parametrises the ligand using ProtoCaller.Parametrise.

Parameters
  • params (ProtoCaller.Parametrise.Params) – Force field parameters.

  • molecule_type (str) – The type of the molecule. One of: “ligand” and “cofactor”.

  • id (str) – The name of the molecule. Default: equal to the ligand name.

  • reparametrise (bool) – Whether to reparametrise an already parametrised ligand.

property parametrised

Whether the ligand has been parametrised.

property parametrised_files

The absolute path(s) to the parametrised file(s).

protonate(reprotonate=False, babel_parameters=None, rdkit_parameters=None)

Protonates the ligand using OpenBabel.

Parameters
  • reprotonate (bool) – Whether to reprotonate an already protonated ligand.

  • babel_parameters (dict) – Keyword arguments to be passed to ProtoCaller.Wrappers.babelwrapper

  • rdkit_parameters (dict) – Keyword arguments to be passed to ProtoCaller.Wrappers.rdkitwrapper

property protonated

Whether the ligand has been protonated.

property protonated_filename

The absolute path to the protonated file.

property string

The SMILES string of the ligand.