# propka.energy

## Energy calculations

Energy calculations.

Functions

`angle_distance_factors`([atom1, atom2, ...]) | Calculate distance and angle factors for three atoms for backbone interactions.
`backbone_reorganization`(_, conformation) | Perform calculations related to backbone reorganizations.
`calculate_pair_weight`(parameters, ...) | Calculate the atom-pair based desolvation weight.
`calculate_scale_factor`(parameters, weight) | Calculate desolvation scaling factor.
`calculate_weight`(parameters, num_volume) | Calculate the atom-based desolvation weight.
`check_buried`(num_volume1, num_volume2) | Check to see if an interaction is buried
`check_coo_arg_exception`(group_coo, ...) | Check for COO-ARG interaction atypical behavior.
`check_coo_coo_exception`(group1, group2, version) | Check for COO-COO hydrogen-bond atypical interaction behavior.
`check_coo_his_exception`(group1, group2, version) | Check for COO-HIS atypical interaction behavior
`check_coulomb_pair`(parameters, group1, ...) | Checks if this Coulomb interaction should be done.
`check_cys_cys_exception`(group1, group2, version) | Check for CYS-CYS atypical interaction behavior
`check_cys_his_exception`(group1, group2, version) | Check for CYS-HIS atypical interaction behavior
`check_exceptions`(version, group1, group2) | Checks for atypical behavior in interactions between two groups.
`check_oco_his_exception`(group1, group2, version) | Check for OCO-HIS atypical interaction behavior
`coulomb_energy`(dist, weight, parameters) | Calculates the Coulomb interaction pKa shift based on Coulomb's law.
`electrostatic_interaction`(group1, group2, ...) | Calculate electrostatic interaction betwee two groups.
`hydrogen_bond_energy`(dist, dpka_max, cutoffs) | Calculate hydrogen-bond interaction pKa shift.
`hydrogen_bond_interaction`(group1, group2, ...) | Calculate energy for hydrogen bond interactions between two groups.
`radial_volume_desolvation`(parameters, group) | Calculate desolvation terms for group.

propka.energy.angle_distance_factors(atom1: Atom | None = None, atom2: Atom = None, atom3: Atom = None, center: Sequence[float] | None = None)

  Calculate distance and angle factors for three atoms for backbone interactions.

  NOTE - you need to use atom1 to be the e.g. ASP atom if distance is reset

    at return: [O1 – H2-N3].

  Also generalized to be able to be used for residue ‘centers’ for C=O COO interactions.

  Parameters:

    - atom1 – first atom for calculation (could be None)

    - atom2 – second atom for calculation

    - atom3 – third atom for calculation

    - center – center point between atoms 1 and 2

  Returns
    [distance factor between atoms 1 and 2,

      angle factor, distance factor between atoms 2 and 3]

propka.energy.backbone_reorganization(_, conformation: ConformationContainer) → None

  Perform calculations related to backbone reorganizations.

  NOTE - this was described in the code as “adding test stuff” NOTE - this function does not appear to be used TODO - figure out why a similar function exists in version.py

  Parameters:

    - _ – not used

    - conformation – specific molecule conformation

propka.energy.calculate_pair_weight(parameters: Parameters, num_volume1: int, num_volume2: int) → float

  Calculate the atom-pair based desolvation weight.

  Parameters:

    - num_volume1 – number of heavy atoms within first desolvation volume

    - num_volume2 – number of heavy atoms within second desolvation volume

  Returns:

    desolvation weight

propka.energy.calculate_scale_factor(parameters, weight: float) → float

  Calculate desolvation scaling factor.

  Parameters:

    - parameters – parameters for desolvation calculation

    - weight – weight for scaling factor

  Returns:

    scaling factor

propka.energy.calculate_weight(parameters: Parameters, num_volume: float) → float

  Calculate the atom-based desolvation weight.

  TODO - figure out why a similar function exists in version.py

  Parameters:

    - parameters – parameters for desolvation calculation

    - num_volume – number of heavy atoms within desolvation calculation volume

  Returns:

    desolvation weight

propka.energy.check_buried(num_volume1, num_volume2)

  Check to see if an interaction is buried

  Parameters:

    - num_volume1 – number of buried heavy atoms in volume 1

    - num_volume2 – number of buried heavy atoms in volume 2

  Returns:

    True if interaction is buried, False otherwise

