chemaxon.calculations

This package contains various calculations for molecules.

GitHub examples: https://github.com/ChemAxon/python-examples/blob/main/jupyter/02_calculators.ipynb

@typecheck(Molecule)
def herg_classification( mol: chemaxon.Molecule) -> HergClassResult:

Predict hERG class inhibition.

For more information: https://docs.chemaxon.com/latest/calculators_herg.html#the-herg-classification-model

Parameters
Returns

HergClassResult - Result object containing classification

@dataclass(frozen=True)
class HergClassResult:

hERG inhibition prediction result object

HergClassResult( classification: HergClassificationType, error: list[HergClassificationType], probabilities: dict[HergClassificationType, int])
classification: HergClassificationType

Classification result.

error: list[HergClassificationType]

The value of the error component

probabilities: dict[HergClassificationType, int]

Probabilities for each classification type.

class HergClassificationType(enum.IntEnum):

Enumeration for hERG inhibition classification types used in the hERG classification predictor.

@typecheck(Molecule)
def herg_activity( mol: chemaxon.Molecule) -> HergActivityResult:

Predict hERG inhibition activity.

For more information: https://docs.chemaxon.com/latest/calculators_herg.html#the-herg-activity-model

Parameters
Returns

int - Predicted hERG inhibition activity

@dataclass(frozen=True)
class HergActivityResult:

hERG inhibition activity prediction result object

HergActivityResult(value: float, error: float)
value: float

Predicted hERG inhibition activity.

error: float

Error of the predicted hERG inhibition activity.

@typecheck(Molecule)
def bbb(mol: chemaxon.Molecule) -> BbbResult:

Predict blood-brain barrier penetration.

For more information: https://docs.chemaxon.com/latest/calculators_bbb-score.html#blood-brain-barrier-bbb-score-predictor

Parameters
Returns

BbbResult - Predicted blood-brain barrier scores by properties and the overall (multiplied) score

@dataclass(frozen=True)
class BbbResult:

Blood-brain barrier penetration prediction result object

BbbResult( score: float, properties: dict[BbbFunction, BbbProperty])
score: float

Multiplied predicted blood-brain barrier penetration score of the property scores.

properties: dict[BbbFunction, BbbProperty]

Predicted blood-brain barrier penetration scores for each property used in the prediction, as well as the predicted value for each property.

class BbbFunction(enum.IntEnum):

Enumeration for blood-brain barrier penetration properties used in the BBB predictor.

ARO_R = <BbbFunction.ARO_R: 0>

Number of aromatic rings.

HA = <BbbFunction.HA: 1>

Number of heavy atoms.

MWHBN = <BbbFunction.MWHBN: 2>

MW^(-0.5) * (HBN), where HBN = HBA + HBD.

TPSA = <BbbFunction.TPSA: 3>

Topological polar surface area.

PKA = <BbbFunction.PKA: 4>

PKa calculation for bbb score.

@dataclass(frozen=True)
class BbbProperty:

Blood-brain barrier penetration prediction property object

BbbProperty(value: float, multiplied_score: float, score: float)
value: float

Predicted value for the property.

multiplied_score: float

Predicted score for the property, calculated by multiplying the predicted value with the corresponding coefficient for the property.

score: float

Predicted score for the property.

@typecheck(Molecule)
def cns_mpo( mol: chemaxon.Molecule) -> CnsMpoResult:

Predict CNS MPO score.

For more information: https://docs.chemaxon.com/latest/calculators_cns-mpo-score.html

Parameters
Returns

CnsMpoResult - Predicted CNS MPO score and scores by properties

@dataclass(frozen=True)
class CnsMpoResult:

CNS MPO score prediction result object

CnsMpoResult( score: float, properties: dict[CnsMpoFunction, CnsMpoProperty])
score: float

Predicted CNS MPO score calculated by summing the predicted scores of the properties.

properties: dict[CnsMpoFunction, CnsMpoProperty]

Predicted CNS MPO scores for each property used in the prediction, as well as the predicted value for each property.

class CnsMpoFunction(enum.IntEnum):

Enumeration for CNS MPO score prediction properties used in the CNS MPO predictor.

HBD = <CnsMpoFunction.HBD: 0>

Number of hydrogen bond donors.

LOGD = <CnsMpoFunction.LOGD: 1>

Calculated distribution coefficient az pH 7.4.

LOGP = <CnsMpoFunction.LOGP: 2>

Lipophilicity, calculated partition coefficient.

MW = <CnsMpoFunction.MW: 3>

Molecular weight.

PKA = <CnsMpoFunction.PKA: 4>

Most basic center (pKa).

TPSA = <CnsMpoFunction.TPSA: 5>

Topological polar surface area.

@dataclass(frozen=True)
class CnsMpoProperty:

CNS MPO score prediction property

CnsMpoProperty(value: float, score: float)
value: float

Predicted value for the property.

score: float

Predicted score for the property.

@typecheck(Molecule)
def formal_charge(mol: chemaxon.Molecule) -> int:

Charge calculation.

Link: https://docs.chemaxon.com/display/docs/calculators_charge-plugin.html

Parameters
Returns

int - The formal charge

@typecheck(Molecule)
def charge_by_atoms( mol: chemaxon.Molecule) -> ChargeResult:

Charge calculation.

Link: https://docs.chemaxon.com/display/docs/calculators_charge-plugin.html

Parameters
Returns

ChargeResult

@dataclass(frozen=True)
class ChargeResult:

ChargeResult class for storing charge calculation results.

This class contains the results of charge calculations including formal charges and total charges for atoms in a molecule.

ChargeResult( formal_charge: int, charge_values: list[ChargeValue])
formal_charge: int

The calculated formal charge value for the whole molecule

charge_values: list[ChargeValue]

List of ChargeValue objects containing charge values for individual atoms

class ChargeValue(typing.NamedTuple):

ChargeValue class for storing charge values for individual atoms.

ChargeValue(atom_index: int, formal_charge: int, total_charge: float)

Create new instance of ChargeValue(atom_index, formal_charge, total_charge)

atom_index: int

Index of the atom

formal_charge: int

Formal charge value of the atom

total_charge: float

Total charge value of the atom

class EnergyUnit(enum.IntEnum):

The energy unit of a force-field calculation.

Shared by the conformer generation and geometrical descriptors calculations.

KCAL_PER_MOL = <EnergyUnit.KCAL_PER_MOL: 0>

kcal/mol (default). Note that 1 kcal/mol is approximately equal to 4.184 kJ/mol.

KJ_PER_MOL = <EnergyUnit.KJ_PER_MOL: 1>

kJ/mol.

class OptimizationLimit(enum.IntEnum):

The optimization limit (convergence tolerance) of the 3D structure optimization.

Controls the trade-off between speed and geometry quality when a 3D conformer is generated (and, for the geometrical descriptors, when an already-3D structure is refined before the Dreiding energy is read). A tighter limit runs more optimization iterations for a lower-energy geometry but is slower. Shared by the conformer generation and geometrical descriptors calculations.

VERY_LOOSE = <OptimizationLimit.VERY_LOOSE: 0>

Very loose optimization limit; fastest, least refined geometry.

NORMAL = <OptimizationLimit.NORMAL: 1>

Normal optimization limit (default); a balance of speed and geometry quality.

STRICT = <OptimizationLimit.STRICT: 2>

Strict optimization limit; slower, more refined geometry.

VERY_STRICT = <OptimizationLimit.VERY_STRICT: 3>

Very strict optimization limit; slowest, most rigorous energy minimization.

@typecheck(Molecule, ConformerOptions)
def conformers( mol: chemaxon.Molecule, options: ConformerOptions = <ConformerOptions object>) -> list[ConformerResult]:

Calculate conformers for a molecule. Conformational isomerism is a form of isomerism that describes the phenomenon of molecules with the same structural formula having different 3D structure. Conformations are transformed into each other by rotations along rotatable bonds. Different conformations might have different energies.

Link: https://docs.chemaxon.com/latest/calculators_conformer-plugin.html

Parameters
Returns

list[ConformerResult] - The list of conformers and their energies, sorted by energy in ascending order.

class ConformerOptions:

Class representing the options for a conformer generation calculation.

Force field to use for conformer generation. Default is ConformerForceField.DREIDING.

energy_unit: EnergyUnit = <EnergyUnit.KCAL_PER_MOL: 0>

Unit for energy values. Default is EnergyUnit.KCAL_PER_MOL.

optimization_limit: OptimizationLimit = <OptimizationLimit.NORMAL: 1>

Optimization limit. Default is OptimizationLimit.NORMAL.

max_number_of_conformers: int = 100

Maximum number of conformers to generate. Default is 100.

diversity_limit: float = 0.1

Diversity limit for conformer selection. Default is 0.1.

time_limit: int = 900

Time limit for conformer generation in seconds. Default is 900.

calculate_lowest_energy_conformer: bool = False

If True, calculate the lowest energy conformer. Default is False.

prehydrogenize: bool = False

If True, pre-hydrogenize the molecule. Default is False.

hyperfine: bool = False

