Chemical Data Processing Library Python API - Version 1.4.0
Public Member Functions | Properties | List of all members
CDPL.ForceField.MMFF94ChargeCalculator Class Reference

Calculator for the MMFF94 partial atomic charges of a molecular graph. More...

+ Inheritance diagram for CDPL.ForceField.MMFF94ChargeCalculator:

Public Member Functions

None __init__ ()
 Constructs the MMFF94ChargeCalculator instance.
 
None __init__ (MMFF94ChargeCalculator calc)
 Initializes a copy of the MMFF94ChargeCalculator instance calc. More...
 
None __init__ (Chem.MolecularGraph molgraph, Util.DArray charges, bool strict)
 Constructs the MMFF94ChargeCalculator instance and immediately calculates partial charges for the atoms of molgraph. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
None setAromaticRingSetFunction (MMFF94RingSetFunction func)
 Specifies the function used to retrieve the aromatic ring set of a molecular graph. More...
 
None setNumericAtomTypeFunction (MMFF94NumericAtomTypeFunction func)
 Specifies the function used to retrieve the numeric MMFF94 atom type of an atom. More...
 
None setSymbolicAtomTypeFunction (MMFF94SymbolicAtomTypeFunction func)
 Specifies the function used to retrieve the symbolic MMFF94 atom type of an atom. More...
 
None setBondTypeIndexFunction (MMFF94BondTypeIndexFunction func)
 Specifies the function used to retrieve the MMFF94 bond type index of a bond. More...
 
None setAtomTypePropertyTable (MMFF94AtomTypePropertyTable table)
 Sets the atom-type property table to use. More...
 
None setFormalChargeDefinitionTable (MMFF94FormalAtomChargeDefinitionTable table)
 Sets the formal-charge definition table to use. More...
 
None setBondChargeIncrementTable (MMFF94BondChargeIncrementTable table)
 Sets the bond charge increment table to use. More...
 
None setPartialBondChargeIncrementTable (MMFF94PartialBondChargeIncrementTable table)
 Sets the partial bond charge increment table to use. More...
 
MMFF94ChargeCalculator assign (MMFF94ChargeCalculator parameterizer)
 Replaces the current state of self with a copy of the state of the MMFF94ChargeCalculator instance parameterizer. More...
 
None calculate (Chem.MolecularGraph molgraph, Util.DArray charges, bool strict)
 Calculates MMFF94 partial charges for the atoms of a molecular graph. More...
 
Util.DArray getFormalCharges ()
 Returns the formal atomic charges assigned during the last calculation. More...
 
Util.DArray formalCharges ()
 

Properties

 objectID = property(getObjectID)
 

Detailed Description

Calculator for the MMFF94 partial atomic charges of a molecular graph.

Partial atomic charges are constructed from full or fractional formal atomic charges and per-bond charge-increment contributions according to the MMFF94 parameterization. Parameter tables and atom-/bond-typing functions can be customized via the corresponding setter methods; default tables and typing functions match the standard MMFF94 reference.

Constructor & Destructor Documentation

◆ __init__() [1/2]

None CDPL.ForceField.MMFF94ChargeCalculator.__init__ ( MMFF94ChargeCalculator  calc)

Initializes a copy of the MMFF94ChargeCalculator instance calc.

Parameters
calcThe MMFF94ChargeCalculator instance to copy.

◆ __init__() [2/2]

None CDPL.ForceField.MMFF94ChargeCalculator.__init__ ( Chem.MolecularGraph  molgraph,
Util.DArray  charges,
bool  strict 
)

Constructs the MMFF94ChargeCalculator instance and immediately calculates partial charges for the atoms of molgraph.

Parameters
molgraphThe molecular graph for which to calculate partial atomic charges.
chargesThe output array storing the calculated partial charges.
strictIf True, strict parameterization is performed (and may fail).

Member Function Documentation

◆ getObjectID()

int CDPL.ForceField.MMFF94ChargeCalculator.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python MMFF94ChargeCalculator instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two MMFF94ChargeCalculator instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ setAromaticRingSetFunction()

None CDPL.ForceField.MMFF94ChargeCalculator.setAromaticRingSetFunction ( MMFF94RingSetFunction  func)

Specifies the function used to retrieve the aromatic ring set of a molecular graph.

Parameters
funcThe aromatic ring set function.

◆ setNumericAtomTypeFunction()

None CDPL.ForceField.MMFF94ChargeCalculator.setNumericAtomTypeFunction ( MMFF94NumericAtomTypeFunction  func)

Specifies the function used to retrieve the numeric MMFF94 atom type of an atom.

Parameters
funcThe numeric atom type function.

◆ setSymbolicAtomTypeFunction()

None CDPL.ForceField.MMFF94ChargeCalculator.setSymbolicAtomTypeFunction ( MMFF94SymbolicAtomTypeFunction  func)

