Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent ProDy updates to Cavi-Finder branch #9

Open
wants to merge 165 commits into
base: prody-cavifinder
Choose a base branch
from
Open
Changes from 10 commits
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
26b99a3
parallel insty
jamesmkrieger Aug 22, 2024
368a673
parallel inside class - somewhat working
jamesmkrieger Aug 22, 2024
bc5fcb6
better insty tests
jamesmkrieger Aug 22, 2024
f8cca17
remove insty test outputs
jamesmkrieger Aug 22, 2024
375179c
Merge branch 'main' of github.com:prody/ProDy into insty_tests
jamesmkrieger Aug 22, 2024
c34f8de
limit frames and procs
jamesmkrieger Aug 22, 2024
26a61dd
Merge branch 'main' of github.com:prody/ProDy into parallel_insty
jamesmkrieger Aug 22, 2024
cbe722f
Merge branch 'main' of github.com:prody/ProDy into insty_tests
jamesmkrieger Sep 1, 2024
9148b47
Merge branch 'main' of github.com:prody/ProDy into insty_tests
jamesmkrieger Sep 30, 2024
0c6e55e
update getDataPath to importlib
jamesmkrieger Sep 30, 2024
e0edf04
more stable test for non empty lists
jamesmkrieger Sep 30, 2024
c674ed4
keep python 2 getDataPath
jamesmkrieger Sep 30, 2024
f4ac208
add 3o21 disu test
jamesmkrieger Sep 30, 2024
66906b2
getDihedral from multi coordsets
jamesmkrieger Oct 23, 2024
d401316
extract single
jamesmkrieger Oct 23, 2024
9fa61d3
add clustenm to dynamics init docs
jamesmkrieger Oct 29, 2024
e8bef58
add anmd
jamesmkrieger Oct 29, 2024
43194f3
add anmd tests
jamesmkrieger Oct 29, 2024
7cdb202
abs import for script
jamesmkrieger Oct 29, 2024
9417e51
add file writing for script mode
jamesmkrieger Oct 29, 2024
636ff1e
fix anmd tests
jamesmkrieger Oct 29, 2024
0fffa17
run test for py3 only
jamesmkrieger Oct 29, 2024
32b1f3d
fix tests
jamesmkrieger Oct 30, 2024
fbde006
-
jamesmkrieger Oct 30, 2024
01cab67
remove unused force field and solvent
jamesmkrieger Oct 30, 2024
4459ac9
relax test atol
jamesmkrieger Oct 30, 2024
3dd2cbe
add skip modes
jamesmkrieger Oct 31, 2024
395abb4
output fixed min if skip all modes
jamesmkrieger Oct 31, 2024
91df3c2
add anm kwarg to use precalc modes
jamesmkrieger Oct 31, 2024
0054021
add missed check num_steps
jamesmkrieger Oct 31, 2024
b72cd81
wrapper4insty is added as calcSignatureInteractions()
karolamik13 Nov 9, 2024
4505312
fstrings removed
karolamik13 Nov 9, 2024
b8cdafc
replacing additional fstrings
karolamik13 Nov 9, 2024
6345be8
extractMultiModelPDB
karolamik13 Nov 9, 2024
f088e5a
fstrings replaced
karolamik13 Nov 10, 2024
92e6c88
Merge branch 'prody-signint' of github.com:karolamik13/ProDy into pro…
karolamik13 Nov 10, 2024
0b8da0f
fixer import
karolamik13 Nov 10, 2024
81f1e0c
Merge remote-tracking branch 'jamesmkrieger/pdb_ftp' into prody-signint
karolamik13 Nov 10, 2024
1260011
extractMultiModelPDB improvements
karolamik13 Nov 10, 2024
f2956d9
createFoldseekAlignment
karolamik13 Nov 10, 2024
ca71719
fix in kwargs, createFoldseekAlignment
karolamik13 Nov 10, 2024
f736b8a
LOGGER info added to SignInt functions
karolamik13 Nov 10, 2024
0112652
runFoldseek is added
karolamik13 Nov 10, 2024
f0565f2
LOGGER changes
karolamik13 Nov 11, 2024
ba342f9
cov-mode parameter to foldseek run
karolamik13 Nov 11, 2024
05b4621
runFoldseek improvements with kwargs, docs
karolamik13 Nov 11, 2024
d31d183
changes in imports
karolamik13 Nov 11, 2024
9b79bd7
kwargs for plot_barh
karolamik13 Nov 12, 2024
6e342c4
fixing typos
karolamik13 Nov 12, 2024
5450f8c
kwargs for calcSignatureInteractions, optional removal of tmp files
karolamik13 Nov 12, 2024
1ec47c5
if for 'fixed_files' removed
karolamik13 Nov 13, 2024
6d34878
3to1 letter code is not replaced by AAMAP
karolamik13 Nov 13, 2024
ee64b51
Checks for database_folder exists
karolamik13 Nov 13, 2024
8c19c0f
additional checks and docs improvements
karolamik13 Nov 13, 2024
4c4350d
update insty docs
jamesmkrieger Nov 15, 2024
cc49efd
replace PiStack RB with PS
jamesmkrieger Nov 15, 2024
07ef035
more info
jamesmkrieger Nov 15, 2024
22ff338
runDali added
karolamik13 Nov 16, 2024
3dab901
Merge branch 'prody:main' into prody-signint
karolamik13 Nov 16, 2024
8a0019d
TypeError replaced by LOGGER.warn in runDali
karolamik13 Nov 16, 2024
ec00e2d
fix angleDHA
jamesmkrieger Nov 18, 2024
2906633
add chain bar to showCumulativeInteractionTypes energy
jamesmkrieger Nov 18, 2024
1a02647
typo fix
jamesmkrieger Nov 18, 2024
f57418e
runBLAST form SignInter added
karolamik13 Nov 19, 2024
a198562
Merge pull request #1994 from jamesmkrieger/insty_showCum
jamesmkrieger Nov 19, 2024
e6faf3f
Merge pull request #1993 from jamesmkrieger/insty_docs
jamesmkrieger Nov 19, 2024
3a90616
Merge branch 'main' of github.com:prody/ProDy into anmd
jamesmkrieger Nov 19, 2024
ca6d22c
update blast writeSequences docs
jamesmkrieger Nov 19, 2024
2ef6b96
Merge pull request #1992 from jamesmkrieger/insty_pi_stack
jamesmkrieger Nov 19, 2024
67e31dc
add option to not add hydrogen
jamesmkrieger Nov 19, 2024
67021b1
expand matrix energy docs
jamesmkrieger Nov 19, 2024
dce1e37
Merge pull request #1997 from jamesmkrieger/insty_docs
jamesmkrieger Nov 20, 2024
692c82b
add energy once
jamesmkrieger Nov 20, 2024
62a753f
better indexing
jamesmkrieger Nov 20, 2024
43d427a
Merge branch 'main' of github.com:prody/ProDy into insty_docs
jamesmkrieger Nov 20, 2024
be9b1d7
fix indexing fix
jamesmkrieger Nov 20, 2024
8a9f523
Merge pull request #1996 from jamesmkrieger/fixer_no_H
jamesmkrieger Nov 20, 2024
d3730c3
Merge pull request #1998 from jamesmkrieger/insty_docs
jamesmkrieger Nov 20, 2024
6862fdc
Merge pull request #1995 from jamesmkrieger/blast_docs
jamesmkrieger Nov 21, 2024
d1bf53e
add anmd tolerance unit
jamesmkrieger Nov 21, 2024
66a9745
Merge branch 'main' of github.com:prody/ProDy into anmd
jamesmkrieger Nov 21, 2024
910e333
add more kwargs to anmd script
jamesmkrieger Nov 21, 2024
adc11bd
add abs option to showOverlap
jamesmkrieger Nov 21, 2024
4f3320a
add build and overwrite to showCumulativeInteractionTypes energy
jamesmkrieger Nov 21, 2024
375d5ff
warn wrong energy type
jamesmkrieger Nov 21, 2024
36222dd
Merge pull request #1999 from jamesmkrieger/insty_energy
jamesmkrieger Nov 22, 2024
d5cbe17
add back padding
jamesmkrieger Nov 22, 2024
18ade73
remove bad logger line
jamesmkrieger Nov 22, 2024
de64e4c
add units to docs
jamesmkrieger Nov 22, 2024
ec245df
update unit in graphs and logs
jamesmkrieger Nov 22, 2024
b811e3c
add vmin vmax docs to showMatrix
jamesmkrieger Nov 22, 2024
3724094
add selstr to cum ints
jamesmkrieger Nov 22, 2024
106e9c6
add showSelectionMatrix
jamesmkrieger Nov 22, 2024
50a37d6
calcSignatureInteractions includes now analysis with MSA file [furthe…
karolamik13 Nov 22, 2024
41be7ac
Merge pull request #1944 from jamesmkrieger/insty_tests
jamesmkrieger Nov 24, 2024
6751854
better 7 types check for writing tcl
jamesmkrieger Nov 25, 2024
bebaf7c
showCumulativeInteractionTypes pplot kwargs
jamesmkrieger Nov 25, 2024
b0ed071
rm py 3.8
jamesmkrieger Nov 25, 2024
fecc1a4
comment some pfam tests
jamesmkrieger Nov 25, 2024
b09d579
completely comment out pfam tests
jamesmkrieger Nov 25, 2024
5e55c20
no double commenting
jamesmkrieger Nov 25, 2024
af00703
Merge pull request #2004 from jamesmkrieger/less_tests
jamesmkrieger Nov 25, 2024
74eb272
Merge branch 'main' of github.com:prody/ProDy into insty_energy
jamesmkrieger Nov 25, 2024
b6632cf
Merge branch 'main' of github.com:prody/ProDy into insty_tcl
jamesmkrieger Nov 25, 2024
566d340
reoeganization of runFoldseek and calcSignatureInteractions
karolamik13 Nov 27, 2024
12841bb
docs fix [InSty]
karolamik13 Nov 28, 2024
3a1f6b1
doc selstr x and y more
jamesmkrieger Nov 28, 2024
d6f0a04
Merge pull request #1981 from jamesmkrieger/anmd
jamesmkrieger Nov 29, 2024
b957a27
docs typo fix
jamesmkrieger Nov 29, 2024
40ddb05
restore one label and markersize to showProjection
jamesmkrieger Nov 29, 2024
1323485
fix for longer label
jamesmkrieger Nov 29, 2024
6c58384
Merge pull request #2003 from jamesmkrieger/insty_tcl
jamesmkrieger Nov 30, 2024
ffedac4
Merge pull request #2006 from jamesmkrieger/anmd
jamesmkrieger Nov 30, 2024
7d4ab54
Merge pull request #2007 from jamesmkrieger/showProj
jamesmkrieger Nov 30, 2024
3e3d822
Merge pull request #2000 from jamesmkrieger/insty_energy
jamesmkrieger Dec 1, 2024
93c30ed
diversify if conditions for _parseMMCIFLines
jamesmkrieger Dec 1, 2024
c7d4a99
final rearrangement of calcSignatureInteractions with MSA file
karolamik13 Dec 1, 2024
2154509
Merge branch 'main' of github.com:prody/ProDy into getDihedral_many
jamesmkrieger Dec 1, 2024
c159a34
Changes in docs
karolamik13 Dec 1, 2024
4a3f244
Merge branch 'main' into prody-signint
karolamik13 Dec 1, 2024
f9d6716
Merge pull request #1989 from karolamik13/prody-signint
karolamik13 Dec 2, 2024
ec0eafa
add get measure funcs
jamesmkrieger Dec 3, 2024
3b533ed
num_steps default to 5
jamesmkrieger Dec 3, 2024
b742671
num_steps 2 in tests still
jamesmkrieger Dec 3, 2024
35b29bd
Merge pull request #2008 from jamesmkrieger/nonstd_cif_fixes
jamesmkrieger Dec 3, 2024
e4c0fa8
Merge pull request #2009 from jamesmkrieger/getDihedral_many
jamesmkrieger Dec 3, 2024
3d68579
merge update
jamesmkrieger Dec 3, 2024
0945824
Merge pull request #2012 from jamesmkrieger/anmd
jamesmkrieger Dec 3, 2024
53e916c
InSty (calcSignatureInteractions) changes in the plot title
karolamik13 Dec 6, 2024
913954b
add reverse to filterDaliMultimers
jamesmkrieger Dec 8, 2024
da5904d
Merge pull request #2013 from jamesmkrieger/dali_filter_reverse
jamesmkrieger Dec 10, 2024
1013f4e
fix filterInteractions single selection to include chain
jamesmkrieger Dec 10, 2024
7a3a11f
Merge branch 'prody:main' into interactions
karolamik13 Dec 12, 2024
d154132
Merge pull request #2015 from karolamik13/interactions
karolamik13 Dec 12, 2024
532dba1
complete general filterInteractions
jamesmkrieger Dec 13, 2024
eadb59c
Merge branch 'main' of github.com:prody/ProDy into filter_ints
jamesmkrieger Dec 13, 2024
3e9568b
simplify calcProteinInteractionsTrajectory
jamesmkrieger Dec 13, 2024
9d114d2
Merge branch 'main' of github.com:prody/ProDy into parallel_insty
jamesmkrieger Dec 13, 2024
7cf5d6c
replace insty 2k39_all2.npy hpb results
jamesmkrieger Dec 13, 2024
1a1db6d
replace 2k39_all.npy with new 2k39_all2.npy
jamesmkrieger Dec 13, 2024
259a5a5
Merge pull request #2014 from jamesmkrieger/filter_ints
jamesmkrieger Dec 13, 2024
e6e19e2
fix double backtick
jamesmkrieger Dec 16, 2024
fcb14c3
reorder parallel insty results
jamesmkrieger Dec 17, 2024
197fcf9
fix tests
jamesmkrieger Dec 17, 2024
be0883a
fix save load test
jamesmkrieger Dec 17, 2024
ab3d7f7
fix other tests
jamesmkrieger Dec 17, 2024
9c00da7
fix calcInteractionsMultipleFrames double appending
jamesmkrieger Dec 17, 2024
9f9b5d3
Merge branch 'main' of github.com:prody/ProDy into parallel_insty
jamesmkrieger Dec 17, 2024
5e58c20
revert stop_frame on testing types
jamesmkrieger Dec 17, 2024
87ba634
Merge pull request #2016 from jamesmkrieger/readme
jamesmkrieger Dec 17, 2024
9bfeb99
Merge pull request #1945 from jamesmkrieger/parallel_insty
jamesmkrieger Dec 17, 2024
a7f9b82
remove unneeded start_frame
jamesmkrieger Dec 18, 2024
b22f02f
fix calcInteractionsMultipleFrames missing frame
jamesmkrieger Dec 18, 2024
034084b
fix tests accordingly
jamesmkrieger Dec 18, 2024
ef6c996
use nfi properly
jamesmkrieger Dec 18, 2024
7bac08a
fix calcInteractionsMultipleFrames with traj
jamesmkrieger Dec 18, 2024
7441ca6
another fix
jamesmkrieger Dec 18, 2024
de16fd6
add dcd insty test
jamesmkrieger Dec 18, 2024
ac4023b
fix Trajectory test
jamesmkrieger Dec 18, 2024
d413ee3
handle no KRED better
jamesmkrieger Dec 19, 2024
496d989
add other dali filter arguments
jamesmkrieger Dec 19, 2024
8c49d02
anmd for pca input
jamesmkrieger Dec 27, 2024
e0df1f1
Merge pull request #2022 from jamesmkrieger/anmd
jamesmkrieger Dec 27, 2024
3019543
Merge pull request #2020 from jamesmkrieger/runDali_more_args
jamesmkrieger Dec 28, 2024
454c40c
Merge pull request #2017 from jamesmkrieger/parallel_insty
jamesmkrieger Dec 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion prody/dynamics/plotting.py
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@
'showPairDeformationDist','showMeanMechStiff',
'showPerturbResponse', 'showTree', 'showTree_networkx',
'showAtomicMatrix', 'pimshow', 'showAtomicLines', 'pplot',
'showDomainBar']
'showDomainBar', 'showSelectionMatrix']