If True, include hyperfine structure. Default is False.

optimize_multi_fragment: bool = False

If True, optimize multi-fragment molecules with MMFF94. Default is False.

class ConformerForceField(enum.IntEnum):

The supported types of force fields for the conformer generation calculation.

DREIDING force field, a generic force field for molecular mechanics simulations.

Merck Molecular force field, a widely used force field for small molecules.

class ConformerResult(typing.NamedTuple):

Class representing the result of a conformer generation for a single conformer.

ConformerResult(conformer: chemaxon.Molecule, energy: float)

Create new instance of ConformerResult(conformer, energy)

conformer: chemaxon.Molecule

The actual conformer.

energy: float

Energy of the conformer.

@typecheck(Molecule, str, str)
def evaluate( mol: chemaxon.Molecule, expression: str, mol_format: str = '') -> str:

Evaluate chemical terms function.

Chemaxon's Chemical Terms is a language for adding advanced chemical intelligence to cheminformatics applications.

Chemical Terms provides chemistry and mathematical functions including:

  • property predictions
  • functional group recognition
  • isomer enumeration
  • conformer selection
  • ring and distance based topological functions
  • other electronical, steric and structural functions

Link: https://docs.chemaxon.com/display/docs/chemical-terms_index.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • expression: str - chemterms expression
  • mol_format: str - (optional) format of the result molecule if the result is a molecule or molecule array (default format is smiles)
Returns

str - result

@typecheck(Molecule, (float, None), bool, bool)
def polar_surface_area( mol: chemaxon.Molecule, ph: float = None, exclude_sulfur: bool = True, exclude_phosphorus: bool = True) -> float:

Topological polar surface area (2D PSA) calculation.

The polar surface area (PSA) is the sum of the surfaces of the polar atoms (typically oxygen, nitrogen and the hydrogens attached to them) in a molecule. It is computed from the topology (2D structure) using the fragment-based method of Ertl et al., without the need for a 3D conformation. PSA is a commonly used descriptor for estimating passive membrane permeability and oral bioavailability.

Link: https://docs.chemaxon.com/latest/calculators_polar-surface-area-plugin-2d.html

Parameters
  • mol: chemaxon.Molecule - Input molecule.
  • ph: float - Calculates the PSA of the major microspecies at this pH. Optional; skip this (default) to calculate the PSA for the input molecule as it is.
  • exclude_sulfur: bool - Whether to exclude sulfur atoms from the calculation. Default is True (PubChem-compatible).
  • exclude_phosphorus: bool - Whether to exclude phosphorus atoms from the calculation. Default is True (PubChem-compatible).
Returns

float - The calculated polar surface area in square angstroms (Ų).

@typecheck(Molecule, (float, None), bool)
def van_der_waals_surface_area( mol: chemaxon.Molecule, ph: float = None, get_increments: bool = True) -> VanDerWaalsSurfaceAreaResult:

3D van der Waals molecular surface area calculation.

The van der Waals surface area is the area of the surface defined by the van der Waals radii of the atoms of a 3D conformation of the molecule. A 3D structure is generated automatically if the input molecule has no 3D coordinates.

Link: https://docs.chemaxon.com/latest/calculators_molecular-surface-area-plugin-3d.html

Parameters
  • mol: chemaxon.Molecule - Input molecule.
  • ph: float - Calculates the surface area of the major microspecies at this pH. Optional; skip this (default) to calculate for the input molecule as it is.
  • get_increments: bool - Whether to also compute the per-atom surface area increments. Default is True.
Returns

VanDerWaalsSurfaceAreaResult

@typecheck(Molecule, (float, None))
def solvent_accessible_surface_area( mol: chemaxon.Molecule, ph: float = None) -> SolventSurfaceAreaResult:

3D solvent accessible molecular surface area calculation.

The solvent accessible surface area (ASA) is the area of the surface traced out by the center of a probe solvent molecule (radius 1.4 Å, i.e. water) rolling over the van der Waals surface of a 3D conformation of the molecule. The result also breaks the ASA down by the partial charge and polarity of the contributing atoms. A 3D structure is generated automatically if the input molecule has no 3D coordinates.

Link: https://docs.chemaxon.com/latest/calculators_molecular-surface-area-plugin-3d.html

Parameters
  • mol: chemaxon.Molecule - Input molecule.
  • ph: float - Calculates the surface area of the major microspecies at this pH. Optional; skip this (default) to calculate for the input molecule as it is.
Returns

SolventSurfaceAreaResult

@dataclass(frozen=True)
class VanDerWaalsSurfaceAreaResult:

Result of a 3D van der Waals molecular surface area calculation.

VanDerWaalsSurfaceAreaResult( surface_area: float, increments: list[AtomDoubleValue], molecule_3d: chemaxon.Molecule)
surface_area: float

The van der Waals surface area in square angstroms (Ų)

increments: list[AtomDoubleValue]

Per-atom surface area increments. Empty when get_increments was False.

molecule_3d: chemaxon.Molecule

The 3D structure used for the calculation

@dataclass(frozen=True)
class SolventSurfaceAreaResult:

Result of a 3D solvent accessible molecular surface area calculation.

SolventSurfaceAreaResult( surface_area: float, asa_plus: float, asa_negative: float, asa_hydrophobic: float, asa_polar: float, molecule_3d: chemaxon.Molecule)
surface_area: float

The solvent accessible surface area (ASA) in square angstroms (Ų)

asa_plus: float

ASA of atoms with positive partial charge

asa_negative: float

ASA of atoms with negative partial charge

asa_hydrophobic: float

ASA of hydrophobic atoms (|partial charge| < 0.125)

asa_polar: float

ASA of polar atoms (|partial charge| >= 0.125)

molecule_3d: chemaxon.Molecule

The 3D structure used for the calculation

@typecheck(Molecule, (list, None), ConformerGeneration, OptimizationLimit, EnergyUnit, bool, bool, bool)
def geometrical_descriptors( mol: chemaxon.Molecule, types: list[str] = None, conformer_generation: ConformerGeneration = <ConformerGeneration.IF_2D: 0>, optimization: OptimizationLimit = <OptimizationLimit.NORMAL: 1>, energy_unit: EnergyUnit = <EnergyUnit.KCAL_PER_MOL: 0>, optimize_projection: bool = False, mmff94_optimization: bool = False, include_conformer: bool = False) -> GeometricalDescriptorsResult:

Molecule-scope geometrical descriptors of a 3D conformation.

Computes the geometry-based (3D) descriptors of the Chemaxon Geometry plugin: the Dreiding and MMFF94 strain energies, the minimal/maximal projection area and radius, the minimal/maximal projection thickness (minZ/maxZ) and the van der Waals volume. A 3D conformer is generated automatically for input without 3D coordinates (see conformer_generation).

Link: https://docs.chemaxon.com/latest/calculators_geometrical-descriptors-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule.
  • types: list[str] - The descriptor types to calculate, given as string names (e.g. ["volume", "dreidingenergy"]; case-insensitive, lower-cased, no separators). When given, only the matching GeometricalDescriptorsResult fields are populated and every other field is None; the underlying computations for the skipped descriptors are not run. Skip this (default) to calculate all descriptors. An unknown type name raises a ValueError. Valid options are:
    • dreidingenergy
    • mmff94energy
    • minimalprojectionarea
    • maximalprojectionarea
    • minimalprojectionradius
    • maximalprojectionradius
    • minz
    • maxZ
    • volume
  • conformer_generation: ConformerGeneration - When to generate a 3D conformer. Default is ConformerGeneration.IF_2D.
  • optimization: OptimizationLimit - Convergence tolerance of the 3D structure optimization: a tighter limit yields a more refined geometry (and lower Dreiding energy) but is slower. Only affects the conformer-generation and Dreiding-energy refinement paths; it has no effect on already-3D geometry read-outs or the MMFF94 energy. Default is OptimizationLimit.NORMAL.
  • energy_unit: EnergyUnit - Unit of the Dreiding and MMFF94 energies. Default is EnergyUnit.KCAL_PER_MOL.
  • optimize_projection: bool - When True, the projection descriptors are computed in a slower but more accurate mode. Default is False.
  • mmff94_optimization: bool - When True, conformer optimization uses the MMFF94 force field instead of Dreiding. Default is False.
  • include_conformer: bool - When True, the generated lowest-energy 3D conformer is returned in the conformer field. Default is False.
Returns

GeometricalDescriptorsResult

@typecheck(Molecule, int, int, ConformerGeneration)
def distance( mol: chemaxon.Molecule, atom1: int, atom2: int, conformer_generation: ConformerGeneration = <ConformerGeneration.IF_2D: 0>) -> float:

Distance between two atoms in a 3D conformation, in angstroms (Å).

Link: https://docs.chemaxon.com/latest/calculators_geometrical-descriptors-plugin.html

Parameters
Returns

float - The interatomic distance in angstroms (Å).

@typecheck(Molecule, int, int, int, ConformerGeneration)
def angle( mol: chemaxon.Molecule, atom1: int, atom2: int, atom3: int, conformer_generation: ConformerGeneration = <ConformerGeneration.IF_2D: 0>) -> float:

