Skip to content

Commit

Permalink
Merge pull request #1940 from prod-feng/master
Browse files Browse the repository at this point in the history
From Feng
  • Loading branch information
jamesmkrieger authored Aug 22, 2024
2 parents 9776bb5 + 47e14eb commit 9513595
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 39 deletions.
25 changes: 18 additions & 7 deletions docs/about/people.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,22 @@ Development Team
`James Krieger`_ was helping develop *ProDy* from 2017 and became the main
overseer and developer in mid 2020.

`Hongchun Li`_ is currently maintaining and developing ANM and GNM servers,
`Hongchun Li`_ has helped maintain and develop ANM and GNM servers,
and made significant contributions to :mod:`.database` and :mod:`.dynamics`
including *SignDy* and Adaptive ANM.

`JiYoung Lee`_ is the main developer of :mod:`.Pharmmaker`, for constructing pharmacophore models using the outputs from :mod:`.DruGUI`.

`Yan Zhang`_ contributed significantly to the development of
the *cryo-EM* module, :mod:`.protein.emdmap`.

`Burak Kaynak`_ contributed significantly to the development of
:mod:`.domain_decomposition`, :mod:`.dynamics.essa`, and
:mod:`.dynamics.clustenm`.

`Karolina Mikulska-Ruminska`_ contributed significantly to the development of
`Karolina Mikulska-Ruminska`_ is one of the main developers since 2022, with the addition of the new modules
:mod:`.protein.interactions` (*InSty*), :mod:`.protein.waterbridges`
(*WatFinder*), and :mod:`.dynamics.mechstiff` (*MechStiff*).
(*WatFinder*), in addition to being the developer of :mod:`.dynamics.mechstiff` (*MechStiff*).

`Anthony Bogetti`_ is overseeing the overall development of *ProDy* since
2024.
Expand All @@ -50,6 +52,12 @@ Blocks and Membrane ENM.
`Lidio Meireles`_ provided insightful comments on the design of *ProDy*,
and contributed to the development of :ref:`prody-apps`.

`Mustafa Tekpinar`_ contributed to the development of MechStiff.

`Luca Ponzoni`_ contributed to the development of SignDy.

`David Koes`_ contributed to the development of drug discovery tools.

Contributors
------------

Expand All @@ -67,17 +75,16 @@ contributions and feedback from the following individuals:
insights.



.. _Ahmet Bakan: https://scholar.google.com/citations?user=-QAYVgMAAAAJ&hl=en
.. _Cihan Kaya: https://www.linkedin.com/in/cihan-kaya/
.. _Bahar Lab: http://www.bahargroup.org/Faculty/bahar/
.. _University of Pittsburgh: http://www.pitt.edu/
.. _Anindita Dutta: http://www.linkedin.com/pub/anindita-dutta/5a/568/a90
.. _Wenzhi Mao: http://www.linkedin.com/pub/wenzhi-mao/2a/29a/29
.. _Lidio Meireles: http://www.linkedin.com/in/lidio
.. _Ying Liu: http://www.linkedin.com/pub/ying-liu/15/48b/5a9
.. _Ying Liu: https://www.linkedin.com/in/yingliu03/
.. _Kian Ho: https://github.com/kianho
.. _Gökçen Eraslan: http://blog.yeredusuncedernegi.com/
.. _Gökçen Eraslan: https://github.com/gokceneraslan
.. _Tim Lezon: https://scholar.google.pl/citations?user=1MwNI3EAAAAJ&hl=pl&oi=ao
.. _Chakra Chennubhotla: http://www.csb.pitt.edu/Faculty/Chakra/
.. _She (John) Zhang: https://www.linkedin.com/in/she-zhang-49164399/
Expand All @@ -87,4 +94,8 @@ insights.
.. _Burak Kaynak: https://scholar.google.pl/citations?user=gP8RokwAAAAJ&hl=pl&oi=ao
.. _Karolina Mikulska-Ruminska: https://scholar.google.pl/citations?user=IpyPHRwAAAAJ&hl=pl
.. _Anthony Bogetti: https://scholar.google.pl/citations?hl=pl&user=9qQClIcAAAAJ
.. _Frane Doljanin: https://github.com/fdoljanin
.. _Frane Doljanin: https://github.com/fdoljanin
.. _JiYoung Lee: https://scholar.google.com/citations?user=odKQmZcAAAAJ&hl=en
.. _David Koes: https://bits.csb.pitt.edu/
.. _Luca Ponzoni: https://scholar.google.it/citations?user=8vfPOYUAAAAJ&hl=en
.. _Mustafa Tekpinar: https://scholar.google.com/citations?user=qeVv6o8AAAAJ&hl=en
4 changes: 2 additions & 2 deletions docs/devel/website.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This is a short guide for building the ProDy website.
Environment Setup
--------------

