|
|
|
@@ -1,216 +1,281 @@
|
|
|
|
from __future__ import division
|
|
|
|
"""Contains version-specific methods and parameters.
|
|
|
|
from __future__ import print_function
|
|
|
|
|
|
|
|
import math
|
|
|
|
|
|
|
|
import sys, os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import propka.lib as lib
|
|
|
|
TODO - this module unnecessarily confuses the code. Can we eliminate it?
|
|
|
|
from propka.lib import info, warning
|
|
|
|
"""
|
|
|
|
import propka.calculations as calculations
|
|
|
|
from propka.lib import info
|
|
|
|
import propka.parameters
|
|
|
|
import propka.calculations as calcs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class version:
|
|
|
|
class Version:
|
|
|
|
def __init__(self,parameters):
|
|
|
|
"""Store version-specific methods and parameters."""
|
|
|
|
|
|
|
|
def __init__(self, parameters):
|
|
|
|
self.parameters = parameters
|
|
|
|
self.parameters = parameters
|
|
|
|
return
|
|
|
|
self.desolvation_model = self.empty_function
|
|
|
|
|
|
|
|
self.weight_pair_method = self.empty_function
|
|
|
|
|
|
|
|
self.hydrogen_bond_interaction_model = self.empty_function
|
|
|
|
|
|
|
|
self.sidechain_interaction_model = self.empty_function
|
|
|
|
|
|
|
|
self.electrostatic_interaction_model = self.empty_function
|
|
|
|
|
|
|
|
self.coulomb_interaction_model = self.empty_function
|
|
|
|
|
|
|
|
self.check_coulomb_pair_method = self.empty_function
|
|
|
|
|
|
|
|
self.backbone_reorganisation_method = self.empty_function
|
|
|
|
|
|
|
|
self.exception_check_method = self.empty_function
|
|
|
|
|
|
|
|
self.molecular_preparation_method = self.empty_function
|
|
|
|
|
|
|
|
self.prepare_bonds = self.empty_function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
|
|
|
def empty_function(*args):
|
|
|
|
|
|
|
|
"""Placeholder function so we don't use uninitialized variables.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
|
|
|
args: whatever arguments would have been passed to the function
|
|
|
|
|
|
|
|
Raises:
|
|
|
|
|
|
|
|
NotImplementedError
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
err = "Called an empty Version function with args %s" % args
|
|
|
|
|
|
|
|
raise NotImplementedError(err)
|
|
|
|
|
|
|
|
|
|
|
|
# desolvation
|
|
|
|
|
|
|
|
def calculate_desolvation(self, group):
|
|
|
|
def calculate_desolvation(self, group):
|
|
|
|
|
|
|
|
"""Calculate desolvation energy using assigned model."""
|
|
|
|
return self.desolvation_model(self.parameters, group)
|
|
|
|
return self.desolvation_model(self.parameters, group)
|
|
|
|
|
|
|
|
|
|
|
|
def calculate_pair_weight(self, num_volume1, num_volume2):
|
|
|
|
def calculate_pair_weight(self, num_volume1, num_volume2):
|
|
|
|
|
|
|
|
"""Calculate pair weight using assigned model."""
|
|
|
|
return self.weight_pair_method(self.parameters, num_volume1, num_volume2)
|
|
|
|
return self.weight_pair_method(self.parameters, num_volume1, num_volume2)
|
|
|
|
|
|
|
|
|
|
|
|
# side chains
|
|
|
|
|
|
|
|
def hydrogen_bond_interaction(self, group1, group2):
|
|
|
|
def hydrogen_bond_interaction(self, group1, group2):
|
|
|
|
|
|
|
|
"""Calculate H-bond energy using assigned model."""
|
|
|
|
return self.hydrogen_bond_interaction_model(group1, group2, self)
|
|
|
|
return self.hydrogen_bond_interaction_model(group1, group2, self)
|
|
|
|
|
|
|
|
|
|
|
|
def calculateSideChainEnergy(self, distance, dpka_max, cutoff, weight, f_angle):
|
|
|
|
def calculate_side_chain_energy(self, distance, dpka_max, cutoff, _, f_angle):
|
|
|
|
return self.sidechain_interaction_model(distance, dpka_max, cutoff, f_angle) # weight is ignored in 3.0 Sep07
|
|
|
|
"""Calculate sidechain energy using assigned model."""
|
|
|
|
|
|
|
|
return self.sidechain_interaction_model(distance, dpka_max, cutoff, f_angle)
|
|
|
|
|
|
|
|
|
|
|
|
# coulomb
|
|
|
|
|
|
|
|
def electrostatic_interaction(self, group1, group2, distance):
|
|
|
|
def electrostatic_interaction(self, group1, group2, distance):
|
|
|
|
|
|
|
|
"""Calculate electrostatic energy using assigned model."""
|
|
|
|
return self.electrostatic_interaction_model(group1, group2, distance, self)
|
|
|
|
return self.electrostatic_interaction_model(group1, group2, distance, self)
|
|
|
|
|
|
|
|
|
|
|
|
def calculate_coulomb_energy(self, distance, weight):
|
|
|
|
def calculate_coulomb_energy(self, distance, weight):
|
|
|
|
|
|
|
|
"""Calculate Coulomb energy using assigned model."""
|
|
|
|
return self.coulomb_interaction_model(distance, weight, self.parameters)
|
|
|
|
return self.coulomb_interaction_model(distance, weight, self.parameters)
|
|
|
|
|
|
|
|
|
|
|
|
def check_coulomb_pair(self, group1, group2, distance):
|
|
|
|
def check_coulomb_pair(self, group1, group2, distance):
|
|
|
|
|
|
|
|
"""Check Coulomb pair using assigned model."""
|
|
|
|
return self.check_coulomb_pair_method(self.parameters, group1, group2, distance)
|
|
|
|
return self.check_coulomb_pair_method(self.parameters, group1, group2, distance)
|
|
|
|
|
|
|
|
|
|
|
|
# backbone re-organisation
|
|
|
|
def calculate_backbone_reorganization(self, conformation):
|
|
|
|
def calculatebackbone_reorganization(self, conformation):
|
|
|
|
"""Calculate backbone reorganization using assigned model."""
|
|
|
|
return self.backbone_reorganisation_method(self.parameters, conformation)
|
|
|
|
return self.backbone_reorganisation_method(self.parameters, conformation)
|
|
|
|
|
|
|
|
|
|
|
|
# exceptions
|
|
|
|
|
|
|
|
def check_exceptions(self, group1, group2):
|
|
|
|
def check_exceptions(self, group1, group2):
|
|
|
|
|
|
|
|
"""Calculate exceptions using assigned model."""
|
|
|
|
return self.exception_check_method(self, group1, group2)
|
|
|
|
return self.exception_check_method(self, group1, group2)
|
|
|
|
|
|
|
|
|
|
|
|
def setup_bonding_and_protonation(self, molecular_container):
|
|
|
|
def setup_bonding_and_protonation(self, molecular_container):
|
|
|
|
|
|
|
|
"""Setup bonding and protonation using assigned model."""
|
|
|
|
return self.molecular_preparation_method(self.parameters, molecular_container)
|
|
|
|
return self.molecular_preparation_method(self.parameters, molecular_container)
|
|
|
|
|
|
|
|
|
|
|
|
def setup_bonding(self, molecular_container):
|
|
|
|
def setup_bonding(self, molecular_container):
|
|
|
|
|
|
|
|
"""Setup bonding using assigned model."""
|
|
|
|
return self.prepare_bonds(self.parameters, molecular_container)
|
|
|
|
return self.prepare_bonds(self.parameters, molecular_container)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VersionA(Version):
|
|
|
|
|
|
|
|
"""TODO - figure out what this is."""
|
|
|
|
|
|
|
|
|
|
|
|
class version_A(version):
|
|
|
|
|
|
|
|
def __init__(self, parameters):
|
|
|
|
def __init__(self, parameters):
|
|
|
|
|
|
|
|
"""Initialize object with parameters."""
|
|
|
|
# set the calculation rutines used in this version
|
|
|
|
# set the calculation rutines used in this version
|
|
|
|
version.__init__(self, parameters)
|
|
|
|
super().__init__(parameters)
|
|
|
|
|
|
|
|
self.molecular_preparation_method = calcs.setup_bonding_and_protonation
|
|
|
|
# atom naming, bonding, and protonation
|
|
|
|
self.prepare_bonds = calcs.setup_bonding
|
|
|
|
self.molecular_preparation_method = propka.calculations.setup_bonding_and_protonation
|
|
|
|
self.desolvation_model = calcs.radial_volume_desolvation
|
|
|
|
self.prepare_bonds = propka.calculations.setup_bonding
|
|
|
|
self.weight_pair_method = calcs.calculate_pair_weight
|
|
|
|
|
|
|
|
self.sidechain_interaction_model = calcs.hydrogen_bond_energy
|
|
|
|
|
|
|
|
self.hydrogen_bond_interaction_model = calcs.hydrogen_bond_interaction
|
|
|
|
# desolvation related methods
|
|
|
|
self.electrostatic_interaction_model = calcs.electrostatic_interaction
|
|
|
|
self.desolvation_model = calculations.radial_volume_desolvation
|
|
|
|
self.check_coulomb_pair_method = calcs.check_coulomb_pair
|
|
|
|
self.weight_pair_method = calculations.calculate_pair_weight
|
|
|
|
self.coulomb_interaction_model = calcs.coulomb_energy
|
|
|
|
|
|
|
|
self.backbone_interaction_model = calcs.hydrogen_bond_energy
|
|
|
|
# side chain methods
|
|
|
|
self.backbone_reorganisation_method = calcs.backbone_reorganization
|
|
|
|
self.sidechain_interaction_model = propka.calculations.hydrogen_bond_energy
|
|
|
|
self.exception_check_method = calcs.check_exceptions
|
|
|
|
self.hydrogen_bond_interaction_model = propka.calculations.hydrogen_bond_interaction
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# colomb methods
|
|
|
|
|
|
|
|
self.electrostatic_interaction_model = propka.calculations.electrostatic_interaction
|
|
|
|
|
|
|
|
self.check_coulomb_pair_method = propka.calculations.check_coulomb_pair
|
|
|
|
|
|
|
|
self.coulomb_interaction_model = propka.calculations.coulomb_energy
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#backbone
|
|
|
|
|
|
|
|
self.backbone_interaction_model = propka.calculations.hydrogen_bond_energy
|
|
|
|
|
|
|
|
self.backbone_reorganisation_method = propka.calculations.backbone_reorganization
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# exception methods
|
|
|
|
|
|
|
|
self.exception_check_method = propka.calculations.check_exceptions
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_hydrogen_bond_parameters(self, atom1, atom2):
|
|
|
|
def get_hydrogen_bond_parameters(self, atom1, atom2):
|
|
|
|
|
|
|
|
"""Get hydrogen bond parameters for two atoms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
|
|
|
atom1: first atom
|
|
|
|
|
|
|
|
atom2: second atom
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
|
|
|
|
[dpka_max, cutoff]
|
|
|
|
|
|
|
|
"""
|
|
|
|
dpka_max = self.parameters.sidechain_interaction
|
|
|
|
dpka_max = self.parameters.sidechain_interaction
|
|
|
|
cutoff = self.parameters.sidechain_cutoffs.get_value(atom1.group_type, atom2.group_type)
|
|
|
|
cutoff = self.parameters.sidechain_cutoffs.get_value(
|
|
|
|
|
|
|
|
atom1.group_type, atom2.group_type)
|
|
|
|
return [dpka_max, cutoff]
|
|
|
|
return [dpka_max, cutoff]
|
|
|
|
|
|
|
|
|
|
|
|
def get_backbone_hydrogen_bond_parameters(self, backbone_atom, atom):
|
|
|
|
def get_backbone_hydrogen_bond_parameters(self, backbone_atom, atom):
|
|
|
|
|
|
|
|
"""Get hydrogen bond parameters between backbone atom and other atom.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
|
|
|
backbone_atom: backbone atom
|
|
|
|
|
|
|
|
atom: other atom
|
|
|
|
|
|
|
|
Returns
|
|
|
|
|
|
|
|
[v, [c1, c3]] TODO - figure out what this is
|
|
|
|
|
|
|
|
"""
|
|
|
|
if backbone_atom.group_type == 'BBC':
|
|
|
|
if backbone_atom.group_type == 'BBC':
|
|
|
|
if atom.group_type in self.parameters.backbone_CO_hydrogen_bond.keys():
|
|
|
|
if atom.group_type in self.parameters.backbone_CO_hydrogen_bond.keys():
|
|
|
|
[v,c1,c2] = self.parameters.backbone_CO_hydrogen_bond[atom.group_type]
|
|
|
|
[v, c1, c2] = self.parameters.backbone_CO_hydrogen_bond[
|
|
|
|
return [v,[c1,c2]]
|
|
|
|
atom.group_type]
|
|
|
|
|
|
|
|
return [v, [c1, c2]]
|
|
|
|
if backbone_atom.group_type == 'BBN':
|
|
|
|
if backbone_atom.group_type == 'BBN':
|
|
|
|
if atom.group_type in self.parameters.backbone_NH_hydrogen_bond.keys():
|
|
|
|
if atom.group_type in self.parameters.backbone_NH_hydrogen_bond.keys():
|
|
|
|
[v,c1,c2] = self.parameters.backbone_NH_hydrogen_bond[atom.group_type]
|
|
|
|
[v, c1, c2] = self.parameters.backbone_NH_hydrogen_bond[
|
|
|
|
return [v,[c1,c2]]
|
|
|
|
atom.group_type]
|
|
|
|
|
|
|
|
return [v, [c1, c2]]
|
|
|
|
return None
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SimpleHB(VersionA):
|
|
|
|
|
|
|
|
"""A simple hydrogen bond version."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class simple_hb(version_A):
|
|
|
|
|
|
|
|
def __init__(self, parameters):
|
|
|
|
def __init__(self, parameters):
|
|
|
|
|
|
|
|
"""Initialize object with parameters."""
|
|
|
|
# set the calculation rutines used in this version
|
|
|
|
# set the calculation rutines used in this version
|
|
|
|
version_A.__init__(self, parameters)
|
|
|
|
super().__init__(parameters)
|
|
|
|
info('Using simple hb model')
|
|
|
|
info('Using simple hb model')
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_hydrogen_bond_parameters(self, atom1, atom2):
|
|
|
|
def get_hydrogen_bond_parameters(self, atom1, atom2):
|
|
|
|
return self.parameters.hydrogen_bonds.get_value(atom1.element, atom2.element)
|
|
|
|
"""Get hydrogen bond parameters for two atoms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
|
|
|
atom1: first atom
|
|
|
|
|
|
|
|
atom2: second atom
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
|
|
|
|
[dpka_max, cutoff]
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
return self.parameters.hydrogen_bonds.get_value(
|
|
|
|
|
|
|
|
atom1.element, atom2.element)
|
|
|
|
|
|
|
|
|
|
|
|
def get_backbone_hydrogen_bond_parameters(self, backbone_atom, atom):
|
|
|
|
def get_backbone_hydrogen_bond_parameters(self, backbone_atom, atom):
|
|
|
|
return self.parameters.hydrogen_bonds.get_value(backbone_atom.element, atom.element)
|
|
|
|
"""Get hydrogen bond parameters between backbone atom and other atom.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
|
|
|
backbone_atom: backbone atom
|
|
|
|
|
|
|
|
atom: other atom
|
|
|
|
|
|
|
|
Returns
|
|
|
|
|
|
|
|
[v, [c1, c3]] TODO - figure out what this is
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
return self.parameters.hydrogen_bonds.get_value(
|
|
|
|
|
|
|
|
backbone_atom.element, atom.element)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ElementBasedLigandInteractions(VersionA):
|
|
|
|
|
|
|
|
"""TODO - figure out what this is."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class element_based_ligand_interactions(version_A):
|
|
|
|
|
|
|
|
def __init__(self, parameters):
|
|
|
|
def __init__(self, parameters):
|
|
|
|
|
|
|
|
"""Initialize object with parameters."""
|
|
|
|
# set the calculation rutines used in this version
|
|
|
|
# set the calculation rutines used in this version
|
|
|
|
version_A.__init__(self, parameters)
|
|
|
|
super().__init__(parameters)
|
|
|
|
info('Using detailed SC model!')
|
|
|
|
info('Using detailed SC model!')
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
def get_hydrogen_bond_parameters(self, atom1, atom2):
|
|
|
|
def get_hydrogen_bond_parameters(self, atom1, atom2):
|
|
|
|
if not 'hetatm' in [atom1.type, atom2.type]:
|
|
|
|
"""Get hydrogen bond parameters for two atoms.
|
|
|
|
# this is a protein-protein interaction
|
|
|
|
|
|
|
|
dpka_max = self.parameters.sidechain_interaction.get_value(atom1.group_type, atom2.group_type)
|
|
|
|
|
|
|
|
cutoff = self.parameters.sidechain_cutoffs.get_value(atom1.group_type, atom2.group_type)
|
|
|
|
|
|
|
|
return [dpka_max, cutoff]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
|
|
|
atom1: first atom
|
|
|
|
|
|
|
|
atom2: second atom
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
|
|
|
|
[dpka_max, cutoff]
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
if 'hetatm' not in [atom1.type, atom2.type]:
|
|
|
|
|
|
|
|
# this is a protein-protein interaction
|
|
|
|
|
|
|
|
dpka_max = self.parameters.sidechain_interaction.get_value(
|
|
|
|
|
|
|
|
atom1.group_type, atom2.group_type)
|
|
|
|
|
|
|
|
cutoff = self.parameters.sidechain_cutoffs.get_value(
|
|
|
|
|
|
|
|
atom1.group_type, atom2.group_type)
|
|
|
|
|
|
|
|
return [dpka_max, cutoff]
|
|
|
|
# at least one ligand atom is involved in this interaction
|
|
|
|
# at least one ligand atom is involved in this interaction
|
|
|
|
# make sure that we are using the heavy atoms for finding paramters
|
|
|
|
# make sure that we are using the heavy atoms for finding paramters
|
|
|
|
elements = []
|
|
|
|
elements = []
|
|
|
|
for a in [atom1, atom2]:
|
|
|
|
for atom in [atom1, atom2]:
|
|
|
|
if a.element == 'H': elements.append(a.bonded_atoms[0].element)
|
|
|
|
if atom.element == 'H':
|
|
|
|
else: elements.append(a.element)
|
|
|
|
elements.append(atom.bonded_atoms[0].element)
|
|
|
|
|
|
|
|
else:
|
|
|
|
return self.parameters.hydrogen_bonds.get_value(elements[0], elements[1])
|
|
|
|
elements.append(atom.element)
|
|
|
|
|
|
|
|
return self.parameters.hydrogen_bonds.get_value(
|
|
|
|
|
|
|
|
elements[0], elements[1])
|
|
|
|
|
|
|
|
|
|
|
|
def get_backbone_hydrogen_bond_parameters(self, backbone_atom, atom):
|
|
|
|
def get_backbone_hydrogen_bond_parameters(self, backbone_atom, atom):
|
|
|
|
|
|
|
|
"""Get hydrogen bond parameters between backbone atom and other atom.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
|
|
|
backbone_atom: backbone atom
|
|
|
|
|
|
|
|
atom: other atom
|
|
|
|
|
|
|
|
Returns
|
|
|
|
|
|
|
|
[v, [c1, c3]] TODO - figure out what this is
|
|
|
|
|
|
|
|
"""
|
|
|
|
if atom.type == 'atom':
|
|
|
|
if atom.type == 'atom':
|
|
|
|
# this is a backbone-protein interaction
|
|
|
|
# this is a backbone-protein interaction
|
|
|
|
if backbone_atom.group_type == 'BBC' and\
|
|
|
|
if (backbone_atom.group_type == 'BBC'
|
|
|
|
atom.group_type in self.parameters.backbone_CO_hydrogen_bond.keys():
|
|
|
|
and atom.group_type
|
|
|
|
[v,c1,c2] = self.parameters.backbone_CO_hydrogen_bond[atom.group_type]
|
|
|
|
in self.parameters.backbone_CO_hydrogen_bond.keys()):
|
|
|
|
return [v,[c1,c2]]
|
|
|
|
[v, c1, c2] = self.parameters.backbone_CO_hydrogen_bond[
|
|
|
|
|
|
|
|
atom.group_type]
|
|
|
|
|
|
|
|
return [v, [c1, c2]]
|
|
|
|
|
|
|
|
|
|
|
|
if backbone_atom.group_type == 'BBN' and\
|
|
|
|
if (backbone_atom.group_type == 'BBN'
|
|
|
|
atom.group_type in self.parameters.backbone_NH_hydrogen_bond.keys():
|
|
|
|
and atom.group_type
|
|
|
|
[v,c1,c2] = self.parameters.backbone_NH_hydrogen_bond[atom.group_type]
|
|
|
|
in self.parameters.backbone_NH_hydrogen_bond.keys()):
|
|
|
|
return [v,[c1,c2]]
|
|
|
|
[v, c1, c2] = self.parameters.backbone_NH_hydrogen_bond[
|
|
|
|
|
|
|
|
atom.group_type]
|
|
|
|
|
|
|
|
return [v, [c1, c2]]
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
# this is a backbone-ligand interaction
|
|
|
|
# this is a backbone-ligand interaction
|
|
|
|
# make sure that we are using the heavy atoms for finding paramters
|
|
|
|
# make sure that we are using the heavy atoms for finding paramters
|
|
|
|
elements = []
|
|
|
|
elements = []
|
|
|
|
for a in [backbone_atom, atom]:
|
|
|
|
for atom2 in [backbone_atom, atom]:
|
|
|
|
if a.element == 'H': elements.append(a.bonded_atoms[0].element)
|
|
|
|
if atom2.element == 'H':
|
|
|
|
else: elements.append(a.element)
|
|
|
|
elements.append(atom2.bonded_atoms[0].element)
|
|
|
|
|
|
|
|
else:
|
|
|
|
res = self.parameters.hydrogen_bonds.get_value(elements[0], elements[1])
|
|
|
|
elements.append(atom2.element)
|
|
|
|
|
|
|
|
res = self.parameters.hydrogen_bonds.get_value(
|
|
|
|
|
|
|
|
elements[0], elements[1])
|
|
|
|
if not res:
|
|
|
|
if not res:
|
|
|
|
info('Could not determine backbone interaction parameters for:',
|
|
|
|
info('Could not determine backbone interaction parameters for:',
|
|
|
|
backbone_atom, atom)
|
|
|
|
backbone_atom, atom)
|
|
|
|
|
|
|
|
return None
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return None
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Propka30(Version):
|
|
|
|
|
|
|
|
"""Version class for PROPKA 3.0."""
|
|
|
|
|
|
|
|
|
|
|
|
class propka30(version):
|
|
|
|
|
|
|
|
def __init__(self, parameters):
|
|
|
|
def __init__(self, parameters):
|
|
|
|
# set the calculation rutines used in this version
|
|
|
|
"""Initialize object with parameters."""
|
|
|
|
version.__init__(self, parameters)
|
|
|
|
# set the calculation routines used in this version
|
|
|
|
|
|
|
|
super().__init__(parameters)
|
|
|
|
# atom naming, bonding, and protonation
|
|
|
|
self.molecular_preparation_method = (
|
|
|
|
self.molecular_preparation_method = propka.calculations.setup_bonding_and_protonation_30_style
|
|
|
|
calcs.setup_bonding_and_protonation_30_style)
|
|
|
|
|
|
|
|
self.desolvation_model = calcs.radial_volume_desolvation
|
|
|
|
# desolvation related methods
|
|
|
|
self.weight_pair_method = calcs.calculate_pair_weight
|
|
|
|
self.desolvation_model = calculations.radial_volume_desolvation
|
|
|
|
self.sidechain_interaction_model = calcs.hydrogen_bond_energy
|
|
|
|
self.weight_pair_method = calculations.calculate_pair_weight
|
|
|
|
self.check_coulomb_pair_method = calcs.check_coulomb_pair
|
|
|
|
|
|
|
|
self.coulomb_interaction_model = calcs.coulomb_energy
|
|
|
|
# side chain methods
|
|
|
|
self.backbone_reorganisation_method = calcs.backbone_reorganization
|
|
|
|
self.sidechain_interaction_model = propka.calculations.hydrogen_bond_energy
|
|
|
|
self.exception_check_method = calcs.check_exceptions
|
|
|
|
|
|
|
|
|
|
|
|
# colomb methods
|
|
|
|
|
|
|
|
self.check_coulomb_pair_method = propka.calculations.check_coulomb_pair
|
|
|
|
|
|
|
|
self.coulomb_interaction_model = propka.calculations.coulomb_energy
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#backbone
|
|
|
|
|
|
|
|
self.backbone_reorganisation_method = propka.calculations.backbone_reorganization
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# exception methods
|
|
|
|
|
|
|
|
self.exception_check_method = propka.calculations.check_exceptions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_hydrogen_bond_parameters(self, atom1, atom2):
|
|
|
|
def get_hydrogen_bond_parameters(self, atom1, atom2):
|
|
|
|
dpka_max = self.parameters.sidechain_interaction.get_value(atom1.group_type, atom2.group_type)
|
|
|
|
"""Get hydrogen bond parameters for two atoms.
|
|
|
|
cutoff = self.parameters.sidechain_cutoffs.get_value(atom1.group_type, atom2.group_type)
|
|
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
|
|
|
atom1: first atom
|
|
|
|
|
|
|
|
atom2: second atom
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
|
|
|
|
[dpka_max, cutoff]
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
dpka_max = self.parameters.sidechain_interaction.get_value(
|
|
|
|
|
|
|
|
atom1.group_type, atom2.group_type)
|
|
|
|
|
|
|
|
cutoff = self.parameters.sidechain_cutoffs.get_value(
|
|
|
|
|
|
|
|
atom1.group_type, atom2.group_type)
|
|
|
|
return [dpka_max, cutoff]
|
|
|
|
return [dpka_max, cutoff]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|