Angle enclosed by three atoms in a 3D conformation, in degrees.

The angle is measured at atom2, between the bonds atom2-atom1 and atom2-atom3.

Link: https://docs.chemaxon.com/latest/calculators_geometrical-descriptors-plugin.html

Parameters
Returns

float - The angle in degrees.

@typecheck(Molecule, int, int, int, int, ConformerGeneration)
def dihedral( mol: chemaxon.Molecule, atom1: int, atom2: int, atom3: int, atom4: int, conformer_generation: ConformerGeneration = <ConformerGeneration.IF_2D: 0>) -> float:

Dihedral (torsion) angle defined by four atoms in a 3D conformation, in degrees.

Link: https://docs.chemaxon.com/latest/calculators_geometrical-descriptors-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule.
  • atom1: int - Index (0-based) of the first atom.
  • atom2: int - Index (0-based) of the second atom.
  • atom3: int - Index (0-based) of the third atom.
  • atom4: int - Index (0-based) of the fourth atom.
  • conformer_generation: ConformerGeneration - When to generate a 3D conformer. Default is ConformerGeneration.IF_2D.
Returns

float - The dihedral angle in degrees.

@typecheck(Molecule, ConformerGeneration)
def steric_hindrance( mol: chemaxon.Molecule, conformer_generation: ConformerGeneration = <ConformerGeneration.IF_2D: 0>) -> list[AtomDoubleValue]:

Calculates steric hindrance of an atom calculated from the covalent radii values and geometrical distances.

Link: https://docs.chemaxon.com/latest/calculators_geometrical-descriptors-plugin.html

Parameters
Returns

list[AtomDoubleValue] - One (atom_index, value) entry per atom.

@dataclass(frozen=True)
class GeometricalDescriptorsResult:

Molecule-scope geometrical descriptors of a 3D conformation.

Each descriptor is populated only when it was requested (see the types filter of geometrical_descriptors); every other field is None. conformer is populated only when include_conformer was True.

GeometricalDescriptorsResult( dreiding_energy: Optional[float], mmff94_energy: Optional[float], minimal_projection_area: Optional[float], maximal_projection_area: Optional[float], minimal_projection_radius: Optional[float], maximal_projection_radius: Optional[float], min_z: Optional[float], max_z: Optional[float], volume: Optional[float], conformer: Optional[chemaxon.Molecule])
dreiding_energy: Optional[float]

Dreiding force-field strain energy of the conformation.

mmff94_energy: Optional[float]

MMFF94 force-field strain energy of the conformation.

minimal_projection_area: Optional[float]

Area of the smallest planar projection of the conformation, in square angstroms (Ų).

maximal_projection_area: Optional[float]

Area of the largest planar projection of the conformation, in square angstroms (Ų).

minimal_projection_radius: Optional[float]

Radius of the circumscribed circle of the minimal projection, in angstroms (Å).

maximal_projection_radius: Optional[float]

Radius of the circumscribed circle of the maximal projection, in angstroms (Å).

min_z: Optional[float]

Thickness (extent perpendicular to the projection plane) of the minimal projection, in Å.

max_z: Optional[float]

Thickness (extent perpendicular to the projection plane) of the maximal projection, in Å.

volume: Optional[float]

Van der Waals volume of the conformation, in cubic angstroms (ų).

conformer: Optional[chemaxon.Molecule]

The generated lowest-energy 3D conformer. Populated only when requested (and None when no conformer was generated).

class ConformerGeneration(enum.IntEnum):

Controls whether a lowest-energy 3D conformer is generated before the geometry calculation.

The geometrical descriptors are defined on a 3D conformation. A molecule without 3D coordinates (e.g. imported from SMILES) has one generated automatically according to this setting.

Generate a 3D conformer only if the input has at most 2D coordinates (default).

Never generate a conformer; use the input coordinates as they are.

Always regenerate the lowest-energy 3D conformer, even for 3D input.

@typecheck(Molecule, (float, None), bool, bool)
def hbda( mol: chemaxon.Molecule, ph: float = None, exclude_sulfur: bool = True, exclude_halogens: bool = True) -> HbdaResult:

Hydrogen bond donor/acceptor (HBDA) calculation.

Link: https://docs.chemaxon.com/latest/calculators_hydrogen-bond-donor-acceptor-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • ph: float - Calculates the counts for the major microspecies at this pH. Optional; skip this (default) to use the input molecule as it is.
  • exclude_sulfur: bool - Exclude sulfur atoms from the acceptor count (default True)
  • exclude_halogens: bool - Exclude halogen atoms from the acceptor count (default True)
Returns

HbdaResult

@typecheck(Molecule, PhRange, bool, bool)
def hbda_ph_range( mol: chemaxon.Molecule, ph_range: PhRange = PhRange(lower_bound=0.0, upper_bound=14.0, step=0.5), exclude_sulfur: bool = True, exclude_halogens: bool = True) -> list[HbdaMicrospeciesCounts]:

Hydrogen bond donor/acceptor (HBDA) calculation over a pH range.

For each pH in the range, returns the average number of donor and acceptor sites over the microspecies distribution at that pH.

Link: https://docs.chemaxon.com/latest/calculators_hydrogen-bond-donor-acceptor-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • ph_range: PhRange - The pH values at which to calculate the counts
  • exclude_sulfur: bool - Exclude sulfur atoms from the acceptor count (default True)
  • exclude_halogens: bool - Exclude halogen atoms from the acceptor count (default True)
Returns

list[HbdaMicrospeciesCounts] - Average donor/acceptor counts, one per pH value

@dataclass(frozen=True)
class HbdaResult:

Hydrogen bond donor/acceptor (HBDA) calculation results for a molecule.

HbdaResult( donor_atom_count: int, acceptor_atom_count: int, donor_site_count: int, acceptor_site_count: int, atom_values: list[HbdaAtomLevelCounts])
donor_atom_count: int

Number of distinct atoms that are hydrogen bond donors

acceptor_atom_count: int

Number of distinct atoms that are hydrogen bond acceptors

donor_site_count: int

Total number of hydrogen bond donor sites, counted with multiplicity

acceptor_site_count: int

Total number of hydrogen bond acceptor sites, counted with multiplicity

atom_values: list[HbdaAtomLevelCounts]

Per-atom donor/acceptor counts, listing only atoms that are a donor and/or acceptor

class HbdaAtomLevelCounts(typing.NamedTuple):

A single atom's hydrogen bond donor/acceptor counts.

HbdaAtomLevelCounts(atom_index: int, donor_count: int, acceptor_count: int)

Create new instance of HbdaAtomLevelCounts(atom_index, donor_count, acceptor_count)

atom_index: int

Index of the atom in the input molecule

donor_count: int

Number of hydrogen bond donor sites on this atom, i.e. its donatable hydrogen atoms (0 if the atom is only an acceptor)

acceptor_count: int

1 if this atom is a hydrogen bond acceptor, otherwise 0. Note that, unlike the molecule-level HbdaResult.acceptor_site_count, this per-atom value does not carry multiplicity

class HbdaMicrospeciesCounts(typing.NamedTuple):

Average hydrogen bond donor/acceptor counts over the microspecies distribution at a single pH.

HbdaMicrospeciesCounts(ph: float, donor_count: float, acceptor_count: float)

Create new instance of HbdaMicrospeciesCounts(ph, donor_count, acceptor_count)

ph: float

The pH value

donor_count: float

Average number of hydrogen bond donor sites over the microspecies distribution at this pH

acceptor_count: float

Average number of hydrogen bond acceptor sites over the microspecies distribution at this pH

@typecheck(Molecule, HlbMethod)
def hlb( mol: chemaxon.Molecule, method: HlbMethod = <HlbMethod.CHEMAXON: 0>) -> float:

Hydrophilic-lipophilic balance calculation.

The hydrophilic-lipophilic balance number (HLB number) measures the degree of a molecule being hydrophilic or lipophilic. This number is calculated based on identifying various hydrophil and liphophil regions in the molecule. This number is a commonly used descriptor in any workflow in which lipid based delivery can be an option (e.g. lipid-based drug delivery, cosmetics).

Link: https://docs.chemaxon.com/display/docs/calculators_hlb-predictor.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • method: HlbMethod - This option is for selecting the applied method for the HLB calculation:
    • CHEMAXON (default)
    • DAVIES
    • GRIFFIN
    • REQUIRED
Returns

float - The calculated HLB value

class HlbMethod(enum.IntEnum):

The supported methods for the HLB calculation.

CHEMAXON = <HlbMethod.CHEMAXON: 0>

This is a consensus method based on the other two methods with optimal weights

DAVIES = <HlbMethod.DAVIES: 1>

This is an extended version of the Davies method

GRIFFIN = <HlbMethod.GRIFFIN: 2>

This is an extended version of the Griffin method

REQUIRED = <HlbMethod.REQUIRED: 3>

Experimental value, characteristic to the compound used in (O/W) emulsions

