Skip to content

Commit

Permalink
Merge branch 'main' of github.com:prody/ProDy into hpb
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmkrieger committed Aug 14, 2024
2 parents 2ccd6a2 + 34fa7be commit 568430e
Show file tree
Hide file tree
Showing 14 changed files with 474 additions and 74 deletions.
27 changes: 20 additions & 7 deletions docs/about/people.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@ including *SignDy* and Adaptive ANM.
the *cryo-EM* module, :mod:`.protein.emdmap`.

`Burak Kaynak`_ contributed significantly to the development of
:mod:`.domain_decomposition` and :mod:`.dynamics.essa`,
and is in the process of adding other modules too.
:mod:`.domain_decomposition`, :mod:`.dynamics.essa`, and
:mod:`.dynamics.clustenm`.

`Karolina Mikulska-Ruminska`_ contributed significantly to the development of
:mod:`.protein.interactions` (*InSty*), :mod:`.protein.waterbridges`
(*WatFinder*), and :mod:`.dynamics.mechstiff` (*MechStiff*).

`Anthony Bogetti`_ is overseeing the overall development of *ProDy* since
2024.

`Anindita Dutta`_ contributed to the development of *Evol*,
:mod:`.database` and :mod:`.sequence` modules.
Expand All @@ -52,26 +59,32 @@ contributions and feedback from the following individuals:

`Ying Liu`_ provided the code for Perturbation Response Scanning method.

`Frane Doljanin`_ provided the code for the water bridge detection.

`Kian Ho`_ contributed with bug fixes and unit tests for DSSP functions.

`Gökçen Eraslan`_ contributed with bug fixes and development and maintenance
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.ccbb.pitt.edu/faculty/bahar/
.. _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
.. _Kian Ho: https://github.com/kianho
.. _Gökçen Eraslan: http://blog.yeredusuncedernegi.com/
.. _Tim Lezon: http://www.csb.pitt.edu/Faculty/Lezon/
.. _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/
.. _Hongchun Li: http://www.pitt.edu/~hongchun/
.. _James Krieger: http://www.csb.pitt.edu/Faculty/bahar/lab.html
.. _Yan Zhang: https://www.csb.pitt.edu/Faculty/bahar/lab.html
.. _Burak Kaynak: https://www.csb.pitt.edu/Faculty/bahar/lab.html
.. _James Krieger: https://scholar.google.pl/citations?user=DoiCjkUAAAAJ&hl=pl
.. _Yan Zhang: https://scholar.google.pl/citations?user=VxwU0pgAAAAJ&hl=pl&oi=sra
.. _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
4 changes: 4 additions & 0 deletions docs/release/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Release Notes
:maxdepth: 2
:glob:

v2.4_series
v2.3_series
v2.2_series
v2.1_series
v2.0_series
v1.11_series
v1.10_series
Expand Down
5 changes: 3 additions & 2 deletions prody/apps/prody_apps/prody_catdcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ def prody_catdcd(*dcd, **kwargs):
out = prody.DCDFile(output, 'w')
count = 0
stride = kwargs.get('stride', 1)
goto = stride != 1
slc = slice(kwargs.get('first', 0), kwargs.get('last', -1),
first = kwargs.get('first', 0)
goto = stride != 1 or first != 0
slc = slice(first, kwargs.get('last', -1),
stride).indices(len(traj)+1)
for i in range(*slc):
if goto:
Expand Down
6 changes: 3 additions & 3 deletions prody/database/dali.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,16 @@ def __init__(self, url, pdbId, chain, subset='fullPDB', localFile=False, **kwarg
"""

self._url = url
self._pdbId = pdbId
self._chain = chain
self._pdbId = pdbId.lower()
self._chain = chain.upper()
subset = subset.upper()
if subset == "FULLPDB" or subset not in ["PDB25", "PDB50", "PDB90"]:
self._subset = ""
else:
self._subset = "-"+subset[3:]
timeout = kwargs.pop('timeout', 120)

self._title = pdbId + '-' + chain
self._title = self._pdbId + '-' + self._chain
self._alignPDB = None
self._filterDict = None
self._max_index = None
Expand Down
2 changes: 2 additions & 0 deletions prody/dynamics/clustenm.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ def __init__(self, title=None):
self._targeted = False
self._tmdk = 10.

self._cc = None

super(ClustENM, self).__init__('Unknown') # dummy title; will be replaced in the next line
self._title = title

Expand Down
6 changes: 3 additions & 3 deletions prody/dynamics/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1997,7 +1997,7 @@ def func_ticklabels(val, pos):
last += len(resnums)
else:
x.extend(resnums + last)
last = resnums[-1]
last += resnums[-1]

if gap:
if overlay:
Expand Down Expand Up @@ -2355,15 +2355,15 @@ def showTree_networkx(tree, node_size=20, node_color='red', node_shape='o',
networkx.draw_networkx_edges(G, pos=layout)

if np.isscalar(node_shape):
networkx.draw_networkx_nodes(G, pos=layout, withlabels=False, node_size=sizes,
networkx.draw_networkx_nodes(G, pos=layout, label=None, node_size=sizes,
node_shape=node_shape, node_color=colors)
else:
for shape in shape_groups:
nodelist = [nodes[i] for i in shape_groups[shape]]
nodesizes = [sizes[i] for i in shape_groups[shape]]
nodecolors = [colors[i] for i in shape_groups[shape]]
if not nodelist: continue
networkx.draw_networkx_nodes(G, pos=layout, withlabels=False, node_size=nodesizes,
networkx.draw_networkx_nodes(G, pos=layout, label=None, node_size=nodesizes,
node_shape=shape, node_color=nodecolors,
nodelist=nodelist)

Expand Down
23 changes: 17 additions & 6 deletions prody/ensemble/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@
from prody.proteins import alignChains
from prody.utilities import openFile, showFigure, copy, isListLike, pystr, DTYPE
from prody import LOGGER, SETTINGS
from prody.atomic import Atomic, AtomMap, Chain, AtomGroup, Selection, Segment, Select, AtomSubset
from prody.atomic import Atomic, AtomGroup
from prody.sequence import buildSeqidMatrix

from .ensemble import *
from .pdbensemble import *
from .conformation import *
have_openmm = True
try:
import openmm
except ImportError:
have_openmm = False

from .ensemble import Ensemble
from .pdbensemble import PDBEnsemble
from .conformation import PDBConformation

__all__ = ['saveEnsemble', 'loadEnsemble', 'trimPDBEnsemble',
'calcOccupancies', 'showOccupancies',
Expand Down Expand Up @@ -46,7 +52,9 @@ def saveEnsemble(ensemble, filename=None, **kwargs):
'_padding', '_ionicStrength', '_force_field', '_tolerance',
'_maxIterations', '_sim', '_temp', '_t_steps', '_outlier',
'_mzscore', '_v1', '_parallel', '_idx_cg', '_n_cg', '_cycle',
'_time', '_targeted', '_tmdk', '_topology', '_positions', '_cc'])
'_time', '_targeted', '_tmdk', '_cc'])
if have_openmm:
attr_list.extend(['_topology', '_positions'])

if filename is None:
filename = ensemble.getTitle().replace(' ', '_')
Expand Down Expand Up @@ -158,7 +166,10 @@ def loadEnsemble(filename, **kwargs):
'_rmsd', '_n_gens', '_maxclust', '_threshold', '_sol',
'_sim', '_temp', '_t_steps', '_outlier', '_mzscore', '_v1',
'_parallel', '_idx_ca', '_n_ca', '_cycle', '_time', '_targeted',
'_tmdk', '_topology', '_positions', '_cc']
'_tmdk', '_cc']
if have_openmm:
attrs.extend(['_topology', '_position'])


for attr in attrs:
if attr in attr_dict.files:
Expand Down
2 changes: 1 addition & 1 deletion prody/measure/measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ def buildADPMatrix(atoms):
element[0, 1] = element[1, 0] = anisou[3]
element[0, 2] = element[2, 0] = anisou[4]
element[1, 2] = element[2, 1] = anisou[5]
adp[i*3:i*3, i*3:i*3] = element
adp[i*3:i*3+3, i*3:i*3+3] = element
return adp


Expand Down
2 changes: 1 addition & 1 deletion prody/proteins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
except SyntaxError:
import logging
logger = logging.getLogger()
logger.warn("Cannot import waterbridges in python 2")
logger.warn("Cannot import waterbridges")
else:
__all__.extend(waterbridges.__all__)

Expand Down
104 changes: 92 additions & 12 deletions prody/proteins/fixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@
__email__ = ['[email protected]', '[email protected]']

from prody import LOGGER
from numbers import Integral, Number

__all__ = ['addMissingAtoms']
__all__ = ['addMissingAtoms', 'fixStructuresMissingAtoms']

def addMissingAtoms(infile, method='openbabel', pH=7.0, outfile=None, **kwargs):
"""Function will add hydrogens to the protein and ligand structure using Openbabel [NO11]_
or PDBFixer with OpenMM.
"""This function will add hydrogens to the protein and ligand structure using Openbabel [NO11]_
or PDBFixer with OpenMM.
There are also options whether to *model_residues* (default False), *remove_heterogens*
(default False), *keep_waters* (default True), *overwrite* (default False).
:arg infile: PDB file name
:type infile: str
Expand Down Expand Up @@ -53,11 +57,39 @@ def addMissingAtoms(infile, method='openbabel', pH=7.0, outfile=None, **kwargs):
model_residues = kwargs.get("model_residues", False)
remove_heterogens = kwargs.get("remove_heterogens", False)
keep_water = kwargs.get("keep_water", True)
overwrite = kwargs.get("overwrite", False)

import os

if not isinstance(model_residues, bool):
raise TypeError('model_residues should be True or False')

if not isinstance(remove_heterogens, bool):
raise TypeError('remove_heterogens should be True or False')

if not isinstance(keep_water, bool):
raise TypeError('keep_water should be True or False')

if not isinstance(overwrite, bool):
raise TypeError('overwrite should be True or False')

if not isinstance(infile, str):
raise TypeError('infile should be a string pointing to a file')

if not os.path.exists(infile):
raise ValueError('infile {0} does not exist'.format(infile))

if not isinstance(pH, Number):
raise TypeError('pH should be a number')

if outfile == None:
outfile = os.path.join(os.path.split(infile)[0], "addH_" + os.path.split(infile)[1])
outfile = os.path.join(os.path.split(infile)[0],
"addH_" + os.path.split(infile)[1])

if os.path.exists(outfile) and not overwrite:
LOGGER.warn('outfile {0} already exists, so returning it. \
Set overwrite=True to overwrite it'.format(outfile))
return outfile

if outfile == infile:
raise ValueError('outfile cannot be the same as infile')
Expand All @@ -70,17 +102,18 @@ def addMissingAtoms(infile, method='openbabel', pH=7.0, outfile=None, **kwargs):
raise ValueError('Openbabel cannot handle cif files')

try:
#import openbabel
from openbabel import openbabel
obconversion = openbabel.OBConversion()
obconversion.SetInFormat("pdb")
mol = openbabel.OBMol()
obconversion.ReadFile(mol, infile)
mol.AddHydrogens()
obconversion.WriteFile(mol, outfile)
LOGGER.info("Hydrogens were added to the structure. Structure {0} is saved in the local directry.".format(outfile))
except ImportError:
raise ImportError("Install Openbabel to add hydrogens to the structure or use PDBFixer/OpenMM.")

obconversion = openbabel.OBConversion()
obconversion.SetInFormat("pdb")
mol = openbabel.OBMol()
obconversion.ReadFile(mol, infile)
mol.AddHydrogens()
obconversion.WriteFile(mol, outfile)
LOGGER.info("Hydrogens were added to the structure. Structure {0} is saved in the local directry.".format(outfile))


elif method == 'pdbfixer':
try:
Expand Down Expand Up @@ -115,3 +148,50 @@ def addMissingAtoms(infile, method='openbabel', pH=7.0, outfile=None, **kwargs):
return outfile


def fixStructuresMissingAtoms(infiles, method='openbabel', pH=7.0, outfiles=None, **kwargs):
"""This function will add hydrogens to the protein and ligand structure from a set of files
using Openbabel [NO11]_ or PDBFixer with OpenMM.
There are also options whether to *model_residues* (default False), *remove_heterogens*
(default False) and *keep_waters* (default True).
:arg infiles: a list of PDB file names
:type infile: list
:arg method: Name of program which will be use to fix protein structure.
Two alternative options are available: 'openbabel' and 'pdbfixer'.
For either option additional software need to be installed:
'openbabel': OpenBabel
'pdbfixer': PDBFixer and OpenMM
default is 'openbabel'
:type method: str
:arg pH: pH value applyed only for PDBfixer.
:type pH: int, float
Instalation of Openbabel:
conda install -c conda-forge openbabel
Find more information here: https://anaconda.org/conda-forge/openbabel
https://github.com/openmm/pdbfixer
Program will create new file in the same directory with 'addH_' prefix.
.. [NO11] O'Boyle, N. M., Banck M., James C. A., Morley C., Vandermeersch T., Hutchison G. R.
Open Babel: An open chemical toolbox *Journal of cheminformatics* **2011** 3:1-14. """

if not isinstance(infiles, list):
raise TypeError('infiles should be a list')

if outfiles is None:
outfiles = [None for infile in infiles]

if not isinstance(outfiles, list):
raise TypeError('outfiles should be None or a list')
if len(outfiles) != len(infiles):
raise ValueError('outfiles should have the same length as infiles')

results = []
for i, infile in enumerate(infiles):
results.append(addMissingAtoms(infile, method, pH,
outfiles[i], **kwargs))
return results
Loading

0 comments on commit 568430e

Please sign in to comment.