Specifies the function used to retrieve the symbolic MMFF94 atom type of an atom.

Parameters
funcThe symbolic atom type function.

◆ setBondTypeIndexFunction()

None CDPL.ForceField.MMFF94ChargeCalculator.setBondTypeIndexFunction ( MMFF94BondTypeIndexFunction  func)

Specifies the function used to retrieve the MMFF94 bond type index of a bond.

Parameters
funcThe bond type index function.

◆ setAtomTypePropertyTable()

None CDPL.ForceField.MMFF94ChargeCalculator.setAtomTypePropertyTable ( MMFF94AtomTypePropertyTable  table)

Sets the atom-type property table to use.

Parameters
tableThe table providing per-atom-type properties.

◆ setFormalChargeDefinitionTable()

None CDPL.ForceField.MMFF94ChargeCalculator.setFormalChargeDefinitionTable ( MMFF94FormalAtomChargeDefinitionTable  table)

Sets the formal-charge definition table to use.

Parameters
tableThe table providing formal-charge definitions.

◆ setBondChargeIncrementTable()

None CDPL.ForceField.MMFF94ChargeCalculator.setBondChargeIncrementTable ( MMFF94BondChargeIncrementTable  table)

Sets the bond charge increment table to use.

Parameters
tableThe table providing bond charge increments.

◆ setPartialBondChargeIncrementTable()

None CDPL.ForceField.MMFF94ChargeCalculator.setPartialBondChargeIncrementTable ( MMFF94PartialBondChargeIncrementTable  table)

Sets the partial bond charge increment table to use.

Parameters
tableThe table providing partial bond charge increments.

◆ assign()

MMFF94ChargeCalculator CDPL.ForceField.MMFF94ChargeCalculator.assign ( MMFF94ChargeCalculator  parameterizer)

Replaces the current state of self with a copy of the state of the MMFF94ChargeCalculator instance parameterizer.

Parameters
parameterizerThe MMFF94ChargeCalculator instance to copy.
Returns
self

◆ calculate()

None CDPL.ForceField.MMFF94ChargeCalculator.calculate ( Chem.MolecularGraph  molgraph,
Util.DArray  charges,
bool  strict 
)

Calculates MMFF94 partial charges for the atoms of a molecular graph.

The partial atomic charges are constructed from initial full or fractional formal atomic charges \( q_I^0 \) (usually zero, but, e.g., +1/3 for guanidinium nitrogens) by adding contributions from bond charge increments \( w_{KI} \) which describe the polarity of the bonds to atom i from attached atoms k. Thus, \( w_{KI} \) is the contribution to the total charge on atom i of atom type I accumulated from, and at the expense of, its bonded neighbor k of atom type K. Specifically, MMFF computes \( q_i \) as

\( q_i = (1 - M_I \: u_I) \:q_I^0 + \sum (u_K \: q_K^0) + \sum w_{KI} \)

where \( w_{KI} = -w_{IK} \) and where the sums on the right hand side run over the \( M_I = crd(I) \) atoms k of MMFF atom type K directly attached to atom i ( \( crd(I) \) comes from "MMFFPROP.PAR"). In this equation, \( q_I^0 \) and \( q_K^0 \) are the formal charges assigned in the atom typing procedure (usually, by subroutine XTYPE), and the sum of the first two terms gives the "effective" fractional formal atomic charge residing on atom i. This approach allows a formal atomic charge initially affixed by the atom-typing procedure (e.g., \( q_I^0 \)) to be shared in a prescribed manner with the neighbors bonded to the atom in question. For example, for the series PO4(-3), HPO4(-2), H2PO4-, H3P04, it allows allows the partial charges on the terminal oxygens (each represented by the same numerical atom type, "32") to vary in a way which properly reflects the partial charges obtained from fits to the 6-31G* electrostatic potential. In particular, the difference between the resultant charges \( q_i \) calculated for the single terminal oxygen in H3PO4 and for the four equivalent terminal oxygens in PO4(-3) comes to -0.375, half (because \( u_{32} = -0.5 \)) the difference of -0.75 in the \( q_K^0 \) charges (i.e., 0.00 and -0.75, respectively) and reasonably in accord with the difference of -0.42 found by fitting the electrostatic potential.

Parameters
molgraphThe molecular graph for which to calculate partial atomic charges.
chargesThe output array storing the calculated partial charges.
strictIf True, strict parameterization will be peformed that might fail.

◆ getFormalCharges()

Util.DArray CDPL.ForceField.MMFF94ChargeCalculator.getFormalCharges ( )

Returns the formal atomic charges assigned during the last calculation.

Returns
A reference to the array of formal charges.

◆ formalCharges()

Util.DArray CDPL.ForceField.MMFF94ChargeCalculator.formalCharges ( )
Parameters
arg1
Returns