@typecheck(Molecule, (float, None))
def hmo_electrophilic_localization_energy( mol: chemaxon.Molecule, ph: float = None) -> list[AtomDoubleValue]:

Hückel electrophilic localization energy L(+) per atom.

Calculated with the Hückel Molecular Orbital (HMO) method using standard HMO parameters. Only atoms belonging to a delocalized (aromatic/conjugated) system are returned.

Link: https://docs.chemaxon.com/latest/calculators_huckel-analysis-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • ph: float - Calculates the value for the major microspecies at this pH. Optional; skip this (default) to use the input molecule as it is.
Returns

list[AtomDoubleValue] - Per-atom electrophilic localization energies

@typecheck(Molecule, (float, None))
def hmo_nucleophilic_localization_energy( mol: chemaxon.Molecule, ph: float = None) -> list[AtomDoubleValue]:

Hückel nucleophilic localization energy L(-) per atom.

Calculated with the Hückel Molecular Orbital (HMO) method using standard HMO parameters. Only atoms belonging to a delocalized (aromatic/conjugated) system are returned.

Link: https://docs.chemaxon.com/latest/calculators_huckel-analysis-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • ph: float - Calculates the value for the major microspecies at this pH. Optional; skip this (default) to use the input molecule as it is.
Returns

list[AtomDoubleValue] - Per-atom nucleophilic localization energies

@typecheck(Molecule, (float, None))
def hmo_electron_density( mol: chemaxon.Molecule, ph: float = None) -> list[AtomDoubleValue]:

Hückel pi electron density per atom.

Calculated with the Hückel Molecular Orbital (HMO) method using standard HMO parameters. Only atoms belonging to a delocalized (aromatic/conjugated) system are returned.

Link: https://docs.chemaxon.com/latest/calculators_huckel-analysis-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • ph: float - Calculates the value for the major microspecies at this pH. Optional; skip this (default) to use the input molecule as it is.
Returns

list[AtomDoubleValue] - Per-atom electron densities

@typecheck(Molecule, (float, None))
def hmo_charge_density( mol: chemaxon.Molecule, ph: float = None) -> list[AtomDoubleValue]:

Hückel total charge density per atom.

Calculated with the Hückel Molecular Orbital (HMO) method using standard HMO parameters. Only atoms belonging to a delocalized (aromatic/conjugated) system are returned.

Link: https://docs.chemaxon.com/latest/calculators_huckel-analysis-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • ph: float - Calculates the value for the major microspecies at this pH. Optional; skip this (default) to use the input molecule as it is.
Returns

list[AtomDoubleValue] - Per-atom charge densities

@typecheck(Molecule, (float, None))
def hmo_electrophilic_order( mol: chemaxon.Molecule, ph: float = None) -> list[HmoAtomOrder]:

Hückel aromatic electrophilic E(+) order per atom.

The order ranks atoms by their susceptibility to electrophilic aromatic substitution, calculated with the Hückel Molecular Orbital (HMO) method using standard HMO parameters. Only atoms belonging to a delocalized (aromatic/conjugated) system are returned.

Link: https://docs.chemaxon.com/latest/calculators_huckel-analysis-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • ph: float - Calculates the value for the major microspecies at this pH. Optional; skip this (default) to use the input molecule as it is.
Returns

list[HmoAtomOrder] - Per-atom electrophilic orders

@typecheck(Molecule, (float, None))
def hmo_nucleophilic_order( mol: chemaxon.Molecule, ph: float = None) -> list[HmoAtomOrder]:

Hückel aromatic nucleophilic Nu(-) order per atom.

The order ranks atoms by their susceptibility to nucleophilic aromatic substitution, calculated with the Hückel Molecular Orbital (HMO) method using standard HMO parameters. Only atoms belonging to a delocalized (aromatic/conjugated) system are returned.

Link: https://docs.chemaxon.com/latest/calculators_huckel-analysis-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • ph: float - Calculates the value for the major microspecies at this pH. Optional; skip this (default) to use the input molecule as it is.
Returns

list[HmoAtomOrder] - Per-atom nucleophilic orders

@typecheck(Molecule, (float, None))
def hmo_pi_energy(mol: chemaxon.Molecule, ph: float = None) -> float:

Hückel total pi energy of the molecule.

Calculated with the Hückel Molecular Orbital (HMO) method using standard HMO parameters.

Link: https://docs.chemaxon.com/latest/calculators_huckel-analysis-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • ph: float - Calculates the value for the major microspecies at this pH. Optional; skip this (default) to use the input molecule as it is.
Returns

float - The total pi energy

class HmoAtomOrder(typing.NamedTuple):

A single atom's Hückel Molecular Orbital (HMO) aromatic reactivity order (ranking).

HmoAtomOrder(atom_index: int, order: int)

Create new instance of HmoAtomOrder(atom_index, order)

atom_index: int

Index of the atom in the input molecule

order: int

The reactivity order (rank) of this atom

@typecheck(Molecule, PhRange, bool)
def isoelectric_point( mol: chemaxon.Molecule, ph_range: PhRange = PhRange(lower_bound=0, upper_bound=14.0, step=0.5), consider_tautomerization: bool = False) -> IsoelectricPointResult:

Calculate the isoelectric point of a molecule.

Additional details: https://docs.chemaxon.com/latest/calculators_isoelectric-point-pi-calculation.html

Parameters
  • mol: chemaxon.Molecule - The molecule for which the isoelectric point will be calculated.
  • ph_range: PhRange - pH values on which the charge distribution will be calculated.
  • consider_tautomerization: bool - Whether to consider tautomerization during the calculation.
Returns

IsoelectricPointResult - The result object containing the isoelectric point and charge distributions. If the provided pH range does not include the isoelectric point, Nan is returned as the isoelectric point.

@dataclass(frozen=True)
class IsoelectricPointResult:

Isoelectric point calculator result object

IsoelectricPointResult( isoelectric_point: float, charge_distributions: list[IsoelectricChargeResult])
isoelectric_point: float

The isoelectric point of the molecule

charge_distributions: list[IsoelectricChargeResult]

The charge distribution of the molecule at different pH values.

class IsoelectricChargeResult(typing.NamedTuple):

Charge distribution result object

IsoelectricChargeResult(charge: float, ph: float)

Create new instance of IsoelectricChargeResult(charge, ph)

charge: float

The charge of the molecule at a specific pH value.

ph: float

The pH value at which the charge is calculated.

def logd( mol: chemaxon.Molecule, ph: float = 7.4, method: LogPMethod = <LogPMethod.CONSENSUS: 0>, consider_tautomerization: bool = False) -> float:

logD calculation.

Compounds having ionizable groups exist in solution as a mixture of different ionic forms. The ionization of those groups, thus the ratio of the ionic forms depends on the pH. Since logP describes the hydrophobicity of one form only, the apparent logP value can be different. The logD represents the octanol-water coefficient of compounds at a given pH value.

Link: https://docs.chemaxon.com/display/docs/calculators_logd-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • ph: float - Calculates logD value at this pH
  • method: LogPMethod - This option is for selecting the applied method for the logP prediction:
    • CONSENSUS
    • CHEMAXON
  • consider_tautomerization: bool - In case of tautomer structures, all dominant tautomers at the given pH are taken into account during the logD calculation
Returns

float - The calculated logD value

@typecheck(Molecule, PhRange, LogPMethod, bool)
def logd_ph_range( mol: chemaxon.Molecule, ph_range: PhRange = PhRange(lower_bound=7.4, upper_bound=7.4, step=1.0), method: LogPMethod = <LogPMethod.CONSENSUS: 0>, consider_tautomerization: bool = False) -> list[LogDResult]:

logD calculation on a range of ph values.

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • ph_range: PhRange - Calculates logD value at these pH values
  • method: LogPMethod - This option is for selecting the applied method for the logP prediction:
    • CONSENSUS
    • CHEMAXON
  • consider_tautomerization: bool - In case of tautomer structures, all dominant tautomers at the given pH are taken into account during the logD calculation
Returns

list[LogDResult] - The calculated logD values for the given pH range as a list of LogDResult objects.

class LogDResult(typing.NamedTuple):

LogD calculator result object

LogDResult(ph: float, logd: float)

Create new instance of LogDResult(ph, logd)

ph: float

pH value for which logD value is specified.

logd: float

logD value for the given pH value.

@typecheck(Molecule, LogPMethod, float, float, bool, float | None)
def logp( mol: chemaxon.Molecule, method: LogPMethod = <LogPMethod.CONSENSUS: 0>, anion: float = 0.1, kation: float = 0.1, consider_tautomerization: bool = False, ph: float = None) -> float:

logP calculation.

The logp function calculates the logarithm of the octanol/water partition coefficient (logP), which is used in QSAR analysis and rational drug design as a measure of molecular lipophylicity/hydrophobicity.

Link: https://docs.chemaxon.com/display/docs/calculators_logp-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • method: LogPMethod - This option is for selecting the applied method for the logP prediction:
    • CONSENSUS: Consensus model built on the Chemaxon and Klopman et al. models and the PhysProp database
    • CHEMAXON: Chemaxon's own logP model, which is based on the VG method
  • anion: float - Cl- concentration
  • kation: float - Na+ K+ concentration
  • consider_tautomerization: bool - In case of tautomer structures, all dominant tautomers at the given pH are taken into account during the logP calculation
  • ph: float - If set, calculates logP value at this pH