First log in to the ProDy webserver (prody.csb.pitt.edu) then run the following::
First log in to your ProDy webserver and then run the following::

$ conda deactivate

Expand All @@ -34,7 +34,7 @@ ProDy-website-workdir. You can then copy files back over afterwards.

It's recommended to have the symbolic link called test_prody pointing to
your build directory instead and then you can monitor changes by going to
http://prody.csb.pitt.edu/test_prody/_build/html/ in your web browser.
http://yourdomainname/test_prody/_build/html/ in your web browser.


Updating from GitHub
Expand Down
2 changes: 1 addition & 1 deletion docs/docs
2 changes: 1 addition & 1 deletion docs/reference/proteins/waterbridges.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Water bridge finder (WatFinder)

.. automodule:: prody.proteins.waterbridges
:members:
:undoc-members:
:undoc-members:
3 changes: 2 additions & 1 deletion docs/release/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Release Notes
.. toctree::
:maxdepth: 2
:glob:


v2.5_series
v2.4_series
v2.3_series
v2.2_series
Expand Down
4 changes: 2 additions & 2 deletions prody/chromatin/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def showEmbedding(modes, labels=None, trace=True, headtail=True, cmap='prism'):
X, Y, Z = V[:,:3].T

f = figure()
ax = f.add_subplot(projection="3d")
ax = f.add_subplot(1,1,1,projection="3d")
if trace:
ax.plot(X, Y, Z, ':', color=[0.3, 0.3, 0.3])
if labels is None:
Expand Down Expand Up @@ -240,4 +240,4 @@ def getDomainList(labels):
ends = sites[1:]
domains = np.array([starts, ends]).T

return domains
return domains
4 changes: 2 additions & 2 deletions prody/dynamics/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def showEllipsoid(modes, onto=None, n_std=2, scale=1., *args, **kwargs):
show = child
break
if show is None:
show = cf.add_subplot(projection="3d")
show = cf.add_subplot(111,projection="3d")
show.plot_wireframe(x, y, z, rstride=6, cstride=6, *args, **kwargs)
if onto is not None:
onto = list(onto)
Expand Down Expand Up @@ -421,7 +421,7 @@ def showProjection(ensemble=None, modes=None, projection=None, *args, **kwargs):
show = child
break
if show is None:
show = cf.add_subplot(projection="3d")
show = cf.add_subplot(111,projection="3d")
plot = show.plot
text = show.text

Expand Down
3 changes: 2 additions & 1 deletion prody/dynamics/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ def sampleModes(modes, atoms=None, n_confs=1000, rmsd=1.0):
RMSD of the new conformation from :math:`R_0` can be calculated as
.. math::
RMSD^k = \\sqrt{ {\\left( s \\sum_{i=1}^{m} r_i^k \\lambda^{-0.5}_i u_i \\right)}^{2} / N } = \\frac{s}{ \\sqrt{N}} \\sqrt{ \\sum_{i=1}^{m} (r_i^k)^2 \\lambda^{-1}_i }
RMSD^k = \\sqrt{ \\left[ s \\sum_{i=1}^{m} r_i^k \\lambda^{-0.5}_i u_i \\right] ^{2} / N } = \\frac{s}{ \\sqrt{N}} \\sqrt{ \\sum_{i=1}^{m} (r_i^k)^2 \\lambda^{-1}_i }
Average :math:`RMSD` of the generated conformations from the initial conformation is:
Expand Down
2 changes: 1 addition & 1 deletion prody/proteins/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def showProtein(*atoms, **kwargs):
show = child
break
if show is None:
show = cf.add_subplot(projection="3d")
show = cf.add_subplot(1,1,1,projection="3d")
from matplotlib import colors
cnames = dict(colors.cnames)
wcolor = kwargs.get('water', 'red').lower()
Expand Down
64 changes: 43 additions & 21 deletions prody/proteins/waterbridges.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@

