Skip to content

Commit

Permalink
Merge pull request #145 from pharmai/development
Browse files Browse the repository at this point in the history
Version 2.3.0
  • Loading branch information
fkaiserbio committed Aug 18, 2023
2 parents 1fced62 + 4013ead commit 0ed71ae
Show file tree
Hide file tree
Showing 9 changed files with 8,262 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: PLIP Build

on:
push
[push, pull_request]

jobs:
docker-hub:
Expand All @@ -16,4 +16,4 @@ jobs:
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: pharmai/plip
tag_with_ref: true
push: ${{ startsWith(github.ref, 'refs/tags/') }}
push: ${{ startsWith(github.ref, 'refs/tags/') }}
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Changelog
---------
# 2.3.0
* fixes an issue that caused encoding errors to be thrown
* salt bridge interaction improved
* minor bugs fixed

# 2.2.2
* fixes an issue that caused encoding errors to be thrown

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ If you cannot use the containerized bundle or want to use PLIP sources, make sur
- Python >= 3.6.9
- [OpenBabel](#Installing-OpenBabel) >= 3.0.0 with [Python bindings](https://open-babel.readthedocs.io/en/latest/UseTheLibrary/PythonInstall.html)
- PyMOL >= 2.3.0 with Python bindings (optional, for visualization only)
- ImageMagick >= 6.9 (optional)
- ImageMagick >= 7.0 (optional)

**Python:** If you are on a system where Python 3 is executed using `python3` instead of just `python`, replace the `python` and `pip` commands in the following steps with `python3` and `pip3` accordingly.

Expand Down Expand Up @@ -164,7 +164,7 @@ Using PLIP in your commercial or non-commercial project is generally possible wh
If you are using PLIP in your work, please cite
> Adasme,M. et al. PLIP 2021: expanding the scope of the protein-ligand interaction profiler to DNA and RNA.
> Nucl. Acids Res. (05 May 2021), gkab294. doi: 10.1093/nar/gkab294
or

> Salentin,S. et al. PLIP: fully automated protein-ligand interaction profiler.
Expand Down
2 changes: 1 addition & 1 deletion plip/basic/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '2.2.2'
__version__ = '2.3.0'
__maintainer__ = 'PharmAI GmbH (2020-2021) - www.pharm.ai - hello@pharm.ai'
__citation_information__ = "Adasme,M. et al. PLIP 2021: expanding the scope of the protein-ligand interaction profiler to DNA and RNA. " \
"Nucl. Acids Res. (05 May 2021), gkab294. doi: 10.1093/nar/gkab294"
Expand Down
1 change: 0 additions & 1 deletion plip/basic/supplemental.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ def sort_members_by_importance(members):
main = [x for x in members if x[0] not in config.METAL_IONS]
ion = [x for x in members if x[0] in config.METAL_IONS]
sorted_main = sorted(main, key=lambda x: (x[1], x[2]))
sorted_main = sorted(main, key=lambda x: (x[1], x[2]))
sorted_ion = sorted(ion, key=lambda x: (x[1], x[2]))
return sorted_main + sorted_ion

Expand Down
27 changes: 22 additions & 5 deletions plip/structure/preparation.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,16 @@ def parse_pdb(self):
alt = []
previous_ter = False

model_dict = {1: list()}
model_dict = {0: list()}

# Standard without fixing
if not config.NOFIX:
if not config.PLUGIN_MODE:
lastnum = 0 # Atom numbering (has to be consecutive)
other_models = False
current_model = 1
# Model 0 stores header and similar additional data
# or the full file if no MODEL entries exist in the file
current_model = 0
for line in fil:
corrected_line, newnum = self.fix_pdbline(line, lastnum)
if corrected_line is not None:
Expand All @@ -81,8 +83,11 @@ def parse_pdb(self):
try:
if other_models:
logger.info(f'selecting model {config.MODEL} for analysis')
corrected_pdb = ''.join(model_dict[config.MODEL])
corrected_lines = model_dict[config.MODEL]
corrected_pdb = ''.join(model_dict[0])
corrected_lines = model_dict[0]
if current_model > 0:
corrected_pdb += ''.join(model_dict[config.MODEL])
corrected_lines += model_dict[config.MODEL]
except KeyError:
corrected_pdb = ''.join(model_dict[1])
corrected_lines = model_dict[1]
Expand Down Expand Up @@ -924,6 +929,7 @@ def find_hal(self, atoms):

def find_charged(self, mol):
"""Looks for positive charges in arginine, histidine or lysine, for negative in aspartic and glutamic acid."""
"""If nucleic acids are part of the receptor, looks for negative charges in phosphate backbone"""
data = namedtuple('pcharge', 'atoms atoms_orig_idx type center restype resnr reschain')
a_set = []
# Iterate through all residue, exclude those in chains defined as peptides
Expand Down Expand Up @@ -961,6 +967,17 @@ def find_charged(self, mol):
restype=res.GetName(),
resnr=res.GetNum(),
reschain=res.GetChain()))
if res.GetName() in config.DNA + config.RNA and config.DNARECEPTOR: # nucleic acids have negative charge in sugar phosphate
for a in pybel.ob.OBResidueAtomIter(res):
if a.GetType().startswith('P') and res.GetAtomProperty(a, 9) \
and not self.Mapper.mapid(a.GetIdx(), mtype='protein') in self.altconf:
a_contributing.append(pybel.Atom(a))
a_contributing_orig_idx.append(self.Mapper.mapid(a.GetIdx(), mtype='protein'))
if not len(a_contributing) == 0:
a_set.append(data(atoms=a_contributing,atoms_orig_idx=a_contributing_orig_idx, type='negative',
center=centroid([ac.coords for ac in a_contributing]), restype=res.GetName(),
resnr=res.GetNum(),
reschain=res.GetChain()))
return a_set

def find_metal_binding(self, mol):
Expand Down Expand Up @@ -1365,7 +1382,7 @@ def load_pdb(self, pdbpath, as_string=False):

if not as_string:
self.sourcefiles['filename'] = os.path.basename(self.sourcefiles['pdbcomplex'])
self.protcomplex, self.filetype = read_pdb(self.corrected_pdb, as_string=True)
self.protcomplex, self.filetype = read_pdb(self.corrected_pdb, as_string= (self.corrected_pdb != pdbpath)) # self.corrected_pdb may fallback to pdbpath

# Update the model in the Mapper class instance
self.Mapper.original_structure = self.protcomplex.OBMol
Expand Down

0 comments on commit 0ed71ae

Please sign in to comment.