def showEllipsoid(modes, onto=None, n_std=2, scale=1., *args, **kwargs):
@@ -2403,3 +2403,37 @@ def showTree_networkx(tree, node_size=20, node_color='red', node_shape='o',
showFigure()

return mpl.gca()

def showSelectionMatrix(matrix, atoms, selstr_x=None, selstr_y=None, **kwargs):
"""
Show a matrix similarly to showAtomicMatrix but only for
selected atoms based on *selstr_x* and *selstr_y*

:arg selstr_x: a selection string used with sliceAtomicData with axis=0
to slice the matrix in the x axis and label it with corresponding atoms
:type selstr_x: str

:arg selstr_y: a selection string used with sliceAtomicData with axis=1
to slice the matrix in the y axis and label it with corresponding atoms
:type selstr_y: str

If either of these are left as *None*, then no slicing is performed in that direction.
"""
atoms_x = atoms
atoms_y = atoms

if selstr_x is not None:
if not isinstance(selstr_x, str):
raise TypeError('selstr_x should be a str')

matrix = sliceAtomicData(matrix, atoms, selstr_x, axis=0)
_, atoms_x = sliceAtoms(atoms, selstr_x)

if selstr_y is not None:
if not isinstance(selstr_y, str):
raise TypeError('selstr_y should be a str')

matrix = sliceAtomicData(matrix, atoms, selstr_y, axis=1)
_, atoms_y = sliceAtoms(atoms, selstr_y)

return showAtomicMatrix(matrix, atoms=[atoms_x, atoms_y], **kwargs)
112 changes: 85 additions & 27 deletions prody/proteins/interactions.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
from numpy import *
from prody import LOGGER, SETTINGS, PY3K
from prody.atomic import AtomGroup, Atom, Atomic, Selection, Select
from prody.atomic import flags
from prody.atomic import flags, sliceAtomicData
from prody.utilities import importLA, checkCoords, showFigure, getCoords
from prody.measure import calcDistance, calcAngle, calcCenter
from prody.measure.contacts import findNeighbors
@@ -277,9 +277,11 @@ def checkNonstandardResidues(atoms):
def showPairEnergy(data, **kwargs):
"""Return energies when a list of interactions is given. Energies will be added to each pair of residues
at the last position in the list. Energy is based on the residue types and not on the distances.
The unit of energy is kcal/mol. The energies defined as 'IB_nosolv' (non-solvent-mediated), 'IB_solv' (solvent-mediated)
are taken from [OK98]_ and 'CS' from InSty paper (under preparation).
The unit of energy is kcal/mol. The energies defined as 'IB_nosolv' (non-solvent-mediated) and
'IB_solv' (solvent-mediated) are taken from [OK98]_ and 'CS' from InSty paper (under preparation).
Protonation of residues is not distinguished. The protonation of residues is not distinguished.
'IB_solv' and 'IB_nosolv' have RT units and 'CS' has units of kcal/mol.

Known residues such as HSD, HSE, HIE, and HID (used in MD simulations) are treated as HIS.

:arg data: list with interactions from calcHydrogenBonds() or other types
@@ -2133,9 +2135,9 @@ def calcStatisticsInteractions(data, **kwargs):
(2) average distance of interactions for each pair [in Ang],
(3) standard deviation [Ang.],
(4) Energy [in kcal/mol] that is not distance dependent. Energy by default is solvent-mediated
from [OK98]_ ('IB_solv'). To use non-solvent-mediated entries ('IB_nosolv') from [OK98]_ or
solvent-mediated values obtained for InSty paper ('CS', under preparation) change
`energy_list_type` parameter.
from [OK98]_ ('IB_solv') in RT units. To use non-solvent-mediated (residue-mediated) entries ('IB_nosolv')
from [OK98]_ in RT units or solvent-mediated values obtained from MD for InSty paper ('CS', under preparation)
in kcal/mol, change `energy_list_type` parameter.
If energy information is not available, please check whether the pair of residues is listed in
the "tabulated_energies.txt" file, which is localized in the ProDy directory.

@@ -2192,14 +2194,15 @@ def calcStatisticsInteractions(data, **kwargs):
}

statistic = []
unit = 'RT' if energy_list_type in ['IB_solv', 'IB_nosolv'] else 'kcal/mol'
for key, value in stats.items():
if float(value['weight']) > weight_cutoff:
LOGGER.info("Statistics for {0}:".format(key))
LOGGER.info(" Average [Ang.]: {}".format(value['mean']))
LOGGER.info(" Standard deviation [Ang.]: {0}".format(value['stddev']))
LOGGER.info(" Weight: {0}".format(value['weight']))
try:
LOGGER.info(" Energy [kcal/mol]: {0}".format(value['energy']))
LOGGER.info(" Energy [{0}]: {1}".format(unit, value['energy']))
statistic.append([key, value['weight'], value['mean'], value['stddev'], value['energy']])
except:
statistic.append([key, value['weight'], value['mean'], value['stddev']])
@@ -3464,15 +3467,10 @@ def buildInteractionMatrixEnergy(self, **kwargs):
:type energy_list_type: str

'IB_solv' and 'IB_nosolv' are derived from empirical potentials from
O Keskin, I Bahar and colleagues from [OK98]_.
O Keskin, I Bahar and colleagues from [OK98]_ and have RT units.

'CS' is from MD simulations of amino acid pairs from Carlos Simmerling
and Gary Wu.

.. [OK98] Keskin O, Bahar I, Badretdinov AY, Ptitsyn OB, Jernigan RL,
Empirical solvent-mediated potentials hold for both intra-molecular
and inter-molecular inter-residue interactions
*Protein Sci* **1998** 7(12):2578-2586.
and Gary Wu in the InSty paper (under preparation) and have units of kcal/mol.
"""

import numpy as np
@@ -3791,7 +3789,10 @@ def showCumulativeInteractionTypes(self, **kwargs):

:arg DiBs: score per disulfide bond
:type DiBs: int, float


:arg selstr: selection string for focusing the plot
:type selection: str

:arg energy: sum of the energy between residues
default is False
:type energy: bool
@@ -3805,16 +3806,25 @@ def showCumulativeInteractionTypes(self, **kwargs):
default is False
:type overwrite_energies: bool

:arg percentile: a percentile threshold to remove outliers, i.e. only showing data within *p*-th
to *100-p*-th percentile. Default is None, so no axis limits.
:type percentile: float

:arg vmin: a minimum value threshold to remove outliers, i.e. only showing data greater than vmin
This overrides percentile. Default is None, so no axis limits and little padding at the
bottom when energy=True.
:type vmin: float

:arg vmax: a maximum value threshold to remove outliers, i.e. only showing data less than vmax
This overrides percentile. Default is None, so no axis limits and a little padding for
interaction type labels.
:type vmax: float

'IB_solv' and 'IB_nosolv' are derived from empirical potentials from
O Keskin, I Bahar and colleagues from [OK98]_.
O Keskin, I Bahar and colleagues from [OK98]_ and have RT units.

'CS' is from MD simulations of amino acid pairs from Carlos Simmerling
and Gary Wu.

.. [OK98] Keskin O, Bahar I, Badretdinov AY, Ptitsyn OB, Jernigan RL,
Empirical solvent-mediated potentials hold for both intra-molecular
and inter-molecular inter-residue interactions
*Protein Sci* **1998** 7(12):2578-2586.
and Gary Wu for the InSty paper (under preparation) and have units kcal/mol.
"""

import numpy as np
@@ -3833,6 +3843,19 @@ def showCumulativeInteractionTypes(self, **kwargs):
if not isinstance(energy, bool):
raise TypeError('energy should be True or False')

p = kwargs.pop('percentile', None)
vmin = vmax = None
if p is not None:
vmin = np.percentile(matrix, p)
vmax = np.percentile(matrix, 100-p)

vmin = kwargs.pop('vmin', vmin)
vmax = kwargs.pop('vmax', vmax)

selstr = kwargs.pop('selstr', None)
if selstr is not None:
atoms = atoms.select(selstr)

ResNumb = atoms.select('protein and name CA').getResnums()
ResName = atoms.select('protein and name CA').getResnames()
ResChid = atoms.select('protein and name CA').getChids()
@@ -3856,16 +3879,27 @@ def showCumulativeInteractionTypes(self, **kwargs):
fig, ax = plt.subplots(num=None, figsize=(20,6), facecolor='w')
matplotlib.rcParams['font.size'] = '24'

if selstr is not None:
matrix_en_sum = sliceAtomicData(matrix_en_sum,
self._atoms.ca, selstr)

zeros_row = np.zeros(matrix_en_sum.shape)
pplot(zeros_row, atoms=atoms.ca)
pplot(zeros_row, atoms=atoms.ca, **kwargs)

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

#plt.xlim([ResList[0]-0.5, ResList[-1]+0.5])
plt.ylim([min(matrix_en_sum)-1,0])
if vmin is None:
vmin = np.min(matrix_en_sum) * 1.2

if vmax is None:
vmax = np.max(matrix_en_sum)

plt.ylim([vmin, vmax])
plt.tight_layout()
plt.xlabel('Residue')
plt.ylabel('Cumulative Energy [kcal/mol]')

unit = 'RT' if energy_list_type in ['IB_solv', 'IB_nosolv'] else 'kcal/mol'
plt.ylabel('Cumulative Energy [{0}]'.format(unit))
plt.show()

return matrix_en_sum
@@ -3898,6 +3932,23 @@ def showCumulativeInteractionTypes(self, **kwargs):
matrix_hph_sum = np.sum(matrix_hph, axis=0)
matrix_dibs_sum = np.sum(matrix_dibs, axis=0)

all_ca = self._atoms.ca
if selstr is not None:
matrix_hbs_sum = sliceAtomicData(matrix_hbs_sum,
all_ca, selstr)
matrix_sbs_sum = sliceAtomicData(matrix_sbs_sum,
all_ca, selstr)
matrix_rib_sum = sliceAtomicData(matrix_rib_sum,
all_ca, selstr)
matrix_pistack_sum = sliceAtomicData(matrix_pistack_sum,
all_ca, selstr)
matrix_picat_sum = sliceAtomicData(matrix_picat_sum,
all_ca, selstr)
matrix_hph_sum = sliceAtomicData(matrix_hph_sum,
all_ca, selstr)
matrix_dibs_sum = sliceAtomicData(matrix_dibs_sum,
all_ca, selstr)

width = 0.8
fig, ax = plt.subplots(num=None, figsize=(20,6), facecolor='w')
matplotlib.rcParams['font.size'] = '24'
@@ -3940,7 +3991,14 @@ def showCumulativeInteractionTypes(self, **kwargs):
self._interactions_matrix = matrix_all

ax.legend(ncol=7, loc='upper center')
plt.ylim([0,max(sum_matrix)+3])

if vmin is None:
vmin = np.min(sum_matrix)

if vmax is None:
vmax = np.max(sum_matrix) * 1.5

plt.ylim([vmin, vmax])
plt.tight_layout()
plt.xlabel('Residue')
plt.ylabel('Number of counts')
8 changes: 8 additions & 0 deletions prody/utilities/catchall.py
Original file line number Diff line number Diff line change
@@ -610,6 +610,14 @@ def showMatrix(matrix, x_array=None, y_array=None, **kwargs):
to *100-p*-th percentile
:type percentile: float

:arg vmin: a minimum value threshold to remove outliers, i.e. only showing data greater than vmin
This overrides percentile.
:type vmin: float

:arg vmax: a maximum value threshold to remove outliers, i.e. only showing data less than vmax
This overrides percentile.
:type vmax: float

:arg interactive: turn on or off the interactive options
:type interactive: bool