from itertools import combinations
from collections import deque
from enum import Enum, auto

from prody import PY3K
if PY3K:
from enum import Enum, auto
else:
from enum import Enum
import enum
from itertools import count
def auto(it=count()):
return next(it)
enum.auto=auto

from copy import copy

from prody import LOGGER, SETTINGS
Expand Down Expand Up @@ -263,8 +274,10 @@ def getInfoOutput(waterBridgesAtomic):
bridgeOutput = []

for atom in bridge.proteins:
residueInfo = f"{atom.getResname()}{atom.getResnum()}"
atomInfo = f"{atom.getName()}_{atom.getIndex()}"
residueInfo = "{0}{1}".format(atom.getResname(),
atom.getResnum())
atomInfo = "{0}_{1}".format(atom.getName(),
atom.getIndex())
chainInfo = atom.getChid()
bridgeOutput += [residueInfo, atomInfo, chainInfo]

Expand All @@ -273,7 +286,9 @@ def getInfoOutput(waterBridgesAtomic):

bridgeOutput += [len(bridge.waters)]
bridgeOutput += [
list(map(lambda w: f"{w.getChid()}_{w.getIndex()}", bridge.waters))]
list(map(lambda w: "{0}_{1}".format(w.getChid(),
w.getIndex()),
bridge.waters))]

output.append(bridgeOutput)

Expand Down Expand Up @@ -314,7 +329,7 @@ def getAtomicOutput(waterBridges, relations):


def getElementsRegex(elements):
return f'[{"|".join(elements)}].*'
return '[{0}].*'.format("|".join(elements))


def calcWaterBridges(atoms, **kwargs):
Expand Down Expand Up @@ -417,7 +432,7 @@ def calcWaterBridges(atoms, **kwargs):

relations = RelationList(len(atoms))
tooFarAtoms = atoms.select(
f'water and not within {distWR} of protein')
'water and not within {0} of protein'.format(distWR))
if tooFarAtoms is None:
consideredAtoms = atoms
else:
Expand All @@ -434,9 +449,10 @@ def calcWaterBridges(atoms, **kwargs):
relations[oxygen].hydrogens.append(hydrogen)

proteinHydrophilic = consideredAtoms.select(
f'protein and name "{getElementsRegex(set(donors+acceptors))}" and within {distWR} of water')
'protein and name "{0}" and within {1} of water'.format(
getElementsRegex(set(donors+acceptors)), distWR))

proteinHydrogens = consideredAtoms.select(f'protein and hydrogen') or []
proteinHydrogens = consideredAtoms.select('protein and hydrogen') or []
proteinHydroPairs = findNeighbors(
proteinHydrophilic, DIST_COVALENT_H, proteinHydrogens) if proteinHydrogens else []
for hydrophilic in proteinHydrophilic:
Expand Down Expand Up @@ -474,7 +490,8 @@ def calcWaterBridges(atoms, **kwargs):
waterBridgesWithIndices = getUniqueElements(
waterBridgesWithIndices, getChainBridgeTuple)

log_string = f'{len(waterBridgesWithIndices)} water bridges detected using method {method}'
log_string = '{0} water bridges detected using method {1}'.format(
len(waterBridgesWithIndices), method)
if prefix != '':
log_string += ' for ' + prefix
LOGGER.info(log_string)
Expand Down Expand Up @@ -715,7 +732,7 @@ def getResInfo(atoms):
chids = atoms.select('protein').getChids()

for i, num in enumerate(nums):
dict[num] = f"{names[i]}{num}{chids[i]}"
dict[num] = "{names[i]}{num}{chids[i]}"

return dict

Expand Down Expand Up @@ -796,7 +813,8 @@ def calcWaterBridgesStatistics(frames, trajectory, **kwargs):
interactionCount.removeDuplicateKeys(
lambda keys, key: (key[1], key[0]) in keys)

