Skip to content

Change

charge_log_probabilities(state, pka, ph)

Scores each charge a pKa site is enumerated with, so that truncation can keep the likeliest states rather than the first ones generated.

Uses the Henderson-Hasselbalch fraction at the site's mean pKa. A state with only one charge shifts every variant's score equally, so it scores 0 rather than a large constant that would cost precision.

PARAMETER DESCRIPTION
state

The site's target state at the pH range.

TYPE: ProtonationState

pka

The site's mean pKa.

TYPE: float

ph

The pH to score at.

TYPE: float

RETURNS DESCRIPTION
list[float]

log10 of the fraction in each charge state, in the order of

list[float]

state.get_charges().

log10_one_plus_pow10(x)

Computes log10(1 + 10x) without evaluating 10x, which overflows for the extreme pKa values in the SMARTS file (e.g., Nitro's -1000).

PARAMETER DESCRIPTION
x

The exponent.

TYPE: float

RETURNS DESCRIPTION
float

log10(1 + 10**x).

protonate_site(mols, site, ph_min, ph_max, precision)

Protonate a specific site in a list of molecules.

PARAMETER DESCRIPTION
mols

List of molecule objects.

TYPE: list[Mol]

site

ProtonationSite object with protonation information.

TYPE: ProtonationSite

ph_min

Minimum pH to expose the site to.

TYPE: float

ph_max

Maximum pH to expose the site to.

TYPE: float

precision

pKa standard deviation prefactor to consider.

TYPE: float

RETURNS DESCRIPTION
list[Mol]

List of appropriately protonated molecule objects. If there is any issue, this will return an empty list.

set_protonation_charge(mols, idx, charges, prot_site_name)

Set atomic charge on a specific site for a set of molecules.

PARAMETER DESCRIPTION
mols

List of input molecule objects.

TYPE: list[Mol]

idx

Index of the atom to modify.

TYPE: int

charges

List of charges to assign at this site.

TYPE: list[int]

prot_site_name

Name of the protonation site.

TYPE: str

RETURNS DESCRIPTION
list[Mol]

List of processed molecule objects. If anything goes wrong, then we return an empty list.

site_log_probabilities(site, ph_min, ph_max, precision, ph)

Scores every variant protonate_site makes from one parent molecule, in the same order, so callers can rank the variants it returns.

PARAMETER DESCRIPTION
site

The protonation site.

TYPE: ProtonationSite

ph_min

Minimum pH of the range, which sets each pKa's state.

TYPE: float

ph_max

Maximum pH of the range.

TYPE: float

precision

pKa standard deviation prefactor.

TYPE: float

ph

The pH to score at.

TYPE: float

RETURNS DESCRIPTION
list[float]

log10 probability of each variant, relative to its parent.