Returns

float - The calculated logP

@typecheck(Molecule, LogPMethod, float, float, bool, (float, None))
def logp_by_atoms( mol: chemaxon.Molecule, method: LogPMethod = <LogPMethod.CONSENSUS: 0>, anion: float = 0.1, kation: float = 0.1, consider_tautomerization: bool = False, ph: float = None) -> LogPResult:

logP by atom calculation.

The logp function calculates the logarithm of the octanol/water partition coefficient (logP), which is used in QSAR analysis and rational drug design as a measure of molecular lipophylicity/hydrophobicity.

Link: https://docs.chemaxon.com/display/docs/calculators_logp-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • method: LogPMethod - This option is for selecting the applied method for the logP prediction:
    • CONSENSUS: Consensus model built on the Chemaxon and Klopman et al. models and the PhysProp database
    • CHEMAXON: Chemaxon's own logP model, which is based on the VG method
  • anion: float - Cl- concentration
  • kation: float - Na+ K+ concentration
  • consider_tautomerization: bool - In case of tautomer structures, all dominant tautomers at the given pH are taken into account during the logP calculation
  • ph: float - If set, calculates logP value at this pH
Returns

LogPResult - The calculated logP

@dataclass(frozen=True)
class LogPResult:

LogPResult

LogPResult( logp: float, logp_values: list[AtomLogPResult])
logp: float

The calculated logp value

logp_values: list[AtomLogPResult]

logp values for every atom.

class LogPMethod(enum.IntEnum):

The supported methods for the logP calculation.

CONSENSUS = <LogPMethod.CONSENSUS: 0>

Consensus model built on the Chemaxon and Klopman et al. models and the PhysProp database

CHEMAXON = <LogPMethod.CHEMAXON: 1>

Chemaxon's own logP model, which is based on the VG method

class AtomLogPResult(typing.NamedTuple):

Result for a single atom's logP contribution.

AtomLogPResult(atom_index: int, logp: float)

Create new instance of AtomLogPResult(atom_index, logp)

atom_index: int

The atom index

logp: float

The logP contribution for this atom

@typecheck(Molecule, float, bool, bool)
def major_microspecies( mol: chemaxon.Molecule, ph: float = 7.4, take_major_tautomeric_form: bool = False, keep_explicit_hydrogens: bool = False) -> chemaxon.Molecule:

Major Microspecies calculation.

The Major Microspecies determines the major (de)protonated form of the molecule at a specified pH.

Link: https://docs.chemaxon.com/display/docs/calculators_major-microspecies-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • ph: float - Calculates major microspecies at this pH
  • take_major_tautomeric_form: bool - If major tautomeric form should be taken
  • keep_explicit_hydrogens: bool - If explicit hydrogens should be kept on the result molecule
Returns

chemaxon.Molecule - Major microspecies molecule

@dataclass
class PhRange:

Class representing pH range. The range goes from lower_bound to upper_bound (inclusive) with the step size of step.

PhRange(lower_bound: float, upper_bound: float, step: float)
lower_bound: float

Lower bound of the pH range.

upper_bound: float

Inclusive upper bound of the pH range.

step: float

Step size for the pH range.

@typecheck(Molecule, bool, bool, bool, float, float, int, int, float, RequiredPkaType, str, str)
def pka( mol: chemaxon.Molecule, consider_tautomerization: bool = False, calculate_micro: bool = False, use_large_model: bool = False, min_basic: float = -10.0, max_acidic: float = 20.0, number_of_acidic_values: int = 2, number_of_basic_values: int = 2, temperature: float = 298, required_pka_type: RequiredPkaType = <RequiredPkaType.PKA: 2>, correction_library: str = '', correction_library_path: str = '') -> PkaResult:

pKa calculation.

Most molecules contain some specific functional groups likely to lose or gain proton(s) under specific circumstances. Each equilibrium between the protonated and deprotonated forms of the molecule can be described with a constant value called p K a. The pka function calculates the pKa values of the molecule based on its partial charge distribution.

Link: https://docs.chemaxon.com/display/docs/calculators_pka-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • consider_tautomerization: bool - Whether to consider tautomerization and resonance during pKa calculation
  • calculate_micro: bool - Whether to calculate micro-pKa values. In case of false, macro-pKa values will be calculated.
  • use_large_model: bool - Whether to use large pKa model.
    • small: optimized for at most 8 ionizable atoms
    • large: optimized for a large number of ionizable atoms
  • min_basic: float - Minimum basic pKa value to be considered
  • max_acidic: float - Maximum acidic pKa value to be considered
  • number_of_acidic_values: int - Number of acidic pKa values to be displayed
  • number_of_basic_values: int - Number of basic pKa values to be displayed
  • temperature: float - Temperature in Kelvin
  • correction_library: str - Identifier of a pKa correction library created by train_pka in the default training directory. Empty string means no correction library. See pka_correction_library_ids for the available identifiers.
  • correction_library_path: str - Path of a pKa correction library (.pkadata) file, as returned by train_pka. Takes precedence over correction_library.
Returns

PkaResult

@typecheck(str, str, str, str)
def train_pka( training_set_path: str, training_id: str, training_dir: str = '', validation_file_path: str = '') -> str:

pKa training.

Fits pKa correction parameters to a training set of molecules with known, experimental pKa values and stores them in a correction library. The library can then be applied to subsequent pKa predictions through the correction_library or correction_library_path parameter of the pka function.

Every molecule of the training set describes its measured pKa values with pairs of properties: pKa<n> holds the experimental value and ID<n> the one-based index of the ionizable atom it belongs to. Molecules without such a pair are skipped.

Training writes files, so concurrent calls must not share a training_id and training_dir pair, otherwise they overwrite each other's correction library.

Link: https://docs.chemaxon.com/latest/calculators_training-the-pka-plugin.html

Parameters
  • training_set_path: str - Path of the training set file, e.g. an SDFile
  • training_id: str - Identifier of the correction library to be created. The library file is named after its lowercase form.
  • training_dir: str - Directory to write the correction library into. Empty string means the default training directory (calculations/training under the Chemaxon home directory), which is the only place pka_correction_library_ids and the correction_library parameter of pka look at.
  • validation_file_path: str - Path of the validation results file. If given, the training also cross-validates the model with the leave-one-out method and writes the results there. Empty string means no validation.
Returns

str - Path of the created correction library (.pkadata) file

def pka_correction_library_ids() -> list[str]:

The identifiers of the available pKa correction libraries.

Lists the correction libraries of the default training directory, i.e. the ones train_pka created without an explicit training_dir. These identifiers can be passed to the correction_library parameter of the pka function.

Returns

list[str] - The available pKa correction library identifiers

@dataclass(frozen=True)
class PkaResult:

PkaResult

PkaResult( pka_values: list[PkaValue], mol: chemaxon.Molecule)
pka_values: list[PkaValue]

List of atomic pka values

The input structure extended by pka values as atomic properties

def acidic_values(self) -> list[PkaValue]:

Returns acidic pka values sorted by their value in ascending order

def basic_values(self) -> list[PkaValue]:

Returns basic pka values sorted by their value in descending order

def min_acidic(self) -> PkaValue:

Returns the acidic pka value with the lowest value

def max_basic(self) -> PkaValue:

Returns the basic pka value with the highest value

class PkaValue(typing.NamedTuple):

A single atom's pKa value, tagged as acidic or basic.

pka_type: PkaType

Pka type

class PkaType(enum.IntEnum):

pKa types of the calculated pKa values. This is the type of the pKa function's result.

ACIDIC = <PkaType.ACIDIC: 0>

Acidic pKa value

BASIC = <PkaType.BASIC: 1>

Basic pKa value

class RequiredPkaType(enum.IntEnum):

Pka types to be calculated. This is the input option for the pka function.

ACIDIC = <RequiredPkaType.ACIDIC: 0>

Calculate only acidic pKa values

BASIC = <RequiredPkaType.BASIC: 1>

Calculate only basic pKa values

PKA = <RequiredPkaType.PKA: 2>

Calculate both acidic and basic pKa values

@typecheck(Molecule, float)
def polarizability(mol: chemaxon.Molecule, ph: float = -1) -> float:

Polarizability calculation.

Polarizability is the relative tendency of an electron cloud (a charge distribution) of a molecule to be distorted by an external electric field. The more stable an ionized (charged) site is the more polarizable its vicinity is. Atomic polarizability is altered by partial charges of atoms. The polarizability function is able to calculate the atomic and molecular polarizability values.

Link: https://docs.chemaxon.com/display/docs/calculators_polarizability-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • ph: float - Calculates polarizability value at this pH. Optional, skip this if you want to calculate polarizability for the input molecule as it is
Returns

float - polarizability

@typecheck(Molecule, float)
def atomic_polarizability( mol: chemaxon.Molecule, ph: float = -1) -> PolarizabilityResult:

Atomic Polarizability calculation.

Polarizability is the relative tendency of an electron cloud (a charge distribution) of a molecule to be distorted by an external electric field. The more stable an ionized (charged) site is the more polarizable its vicinity is. Atomic polarizability is altered by partial charges of atoms. The polarizability function is able to calculate the atomic and molecular polarizability values.

Link: https://docs.chemaxon.com/display/docs/calculators_polarizability-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • ph: float - Calculates polarizability value at this pH. Optional, skip this if you want to calculate polarizability for the input molecule as it is
Returns

PolarizabilityResult

@dataclass(frozen=True)
class PolarizabilityResult:

PolarizabilityResult

PolarizabilityResult( molecular_polarizability: float, polarizability_values: list[PolarizabilityValue])
molecular_polarizability: float

Calculated molecular polarizability value

polarizability_values: list[PolarizabilityValue]

Atomic polarizability values

class PolarizabilityValue(typing.NamedTuple):

Result for a single atom's polarizability.

PolarizabilityValue(atom_index: int, polarizability: float)

Create new instance of PolarizabilityValue(atom_index, polarizability)

atom_index: int

The atom index

polarizability: float

The polarizability value for this atom

@typecheck(Molecule)
def refractivity( mol: chemaxon.Molecule) -> RefractivityResult:

Atomic refractivity calculation.

Molar refractivity is a descriptor of the molecular volume and the London dispersive forces playing a role in drug-receptor interactions. It is calculated with the atomic method proposed by Viswanadhan et al., which assigns refractivity increments to individual atoms. Besides the molar refractivity of the whole molecule, this function also returns the per-atom refractivity increment and the increment contributed by the hydrogens attached to each atom.

Link: https://docs.chemaxon.com/latest/calculators_refractivity-plugin.html

Parameters
Returns

RefractivityResult

@dataclass(frozen=True)
class RefractivityResult:

RefractivityResult

RefractivityResult( molar_refractivity: float, refractivity_values: list[RefractivityValue])
molar_refractivity: float

Calculated molar refractivity value for the whole molecule

refractivity_values: list[RefractivityValue]

Atomic refractivity increments

class RefractivityValue(typing.NamedTuple):

Result for a single atom's refractivity.

RefractivityValue(atom_index: int, refractivity: float, hydrogen_refractivity: float)

Create new instance of RefractivityValue(atom_index, refractivity, hydrogen_refractivity)

atom_index: int

The atom index

refractivity: float

The refractivity increment for this atom

hydrogen_refractivity: float

The refractivity increment contributed by the hydrogens attached to this atom

@typecheck(Molecule, bool, bool, int, bool)
def resonant_structures( mol: chemaxon.Molecule, major_contributors_only: bool = True, symmetry_filtering: bool = True, max_structures: int = 1000, clean_structures: bool = False) -> list[chemaxon.Molecule]:

Resonant structure generation. This function generates the resonant structures of the input molecule. By default, only the major contributors are returned, symmetrical duplicates are filtered out and at most 1000 structures are generated.

Link: https://docs.chemaxon.com/latest/calculators_resonance-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule.
  • major_contributors_only: bool - If True, only the major contributor resonant structures are returned. If False, all resonant structures are returned. Default is True.
  • symmetry_filtering: bool - If True, symmetrical structures are filtered out, otherwise symmetrical structures are returned as duplicates. Default is True.
  • max_structures: int - Maximum number of resonant structures to be generated. Default is 1000.
  • clean_structures: bool - If True, the resulting structures are cleaned in 2D. Default is False.
Returns

list[chemaxon.Molecule] - list of resonant structures as chemaxon.Molecule objects.

@typecheck(Molecule, bool)
def canonical_resonant_structure( mol: chemaxon.Molecule, clean_structure: bool = False) -> chemaxon.Molecule:

Canonical resonant structure generation. This function generates the single canonical resonant form of the input molecule. The canonical resonant structure is a unique representative form that can be used for purposes such as structure searching and database indexing.

Link: https://docs.chemaxon.com/latest/calculators_resonance-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule.
  • clean_structure: bool - If True, the resulting structure is cleaned in 2D. Default is False.
Returns

chemaxon.Molecule - the canonical resonant structure as chemaxon.Molecule object.

@typecheck(Molecule, (float, None), SolubilityUnit)
def solubility( mol: chemaxon.Molecule, ph: float = None, unit: SolubilityUnit = <SolubilityUnit.LOG_S: 0>) -> float:

Solubility calculation.

Solubility predictor calculates the aqueous solubility of a compound based on its structure. It is able to calculate two types of solubility: intrinsic and pH-dependent solubility.

The intrinsic solubility (usually denoted as logS0) of an ionizable compound is the solubility that can be measured after an equilibrium of solvation between the dissolved and the solid state is reached at a pH where the compound is fully neutral.

The pH of a solution affects the ionization of the dissolved compound, shifting its solvation equilibrium. With increasing ionization solubility increases compared to the intrinsic solubility.

Link: https://docs.chemaxon.com/latest/calculators_solubility-predictor.html

Parameters
Returns

float - solubility in the specified unit

@typecheck(Molecule, PhRange, SolubilityUnit)
def solubility_ph_range( mol: chemaxon.Molecule, ph_range: PhRange = PhRange(lower_bound=0.0, upper_bound=14.0, step=1.0), unit: SolubilityUnit = <SolubilityUnit.LOG_S: 0>) -> list[SolubilityResult]:

Solubility calculation in pH range.

Solubility predictor calculates the aqueous solubility of a compound based on its structure. It is able to calculate two types of solubility: intrinsic and pH-dependent solubility.

The pH of a solution affects the ionization of the dissolved compound, shifting its solvation equilibrium. With increasing ionization solubility increases compared to the intrinsic solubility.

This function calculates the pH-dependent solubility in the provided pH range with the provided step size. The result is an array of solubility values in the specified unit.

Link: https://docs.chemaxon.com/latest/calculators_solubility-predictor.html

Parameters
Returns

list[SolubilityResult] - list of solubility results with pH values

class SolubilityUnit(enum.IntEnum):

The supported types of units for the solubility result.

LOG_S = <SolubilityUnit.LOG_S: 0>

Solubility is expressed in base-10 logarithm unit.

MG_PER_ML = <SolubilityUnit.MG_PER_ML: 1>

Solubility is expressed in mg/ml unit.

MOL_PER_L = <SolubilityUnit.MOL_PER_L: 2>

Solubility is expressed in mol/l unit.

class SolubilityResult(typing.NamedTuple):

Solubility calculation result object containing the solubility value with pH.

SolubilityResult(solubility: float, ph: float)

Create new instance of SolubilityResult(solubility, ph)

solubility: float

Solubility value in the specified unit.

ph: float

pH value for which the solubility is specified.

@typecheck(Molecule, FrameworkType, bool, bool, bool, bool, bool, bool, bool, bool)
def structural_framework( mol: chemaxon.Molecule, framework_type: FrameworkType = <FrameworkType.BEMIS_MURCKO: 0>, keep_single_atom: bool = True, largest_fragment_in: bool = False, largest_fragment_out: bool = False, prune_in: bool = False, prune_out: bool = False, hydrogenize: bool = False, dehydrogenize: bool = False, remove_equivalents: bool = False) -> chemaxon.Molecule:

Structural Frameworks calculation.

Reduces a molecule to a structural framework (scaffold), such as the Bemis-Murcko scaffold or a ring system, by stripping side chains, generalizing atoms/bonds or selecting ring systems according to the chosen framework type.

Link: https://docs.chemaxon.com/display/docs/calculators_structural-frameworks-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule
  • framework_type: FrameworkType - The framework/scaffold algorithm to apply
  • keep_single_atom: bool - Represent acyclic fragments as a single atom instead of an empty structure (only relevant for the Bemis-Murcko framework types)
  • largest_fragment_in: bool - Process only the largest fragment of the input molecule
  • largest_fragment_out: bool - Keep only the largest fragment of the result
  • prune_in: bool - Generalize the input first (all atoms to carbon, all bonds to single, stereo cleared)
  • prune_out: bool - Generalize the result the same way
  • hydrogenize: bool - Add explicit hydrogens to the input before the calculation
  • dehydrogenize: bool - Remove explicit hydrogens from the input before the calculation
  • remove_equivalents: bool - Remove duplicate/equivalent fragments from the result
Returns

chemaxon.Molecule - The structural framework molecule

class FrameworkType(enum.IntEnum):

The supported structural framework (scaffold) types.

BEMIS_MURCKO = <FrameworkType.BEMIS_MURCKO: 0>

Bemis-Murcko framework (rings plus their connecting linkers, side chains removed), generalized to a carbon skeleton: every atom becomes carbon and every bond a single bond

BEMIS_MURCKO_LOOSE = <FrameworkType.BEMIS_MURCKO_LOOSE: 1>

Loose Bemis-Murcko variant that keeps the original atom types and bond orders, plus exocyclic double/triple bonds attached directly to rings

