nanoCAT.recipes.charges
A short recipe for calculating and rescaling ligand charges.
Index
|
Calculate and rescale the ligand charges using MATCH. |
API
- nanoCAT.recipes.get_lig_charge(ligand, desired_charge, ligand_idx=None, invert_idx=False, settings=None, path=None, folder=None)[source]
Calculate and rescale the ligand charges using MATCH.
The atomic charges in ligand_idx wil be altered such that the molecular charge of ligand is equal to desired_charge.
Examples
>>> import pandas as pd >>> from scm.plams import Molecule >>> from CAT.recipes import get_lig_charge >>> ligand = Molecule(...) >>> desired_charge = 0.66 >>> ligand_idx = 0, 1, 2, 3, 4 >>> charge_series: pd.Series = get_lig_charge( ... ligand, desired_charge, ligand_idx ... ) >>> charge_series.sum() == desired_charge True
- Parameters:
ligand (
Molecule
) – The input ligand.desired_charge (
float
) – The desired molecular charge of the ligand.ligand_idx (
int
orIterable
[int
], optional) – An integer or iterable of integers representing atomic indices. The charges of these atoms will be rescaled; all others will be frozen with respect to the MATCH output. Setting this value toNone
means that all atomic charges are considered variable. Indices should be 0-based.invert_idx (
bool
) – IfTrue
invert ligand_idx, i.e. all atoms specified therein are now threated as constants and the rest as variables, rather than the other way around.settings (
Settings
, optional) – The input settings forMatchJob
. Will default to the"top_all36_cgenff_new"
forcefield if not specified.path (
str
orPathLike
, optional) – The path to the PLAMS workdir as passed toinit()
. Will default to the current working directory ifNone
.folder (
str
orPathLike
, optional) – The name of the to-be created to the PLAMS working directory as passed toinit()
. Will default to"plams_workdir"
ifNone
.
- Returns:
A Series with the atom types of ligand as keys and atomic charges as values.
- Return type:
See also
MatchJob
A
class:~scm.plams.core.basejob.Job subclass for interfacing with MATCH: Multipurpose Atom-Typer for CHARMM.