molsysmt.physchem.get_charge#
- molsysmt.physchem.get_charge(molecular_system, element='group', selection='all', definition='physical_pH7', forcefield='AMBER14', water_model=None, syntax='MolSysMT', skip_digestion=False)[source]#
Electric charge for the selected elements.
Returns the electric charge aggregated at the requested hierarchical level. Two families of definitions are supported:
'physical_pH7'and'collantes'— residue-based tabulated scales that assign a fixed charge to each amino acid group. The charge is then summed across all groups within the requested element.'OpenMM'— reads partial charges from anopenmm.Systemoropenmm.Simulationobject’sNonbondedForce. If a different form is provided, the system is first converted toopenmm.Systemusing the specifiedforcefield.
- Parameters:
molecular_system (molecular system) – Molecular system in any supported MolSysMT format.
element (str, default='group') – Structural element level to query (‘atom’, ‘group’, ‘component’, ‘molecule’, ‘chain’, ‘entity’).
selection (str, list, tuple, or numpy.ndarray, default='all') – Selection string or boolean/integer array specifying elements.
definition (str, default='physical_pH7') – Reference dataset used to assign the requested physical property.
forcefield (str, default='AMBER14') – Force field parameter identifier or name.
water_model (str, default=None) – Water model parameter identifier (e.g., ‘TIP3P’).
syntax (str, default='MolSysMT') – Selection syntax used to evaluate selection (e.g., ‘MolSysMT’, ‘MDTraj’).
skip_digestion (bool, default=False) – Whether to skip MolSysMT’s internal argument digestion mechanism.
- Returns:
Electric charge as a PyUnitWizard quantity in elementary charge units (e). Shape is
(n_elements,)for atom/group/component/ molecule/chain/entity elements, or a scalar forelement='system'.- Return type:
quantity
- Raises:
NotImplementedMethodError – If an unsupported
definitionis requested.ArgumentChoiceError – If
element='atom'is combined with a residue-based definition, or if a mid-hierarchy element is combined with theopenmm.Systemform.
Notes
Values are rounded to 4 decimal places for the
'OpenMM'definition to avoid floating-point noise from unit conversions.Added in version 1.0.0.