tableHeader = f'{"RES1":<15}{"RES2":<15}{"PERC":<10}{"DIST_AVG":<10}{"DIST_STD":<10}'
tableHeader = '{0:<15}{1:<15}{2:<10}{3:<10}{4:<10}'.format(
"RES1", "RES2", "PERC", "DIST_AVG", "DIST_STD")
LOGGER.info(tableHeader)
info = {}
file = open(filename, 'w') if filename else None
Expand All @@ -819,7 +837,8 @@ def calcWaterBridgesStatistics(frames, trajectory, **kwargs):
key1, key2 = (x, y), (y, x)
info[key1], info[key2] = pairInfo, pairInfo

tableRow = f'{resNames[x]:<15}{resNames[y]:<15}{percentage:<10.3f}{distAvg:<10.3f}{distStd:<10.3f}'
tableRow = '{0:<15}{1:<15}{2:<10.3f}{3:<10.3f}{4:<10.3f}'.format(
resNames[x], resNames[y], percentage, distAvg, distStd)
LOGGER.info(tableRow)
if file:
file.write(tableRow + '\n')
Expand Down Expand Up @@ -885,7 +904,7 @@ def mofifyBeta(bridgeFrames, atoms):
atoms.setBetas(0)
for resnum, value in residueOccurances.items():
residueAtoms = atoms.select(
f'resnum {resnum}')
'resnum {0}'.format(resnum))
beta = value/len(bridgeFrames)

residueAtoms.setBetas(beta)
Expand Down Expand Up @@ -1075,7 +1094,7 @@ def calcWaterBridgesDistribution(frames, res_a, res_b=None, **kwargs):
plt.hist(result, rwidth=0.95, density=True)
plt.xlabel('Value')
plt.ylabel('Probability')
plt.title(f'Distribution: {metric}')
plt.title('Distribution: {0}'.format(metric))
if SETTINGS['auto_show']:
showFigure()

Expand Down Expand Up @@ -1108,7 +1127,8 @@ def savePDBWaterBridges(bridges, atoms, filename):
waterOxygens = reduceTo1D(
bridges, lambda w: w.getIndex(), lambda b: b.waters)
waterAtoms = atoms.select(
f'same residue as water within 1.6 of index {" ".join(map(str, waterOxygens))}')
'same residue as water within 1.6 of index {0}'.format(
" ".join(map(str, waterOxygens))))

atomsToSave = proteinAtoms.toAtomGroup() + waterAtoms.toAtomGroup()
return writePDB(filename, atomsToSave)
Expand Down Expand Up @@ -1147,21 +1167,23 @@ def saveBridgesFrame(trajectory, atoms, frameIndex, frame):

waterAtoms = reduceTo1D(frame, sublistSel=lambda b: b.waters)
waterResidues = atoms.select(
f'same residue as water within 1.6 of index {" ".join(map(lambda a: str(a.getIndex()), waterAtoms))}')
'same residue as water within 1.6 of index {0}'.format(
" ".join(map(lambda a: str(a.getIndex()), waterAtoms))))

bridgeProteinAtoms = reduceTo1D(
frame, lambda p: p.getResnum(), lambda b: b.proteins)
atoms.setOccupancies(0)
atoms.select(
f'resid {" ".join(map(str, bridgeProteinAtoms))}').setOccupancies(1)
atoms.select('resid {0}'.format(
" ".join(map(str, bridgeProteinAtoms)))).setOccupancies(1)

atomsToSave = atoms.select(
'protein').toAtomGroup() + waterResidues.toAtomGroup()

if trajectory:
writePDB(f'{filename}_{frameIndex}.pdb', atomsToSave)
writePDB('{0}_{1}.pdb'.format(filename, frameIndex),
atomsToSave)
else:
writePDB(f'{filename}_{frameIndex}.pdb',
writePDB('{0}_{1}.pdb'.format(filename, frameIndex),
atomsToSave, csets=frameIndex)

if max_proc == 1:
Expand Down Expand Up @@ -1210,7 +1232,7 @@ def saveWaterBridges(atomicBridges, filename):
if isInfoOutput:
info = getWaterBridgesInfoOutput(atomicBridges)
for frameIndex, frame in enumerate(info):
file.write(f'FRAME {frameIndex}\n')
file.write('FRAME {0}\n'.format(frameIndex))
for bridge in frame:
file.write(' '.join(map(str, bridge)) + '\n')

Expand Down

0 comments on commit 9513595

Please sign in to comment.