ALL_RING_SYSTEMS = <FrameworkType.ALL_RING_SYSTEMS: 2>

All fused ring systems of the molecule

LARGEST_RING_SYSTEM = <FrameworkType.LARGEST_RING_SYSTEM: 3>

The largest fused ring system of the molecule

SSSR = <FrameworkType.SSSR: 4>

Smallest Set of Smallest Rings

CSSR = <FrameworkType.CSSR: 5>

Complete Set of Smallest Rings

LARGEST_RING = <FrameworkType.LARGEST_RING: 6>

The largest single ring of the molecule

MCS = <FrameworkType.MCS: 7>

Pairwise Maximum Common Substructure of the molecule's disconnected fragments (needs at least two)

KEEP = <FrameworkType.KEEP: 8>

No reduction; returns the (pre/post-processed) input unchanged

@typecheck(Molecule, bool, int, TautomerAdvancedOptions)
def all_tautomers( mol: chemaxon.Molecule, normal: bool = False, max_tautomers: int = 1000, options: TautomerAdvancedOptions = <TautomerAdvancedOptions object>) -> list[chemaxon.Molecule]:

All tautomer generation. This function generates all tautomers of the input molecule. The tautomers are generated in their original form by default, but they can also be generated in their normal form. The maximum number of tautomers to be generated can be specified.

Link: https://docs.chemaxon.com/latest/calculators_tautomer-generation-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule.
  • normal: bool - If True, the tautomers are generated in their normal form. If False, the tautomers are generated in their original form. Default is False.
  • max_tautomers: int - Maximum number of tautomers to be generated. Default is 1000.
  • options: TautomerAdvancedOptions - Advanced options for tautomer generation. Default is TautomerAdvancedOptions().
Returns

list[Molecule] - list of tautomers as Molecule objects.

@typecheck(Molecule, (float, None), int, TautomerAdvancedOptions)
def dominant_tautomer_distribution( mol: chemaxon.Molecule, ph: float = None, max_tautomers: int = 1000, options: TautomerAdvancedOptions = <TautomerAdvancedOptions object>) -> list[DominantTautomerResult]:

Dominant tautomer distributions. This function generates the dominant tautomer distribution of the input molecule. The pH can be specified to generate the tautomers at a specific pH, or it can be generated without considering pH. The maximum number of tautomers to be generated can be specified.

Link: https://docs.chemaxon.com/latest/calculators_tautomer-generation-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule.
  • ph: float - If specified, the tautomers are generated at this pH. If not specified, the tautomers are generated without considering pH. Default is None.
  • max_tautomers: int - Maximum number of tautomers to be generated. Default is 1000.
  • options: TautomerAdvancedOptions - Advanced options for tautomer generation. Default is the default TautomerAdvancedOptions instance.
Returns

list[DominantTautomerResult] - list of dominant tautomer results.

@typecheck(Molecule, bool, TautomerAdvancedOptions)
def canonical_tautomer( mol: chemaxon.Molecule, normal: bool = False, options: TautomerAdvancedOptions = <TautomerAdvancedOptions object>) -> chemaxon.Molecule:

Canonical tautomer generation. This function generates the canonical tautomer of the input molecule. The tautomers are generated in their original form by default, but they can also be generated in their normal form. The maximum number of tautomers to be generated can be specified. The canonical tautomer is the first tautomer in the list of tautomers generated by the all_tautomers function, which is the tautomer with the highest distribution. The canonical tautomer is not necessarily the most stable tautomer, but it is a representative tautomer that can be used for various purposes, such as structure searching and database indexing.

Link: https://docs.chemaxon.com/latest/calculators_tautomer-generation-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule.
  • normal: bool - If True, the tautomers are generated in their normal form. If False, the tautomers are generated in their original form. Default is False.
  • options: TautomerAdvancedOptions - Advanced options for tautomer generation. Default is the default TautomerAdvancedOptions instance.
Returns

chemaxon.Molecule - the canonical tautomer as Molecule object.

@typecheck(Molecule, (float, None), TautomerAdvancedOptions)
def major_tautomer( mol: chemaxon.Molecule, ph: float = None, options: TautomerAdvancedOptions = <TautomerAdvancedOptions object>) -> chemaxon.Molecule:

Major tautomer generation. This function generates the major tautomer of the input molecule at a specific pH. The major tautomer is the tautomer with the highest distribution at the specified pH. The pH can be specified to generate the tautomers at a specific pH, or it can be generated without considering pH.

Link: https://docs.chemaxon.com/latest/calculators_tautomer-generation-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule.
  • ph: float - If specified, the tautomers are generated at this pH. If not specified, the tautomers are generated without considering pH. Default is None.
Returns

Molecule - the major tautomer as Molecule object.

class TautomerAdvancedOptions:

TautomerAdvancedOptions class for configuring advanced tautomer generation options.

precision: Optional[int] = None

Precision for tautomer generation. If not specified, the default precision is used. Default is None.

path_length: Optional[int] = None

Maximum allowed length of the tautomerization path in chemical bonds. If not specified, the default path length is used. Default is None.

protect_aromaticity: bool = True

If True, aromaticity is protected during tautomer generation. Default is True.

protect_charge: bool = True

If True, charged atom is maintain their charge during tautomer generation. Default is True.

exclude_antiaromatic_compounds: bool = True

If True, antiaromatic ring systems are excluded from tautomer generation. Default is True.

protect_double_bond_stereo: bool = False

If True, all double bond with stereo information remain intact during tautomer generation. Default is False.

protect_all_tetrahedral_centers: bool = False

If True, tetrahedral centers are not included in tautomer generation. Default is False.

protect_labeled_tetrahedral_centers: bool = False

If True, stereo centers labeled with chiral flag or MDL Enhanced Stereo Representation flag will not be included in tautomer generation. Default is False.

protect_ester_groups: bool = True

If True, ester groups are protected during tautomer generation. Default is True.

allow_ring_chain: bool = False

If True, Ring-chain tautomers are allowed during tautomer generation. Default is False.

class DominantTautomerResult(typing.NamedTuple):

Result for a single dominant tautomer with its distribution.

DominantTautomerResult(tautomer: chemaxon.Molecule, distribution: float)

Create new instance of DominantTautomerResult(tautomer, distribution)

tautomer: chemaxon.Molecule

The tautomer molecule

distribution: float

The distribution value for this tautomer

@typecheck(Molecule, (list, None), bool, AromatizationMethod)
def topology_analysis( mol: chemaxon.Molecule, types: list[str] = None, single_fragment: bool = False, aromatization_method: AromatizationMethod = <AromatizationMethod.GENERAL: 2>) -> TopologyAnalysisResult:

Topological analysis of a molecule.

Computes an extensive set of graph-theoretical (2D, topology-based) descriptors: atom/bond counts by class, a full ring and ring-system perception (with per-class ring atom sets), connectivity indices (Balaban, Randic, Harary, Wiener, hyper-Wiener, Szeged, Platt, Wiener polarity), the cyclomatic number, Fsp3, per-atom descriptors (distance degree, eccentricity, steric effect index, ring membership), stereochemistry counts, and the largest conjugated system.

Link: https://docs.chemaxon.com/latest/calculators_topological-analysis-plugin.html

Parameters
  • mol: chemaxon.Molecule - Input molecule.
  • types: list[str] - The descriptor types to calculate, given as plugin function names (e.g. ["wienerIndex", "ringCount"]; case-insensitive). When given, only the matching TopologyAnalysisResult fields are populated and every other field is None. Skip this (default) to calculate all descriptors. An unknown type name raises an error.
  • single_fragment: bool - When True, a multi-fragment molecule is analyzed as its largest fragment only; when False (default) all fragments are analyzed together.
  • aromatization_method: AromatizationMethod - The aromatization method to use. Default is AromatizationMethod.GENERAL.
Returns

TopologyAnalysisResult

@dataclass(frozen=True)
class TopologyAnalysisResult:

Result of a topological analysis of a molecule.

Each inner list of rings (and the *_rings variants) is the set of atom indices forming one ring; largest_ring / smallest_ring likewise hold the atom indices of a single ring. The ring-system fields (ring_systems, largest_ring_system, smallest_ring_system) instead hold ring indices — positions into the rings list — since a ring system is a group of fused or spiro rings. To resolve those indices back to atoms you also need rings; when using the types filter, request rings alongside any ring-system type. Per-atom fields (distance_degree, eccentricity, steric_effect, ...) carry one (atom_index, value) entry per atom.

