Skip to content

Commit

Permalink
Merge pull request prody#1948 from karolamik13/interactions
Browse files Browse the repository at this point in the history
InSty - changes in calcStatisticsInteractions
  • Loading branch information
karolamik13 authored Sep 12, 2024
2 parents 2a11d0a + 2db6ea9 commit 9639506
Show file tree
Hide file tree
Showing 2 changed files with 322 additions and 43 deletions.
28 changes: 24 additions & 4 deletions prody/proteins/fixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def addMissingAtoms(infile, method='openbabel', pH=7.0, outfile=None, **kwargs):
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).
(default False), *keep_waters* (default True), *overwrite* (default False), *keep_ids* (default True).
:arg infile: PDB file name
:type infile: str
Expand All @@ -41,9 +41,17 @@ def addMissingAtoms(infile, method='openbabel', pH=7.0, outfile=None, **kwargs):
default is 'openbabel'
:type method: str
:arg pH: pH value applyed only for PDBfixer.
:arg pH: pH value applied only for PDBfixer.
:type pH: int, float
:arg model_residues: add all missing atoms from residues, applied only for PDBfixer.
default is False
:type model_residues: bool
:arg keep_ids: keep the original residue number, applied only for PDBfixer.
default is True
:type keep_ids: bool
Instalation of Openbabel:
conda install -c conda-forge openbabel
Expand All @@ -58,6 +66,7 @@ def addMissingAtoms(infile, method='openbabel', pH=7.0, outfile=None, **kwargs):
remove_heterogens = kwargs.get("remove_heterogens", False)
keep_water = kwargs.get("keep_water", True)
overwrite = kwargs.get("overwrite", False)
keep_ids = kwargs.get("keep_ids", True)

import os

Expand All @@ -70,6 +79,9 @@ def addMissingAtoms(infile, method='openbabel', pH=7.0, outfile=None, **kwargs):
if not isinstance(keep_water, bool):
raise TypeError('keep_water should be True or False')

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

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

Expand Down Expand Up @@ -136,7 +148,7 @@ def addMissingAtoms(infile, method='openbabel', pH=7.0, outfile=None, **kwargs):
fixer.findMissingAtoms()
fixer.addMissingAtoms()
fixer.addMissingHydrogens(pH)
PDBFile.writeFile(fixer.topology, fixer.positions, open(outfile, 'w'))
PDBFile.writeFile(fixer.topology, fixer.positions, open(outfile, 'w'), keepIds=keep_ids)
LOGGER.info("Hydrogens were added to the structure. New structure is saved as {0}.".format(outfile))

except ImportError:
Expand Down Expand Up @@ -165,8 +177,16 @@ def fixStructuresMissingAtoms(infiles, method='openbabel', pH=7.0, outfiles=None
'pdbfixer': PDBFixer and OpenMM
default is 'openbabel'
:type method: str
:arg model_residues: add all missing atoms from residues, applied only for PDBfixer.
default is False
:type model_residues: bool
:arg keep_ids: keep the original residue number, applied only for PDBfixer.
default is True
:type keep_ids: bool
:arg pH: pH value applyed only for PDBfixer.
:arg pH: pH value applied only for PDBfixer.
:type pH: int, float
Instalation of Openbabel:
Expand Down
Loading

0 comments on commit 9639506

Please sign in to comment.