Skip to content

Commit

Permalink
Merge branch 'main' of github.com:prody/ProDy into insty_disu
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmkrieger committed Nov 19, 2024
2 parents c9c13b5 + e6faf3f commit 93ab328
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions prody/proteins/interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ def calcHydrogenBonds(atoms, **kwargs):
:arg angleDHA: non-zero value, maximal (180 - D-H-A angle) (donor, hydrogen, acceptor).
default is 40.
angle also works
angle and angleDA also work
:type angleDHA: int, float
:arg seq_cutoff_HB: non-zero value, interactions will be found between atoms with index differences
Expand Down Expand Up @@ -576,6 +576,7 @@ def calcHydrogenBonds(atoms, **kwargs):
distA = kwargs.pop('distA', distDA)

angleDHA = kwargs.pop('angleDA', 40)
angleDHA = kwargs.pop('angleDHA', angleDHA)
angle = kwargs.pop('angle', angleDHA)

seq_cutoff_HB = kwargs.pop('seq_cutoff_HB', 25)
Expand Down Expand Up @@ -1336,7 +1337,7 @@ def calcDisulfideBonds(atoms, **kwargs):
:arg atoms: an Atomic object from which residues are selected
:type atoms: :class:`.Atomic`
:arg distDB: non-zero value, maximal distance between atoms of hydrophobic residues.
:arg distDB: non-zero value, maximal distance between atoms of cysteine residues.
default is 3.
distA works too
:type distDB: int, float
Expand Down Expand Up @@ -1455,7 +1456,7 @@ def calcMetalInteractions(atoms, distA=3.0, extraIons=['FE'], excluded_ions=['SO

def calcInteractionsMultipleFrames(atoms, interaction_type, trajectory, **kwargs):
"""Compute selected type interactions for DCD trajectory or multi-model PDB
using default parameters."""
using default parameters or those from kwargs."""

try:
coords = getCoords(atoms)
Expand Down Expand Up @@ -1517,14 +1518,18 @@ def calcInteractionsMultipleFrames(atoms, interaction_type, trajectory, **kwargs


def calcProteinInteractions(atoms, **kwargs):
"""Compute all protein interactions (shown below) using default parameters.
"""Compute all protein interactions (shown below).
(1) Hydrogen bonds
(2) Salt Bridges
(3) RepulsiveIonicBonding
(4) Pi stacking interactions
(5) Pi-cation interactions
(6) Hydrophobic interactions
(7) Disulfide Bonds
kwargs can be passed on to the underlying functions as described
in their documentation. For example, distDA and angleDHA can be used
to control hydrogen bonds, or distA and angle can be used across types.
:arg atoms: an Atomic object from which residues are selected
:type atoms: :class:`.Atomic`
Expand Down Expand Up @@ -1576,10 +1581,12 @@ def calcHydrogenBondsTrajectory(atoms, trajectory=None, **kwargs):
:arg distA: non-zero value, maximal distance between donor and acceptor.
default is 3.5
distDA also works
:type distA: int, float
:arg angle: non-zero value, maximal (180 - D-H-A angle) (donor, hydrogen, acceptor).
default is 40.
angleDHA also works
:type angle: int, float
:arg seq_cutoff: non-zero value, interactions will be found between atoms with index differences
Expand Down Expand Up @@ -1620,6 +1627,7 @@ def calcSaltBridgesTrajectory(atoms, trajectory=None, **kwargs):
:arg distA: non-zero value, maximal distance between center of masses
of N and O atoms of negatively and positevely charged residues.
default is 5.
distSB also works
:type distA: int, float
:arg selection: selection string
Expand Down Expand Up @@ -1656,6 +1664,7 @@ def calcRepulsiveIonicBondingTrajectory(atoms, trajectory=None, **kwargs):
:arg distA: non-zero value, maximal distance between center of masses
between N-N or O-O atoms of residues.
default is 4.5.
distRB also works
:type distA: int, float
:arg selection: selection string
Expand Down Expand Up @@ -1692,6 +1701,7 @@ def calcPiStackingTrajectory(atoms, trajectory=None, **kwargs):
:arg distA: non-zero value, maximal distance between center of masses
of residues aromatic rings.
default is 5.
distPS also works
:type distA: int, float
:arg angle_min: minimal angle between aromatic rings.
Expand Down Expand Up @@ -1736,6 +1746,7 @@ def calcPiCationTrajectory(atoms, trajectory=None, **kwargs):
:arg distA: non-zero value, maximal distance between center of masses of aromatic ring
and positively charge group.
default is 5.
distPC also works
:type distA: int, float
:arg selection: selection string
Expand Down Expand Up @@ -1771,6 +1782,7 @@ def calcHydrophobicTrajectory(atoms, trajectory=None, **kwargs):
:arg distA: non-zero value, maximal distance between atoms of hydrophobic residues.
default is 4.5.
distHPh also works
:type distA: int, float
:arg selection: selection string
Expand Down Expand Up @@ -1803,8 +1815,9 @@ def calcDisulfideBondsTrajectory(atoms, trajectory=None, **kwargs):
:arg trajectory: trajectory file
:type trajectory: class:`.Trajectory`
:arg distA: non-zero value, maximal distance between atoms of hydrophobic residues.
:arg distA: non-zero value, maximal distance between atoms of cysteine residues.
default is 2.5.
distDB also works
:type distA: int, float
:arg start_frame: index of first frame to read
Expand Down Expand Up @@ -3676,7 +3689,7 @@ def showFrequentInteractors(self, cutoff=4, **kwargs):
"""Plots regions with the most frequent interactions.
:arg cutoff: minimal score per residue which will be displayed.
If cutoff value is to big, top 30% with the higest values will be returned.
If cutoff value is too big, top 30% with the higest values will be returned.
Default is 4.
:type cutoff: int, float
Expand Down Expand Up @@ -3798,9 +3811,13 @@ def showCumulativeInteractionTypes(self, **kwargs):
fig, ax = plt.subplots(num=None, figsize=(20,6), facecolor='w')
matplotlib.rcParams['font.size'] = '24'

ax.bar(ResNumb, matrix_en_sum, width, color='blue')
zeros_row = np.zeros(matrix_en_sum.shape)
pplot(zeros_row, atoms=atoms.ca)

ax.bar(ResList, matrix_en_sum, width, color='blue')

plt.xlim([ResNumb[0]-0.5, ResNumb[-1]+0.5])
#plt.xlim([ResList[0]-0.5, ResList[-1]+0.5])
plt.ylim([min(matrix_en_sum)-1,0])
plt.tight_layout()
plt.xlabel('Residue')
plt.ylabel('Cumulative Energy [kcal/mol]')
Expand Down

0 comments on commit 93ab328

Please sign in to comment.