Get charge#
Determining formal, tabulated, and force field partial charges.
The function molsysmt.physchem.get_charge() evaluates electric charges across hierarchical elements using three distinct definitions:
'physical_pH7': Standard integer residue charges at neutral pH.'collantes': Tabulated residue charges from Collantes et al.'OpenMM': Partial atomic charges extracted from molecular mechanics force fields.
Added in version 1.0.0.
API documentation
Follow this link for a detailed description of the input arguments, raised errors, and returned objects of this function: molsysmt.physchem.get_charge().
Basic usage#
By default, definition='physical_pH7' evaluates standard integer charges for amino acid residues at physiological pH (e.g. Arg/Lys = +1, Asp/Glu = -1, neutral = 0):
import molsysmt as msm
import pyunitwizard as puw
molsys = msm.convert(msm.systems['Trp-Cage']['1l2y.h5msm'])
Note
Demo Systems Catalog
This tutorial uses demonstration datasets provided by MolSysMT. To explore the full catalog of bundled systems, forms, and file paths, visit the Demo Systems guide.
We query residue charges and the total net charge of the system:
charges_res = msm.physchem.get_charge(molsys, element='group', definition='physical_pH7')
charge_net = msm.physchem.get_charge(molsys, element='system', definition='physical_pH7')
print('Residue charges (elementary charge):', charges_res)
print('Total net system charge:', charge_net)
Residue charges (elementary charge): [0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 -1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0] elementary_charge
Total net system charge: 1.0 elementary_charge
Alternative tabulated charges#
The definition='collantes' parameter applies the continuous tabulated charge scale from Collantes et al.:
charges_collantes = msm.physchem.get_charge(molsys, element='group', definition='collantes')
print('Collantes scale charges:', charges_collantes)
Collantes scale charges: [1.36 0.1 0.72 0.09 1.31 1.08 0.1 0.53 1.25 0.02 0.02 0.16 0.56 0.56 0.02 1.69 0.16 0.16 0.16 0.56] elementary_charge
Partial atomic charges from force fields#
When using definition='OpenMM', partial charges assigned to individual atoms by force field parameter sets (such as AMBER or CHARMM) are extracted:
prmtop_sys = msm.convert(msm.systems['pentalanine']['pentalanine.prmtop'])
omm_sys = msm.convert(prmtop_sys, to_form='openmm.System')
partial_charges = msm.physchem.get_charge(omm_sys, element='atom', definition='OpenMM')
print('First 10 partial atomic charges (e):\n', partial_charges[:10])
First 10 partial atomic charges (e):
[0.1123 -0.3662 0.1123 0.1123 0.5972 -0.5679 -0.4157 0.2719 0.0337 0.0823] elementary_charge
See also
Related Tools & References
Convert: Convert molecular systems with
molsysmt.basic.convert().Get mass: Calculate system mass with
molsysmt.physchem.get_mass().Get electronegativity: Query atomic electronegativity with
molsysmt.physchem.get_electronegativity().