TopologyAnalysisResult( aliphatic_atom_count: Optional[int], aliphatic_bond_count: Optional[int], aliphatic_ring_count: Optional[int], aliphatic_rings: Optional[list[list[int]]], all_atom_count: Optional[int], aromatic_atom_count: Optional[int], aromatic_rings: Optional[list[list[int]]], aromatic_bond_count: Optional[int], aromatic_ring_count: Optional[int], asymmetric_atoms: Optional[list[int]], balaban_index: Optional[float], bond_count: Optional[int], carbo_ring_count: Optional[int], carbo_rings: Optional[list[list[int]]], carbo_aliphatic_ring_count: Optional[int], carbo_aromatic_ring_count: Optional[int], chain_atom_count: Optional[int], chain_bond_count: Optional[int], chiral_center_count: Optional[int], chiral_centers: Optional[list[int]], colored_largest_conjugated_system: Optional[chemaxon.Molecule], cyclomatic_number: Optional[int], distance_degree: Optional[list[AtomIntValue]], eccentricity: Optional[list[AtomIntValue]], fragment_count: Optional[int], fsp3: Optional[float], fused_aliphatic_ring_count: Optional[int], fused_aliphatic_rings: Optional[list[list[int]]], fused_aromatic_ring_count: Optional[int], fused_aromatic_rings: Optional[list[list[int]]], fused_ring_count: Optional[int], harary_index: Optional[float], hetero_ring_count: Optional[int], hetero_rings: Optional[list[list[int]]], hetero_aliphatic_ring_count: Optional[int], hetero_aliphatic_rings: Optional[list[list[int]]], hetero_aromatic_ring_count: Optional[int], hetero_aromatic_rings: Optional[list[list[int]]], hyper_wiener_index: Optional[int], is_connected_graph: Optional[bool], largest_conjugated_system: Optional[list[int]], largest_conjugated_system_size: Optional[int], largest_ring: Optional[list[int]], largest_ring_size: Optional[int], largest_ring_size_of_atom: Optional[list[AtomIntValue]], largest_ring_system: Optional[list[int]], largest_ring_system_size: Optional[int], platt_index: Optional[int], randic_index: Optional[float], ring_atom_count: Optional[int], ring_bond_count: Optional[int], ring_count: Optional[int], rings: Optional[list[list[int]]], ring_count_of_atom: Optional[list[AtomIntValue]], ring_system_count: Optional[int], ring_systems: Optional[list[list[int]]], rotatable_bond_count: Optional[int], smallest_ring: Optional[list[int]], smallest_ring_size: Optional[int], smallest_ring_size_of_atom: Optional[list[AtomIntValue]], smallest_ring_system: Optional[list[int]], smallest_ring_system_size: Optional[int], stereo_double_bond_count: Optional[int], steric_effect: Optional[list[AtomDoubleValue]], szeged_index: Optional[int], wiener_index: Optional[int], wiener_polarity: Optional[int])
aliphatic_atom_count: Optional[int]

Number of aliphatic atoms

aliphatic_bond_count: Optional[int]

Number of aliphatic bonds

aliphatic_ring_count: Optional[int]

Number of aliphatic rings

aliphatic_rings: Optional[list[list[int]]]

Atom indices of the aliphatic rings

all_atom_count: Optional[int]

Total number of atoms

aromatic_atom_count: Optional[int]

Number of aromatic atoms

aromatic_rings: Optional[list[list[int]]]

Atom indices of the aromatic rings

aromatic_bond_count: Optional[int]

Number of aromatic bonds

aromatic_ring_count: Optional[int]

Number of aromatic rings

asymmetric_atoms: Optional[list[int]]

Atom indices of the asymmetric atoms

balaban_index: Optional[float]

Balaban distance connectivity index (average distance-sum connectivity)

bond_count: Optional[int]

Number of bonds

carbo_ring_count: Optional[int]

Number of rings containing only carbon atoms

carbo_rings: Optional[list[list[int]]]

Atom indices of the carbocyclic rings (rings containing carbon atoms only)

carbo_aliphatic_ring_count: Optional[int]

Number of aliphatic rings containing only carbon atoms

carbo_aromatic_ring_count: Optional[int]

Number of aromatic rings containing only carbon atoms

chain_atom_count: Optional[int]

Number of chain (non-ring) atoms

chain_bond_count: Optional[int]

Number of chain (non-ring) bonds

chiral_center_count: Optional[int]

Number of tetrahedral stereogenic centers

chiral_centers: Optional[list[int]]

Atom indices of the chiral centers

colored_largest_conjugated_system: Optional[chemaxon.Molecule]

A copy of the structure in which the atoms of the largest conjugated system are colored

cyclomatic_number: Optional[int]

Cyclomatic number (circuit rank): smallest number of edges to remove so no cycle remains

distance_degree: Optional[list[AtomIntValue]]

Per-atom sum of the corresponding row in the atom-distance matrix

eccentricity: Optional[list[AtomIntValue]]

Per-atom greatest value of the corresponding row in the atom-distance matrix

fragment_count: Optional[int]

Number of fragments (disconnected parts)

fsp3: Optional[float]

Fraction of sp3 carbons: number of sp3 carbons / number of carbons

fused_aliphatic_ring_count: Optional[int]

Number of fused aliphatic rings

fused_aliphatic_rings: Optional[list[list[int]]]

Atom indices of the fused aliphatic rings

fused_aromatic_ring_count: Optional[int]

Number of fused aromatic rings

fused_aromatic_rings: Optional[list[list[int]]]

Atom indices of the fused aromatic rings

fused_ring_count: Optional[int]

Number of fused rings (SSSR, smallest set of smallest rings)

harary_index: Optional[float]

Harary index: half-sum of the off-diagonal elements of the reciprocal distance matrix

hetero_ring_count: Optional[int]

Number of heterocyclic rings (rings containing at least one non-carbon atom)

hetero_rings: Optional[list[list[int]]]

Atom indices of the heterocyclic rings

hetero_aliphatic_ring_count: Optional[int]

Number of aliphatic heterocyclic rings

hetero_aliphatic_rings: Optional[list[list[int]]]

Atom indices of the aliphatic heterocyclic rings

hetero_aromatic_ring_count: Optional[int]

Number of aromatic heterocyclic rings

hetero_aromatic_rings: Optional[list[list[int]]]

Atom indices of the aromatic heterocyclic rings

hyper_wiener_index: Optional[int]

Hyper-Wiener index

is_connected_graph: Optional[bool]

Whether the structure is a connected graph

largest_conjugated_system: Optional[list[int]]

Atom indices of the largest conjugated system

largest_conjugated_system_size: Optional[int]

Size of the largest conjugated system (number of pi electron pairs)

largest_ring: Optional[list[int]]

Atom indices of the largest ring

largest_ring_size: Optional[int]

Size of the largest ring

largest_ring_size_of_atom: Optional[list[AtomIntValue]]

Per-atom size of the largest ring containing that atom

largest_ring_system: Optional[list[int]]

Ring indices (into rings) of the largest ring system

largest_ring_system_size: Optional[int]

Size of the largest ring system (number of rings; 0 when acyclic)

platt_index: Optional[int]

Platt index: total sum of the edge degrees of the molecular graph

randic_index: Optional[float]

Randic (molecular connectivity) index

ring_atom_count: Optional[int]

Number of ring atoms

ring_bond_count: Optional[int]

Number of ring bonds

ring_count: Optional[int]

Number of rings

rings: Optional[list[list[int]]]

Atom indices of the rings

ring_count_of_atom: Optional[list[AtomIntValue]]

Per-atom number of rings (SSSR) the atom is part of

ring_system_count: Optional[int]

Number of ring systems (fused and spiro rings belong to one ring system)

ring_systems: Optional[list[list[int]]]

Ring indices (positions into rings) grouped by ring system. Request rings too (when filtering with types) to resolve these indices to atoms.

rotatable_bond_count: Optional[int]

Number of rotatable bonds

smallest_ring: Optional[list[int]]

Atom indices of the smallest ring

smallest_ring_size: Optional[int]

Size of the smallest ring

smallest_ring_size_of_atom: Optional[list[AtomIntValue]]

Per-atom size of the smallest ring containing that atom

smallest_ring_system: Optional[list[int]]

Ring indices (into rings) of the smallest ring system

smallest_ring_system_size: Optional[int]

Size of the smallest ring system (number of rings; 0 when acyclic)

stereo_double_bond_count: Optional[int]

Number of stereo double bonds

steric_effect: Optional[list[AtomDoubleValue]]

Per-atom topological steric effect index (TSEI)

szeged_index: Optional[int]

Szeged index

wiener_index: Optional[int]

Wiener index (average topological atom distance)

wiener_polarity: Optional[int]

Wiener polarity number (number of atom pairs at distance 3)

class AtomIntValue(typing.NamedTuple):

An integer descriptor of a single atom.

AtomIntValue(atom_index: int, value: int)

Create new instance of AtomIntValue(atom_index, value)

atom_index: int

The atom index

value: int

The descriptor value for this atom

class AtomDoubleValue(typing.NamedTuple):

A floating-point descriptor of a single atom.

AtomDoubleValue(atom_index: int, value: float)

Create new instance of AtomDoubleValue(atom_index, value)

atom_index: int

The atom index

value: float

The descriptor value for this atom

class AromatizationMethod(enum.IntEnum):

Aromatization method used by the topological analysis.

The values match MoleculeGraph.AROM_* constants from the Chemaxon Java API.

General aromatization (default; also recognizes fused aromatic systems). See: https://apidocs.chemaxon.com/jchem/developer/beans/api/chemaxon/struc/MoleculeGraph.html#AROM_GENERAL