propka.energy.check_coo_arg_exception(group_coo, group_arg, version)

  Check for COO-ARG interaction atypical behavior.

  Uses the two shortest unique distances (involving 2+2 atoms)

  Parameters:

    - group_coo – COO group

    - group_arg – ARG group

    - version – version object

  Returns:

    1. Boolean indicating atypical behavior,

    2. value associated with atypical interaction (None if Boolean is False)

propka.energy.check_coo_coo_exception(group1, group2, version)

  Check for COO-COO hydrogen-bond atypical interaction behavior.

  Parameters:

    - group1 – first group for check

    - group2 – second group for check

    - version – version object

  Returns:

    1. Boolean indicating atypical behavior,

    2. value associated with atypical interaction (None if Boolean is False)

propka.energy.check_coo_his_exception(group1, group2, version)

  Check for COO-HIS atypical interaction behavior

  Parameters:

    - group1 – first group for check

    - group2 – second group for check

    - version – version object

  Returns:

    1. Boolean indicating atypical behavior,

    2. value associated with atypical interaction (None if Boolean is False)

propka.energy.check_coulomb_pair(parameters: Parameters, group1: Group, group2: Group, dist: float) → bool

  Checks if this Coulomb interaction should be done.

  NOTE - this is a propka2.0 hack TODO - figure out why a similar function exists in version.py

  Parameters:

    - parameters – parameters for Coulomb calculations

    - group1 – first interacting group

    - group2 – second interacting group

    - dist – distance between groups

  Returns:

    Boolean

propka.energy.check_cys_cys_exception(group1, group2, version)

  Check for CYS-CYS atypical interaction behavior

  Parameters:

    - group1 – first group for check

    - group2 – second group for check

    - version – version object

  Returns:

    1. Boolean indicating atypical behavior,

    2. value associated with atypical interaction (None if Boolean is False)

propka.energy.check_cys_his_exception(group1, group2, version)

  Check for CYS-HIS atypical interaction behavior

  Parameters:

    - group1 – first group for check

    - group2 – second group for check

    - version – version object

  Returns:

    1. Boolean indicating atypical behavior,

    2. value associated with atypical interaction (None if Boolean is False)

propka.energy.check_exceptions(version, group1, group2)

  Checks for atypical behavior in interactions between two groups. Checks are made based on group type.

  TODO - figure out why a similar function exists in version.py

  Parameters:

    - version – version object

    - group1 – first group for check

    - group2 – second group for check

  Returns:

    1. Boolean indicating atypical behavior,

    2. value associated with atypical interaction (None if Boolean is False)

propka.energy.check_oco_his_exception(group1, group2, version)

  Check for OCO-HIS atypical interaction behavior

  Parameters:

    - group1 – first group for check

    - group2 – second group for check

    - version – version object

  Returns:

    1. Boolean indicating atypical behavior,

    2. value associated with atypical interaction (None if Boolean is False)

propka.energy.coulomb_energy(dist: float, weight: float, parameters) → float

  Calculates the Coulomb interaction pKa shift based on Coulomb’s law.

  Parameters:

    - dist – distance for electrostatic interaction

    - weight – scaling of dielectric constant

    - parameters – parameter object for calculation

  Returns:

    pKa shift

propka.energy.electrostatic_interaction(group1, group2, dist, version)

  Calculate electrostatic interaction betwee two groups.

  Parameters:

    - group1 – first interacting group

    - group2 – second interacting group

    - dist – distance between groups

    - version – version-specific object with parameters and functions

  Returns:

    electrostatic interaction energy or None (if no interaction is appropriate)

propka.energy.hydrogen_bond_energy(dist, dpka_max: float, cutoffs, f_angle=1.0) → float

  Calculate hydrogen-bond interaction pKa shift.

  Parameters:

    - dist – distance for hydrogen bond

    - dpka_max – maximum pKa value shift

    - cutoffs – array with max and min distance values

    - f_angle – angle scaling factor

  Returns:

    pKa shift value

propka.energy.hydrogen_bond_interaction(group1: Group, group2: Group, version: Version)

  Calculate energy for hydrogen bond interactions between two groups.

  Parameters:

    - group1 – first interacting group

    - group2 – second interacting group

    - version – an object that contains version-specific parameters

  Returns:

    hydrogen bond interaction energy

propka.energy.radial_volume_desolvation(parameters, group: Group) → None

  Calculate desolvation terms for group.

  Parameters:

    - parameters – parameters for desolvation calculation

    - group – group of atoms for calculation