prodigy-prot 2.4.0__tar.gz → 2.5.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/.github/workflows/ci.yml +1 -1
  2. prodigy_prot-2.5.1/.github/workflows/stale.yml +27 -0
  3. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/PKG-INFO +4 -3
  4. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/README.md +1 -0
  5. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/pyproject.toml +2 -2
  6. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/src/prodigy_prot/cli.py +12 -1
  7. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/src/prodigy_prot/modules/aa_properties.py +26 -0
  8. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/src/prodigy_prot/modules/parsers.py +17 -0
  9. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/src/prodigy_prot/modules/prodigy.py +41 -41
  10. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/tests/test_parsers.py +10 -0
  11. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/tests/test_prodigy.py +11 -3
  12. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/.github/workflows/docker-publish.yml +0 -0
  13. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/.github/workflows/publish.yml +0 -0
  14. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/.gitignore +0 -0
  15. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/.howfairis.yml +0 -0
  16. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/CITATION.cff +0 -0
  17. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/CODE_OF_CONDUCT.md +0 -0
  18. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/CONTRIBUTING.md +0 -0
  19. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/DEVELOPMENT.md +0 -0
  20. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/Dockerfile +0 -0
  21. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/LICENSE +0 -0
  22. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/MANIFEST.in +0 -0
  23. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/examples/3BZD.ic_model +0 -0
  24. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/examples/3BZD.pdb +0 -0
  25. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/examples/3bzd.cif +0 -0
  26. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/src/prodigy_prot/__init__.py +0 -0
  27. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/src/prodigy_prot/data/naccess.config +0 -0
  28. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/src/prodigy_prot/modules/__init__.py +0 -0
  29. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/src/prodigy_prot/modules/freesasa_tools.py +0 -0
  30. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/src/prodigy_prot/modules/models.py +0 -0
  31. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/src/prodigy_prot/modules/utils.py +0 -0
  32. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/tests/__init__.py +0 -0
  33. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/tests/test_data/2oob.cif +0 -0
  34. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/tests/test_data/2oob.pdb +0 -0
  35. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/tests/test_data/dataset.json +0 -0
  36. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/tests/test_data/dataset.tgz +0 -0
  37. {prodigy_prot-2.4.0 → prodigy_prot-2.5.1}/tests/test_utils.py +0 -0
@@ -7,7 +7,7 @@ jobs:
7
7
  runs-on: ubuntu-latest
8
8
  strategy:
9
9
  matrix:
10
- python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
10
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
11
11
  fail-fast: false
12
12
 
13
13
  steps:
@@ -0,0 +1,27 @@
1
+ name: "Close stale issues and PRs"
2
+ on:
3
+ schedule:
4
+ - cron: "30 1 * * *"
5
+ workflow_dispatch:
6
+
7
+ jobs:
8
+ stale:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ contents: write
12
+ issues: write
13
+ pull-requests: write
14
+ actions: write
15
+ steps:
16
+ - uses: actions/stale@v10
17
+ with:
18
+ stale-pr-message: "This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days."
19
+ stale-issue-message: "This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days."
20
+ close-pr-message: 'This PR was closed because it has been stalled for 5 days with no activity.'
21
+ close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
22
+ days-before-stale: 30
23
+ days-before-close: 5
24
+ exempt-issue-labels: "bug"
25
+ exempt-pr-labels: "bug"
26
+ remove-stale-when-updated: true
27
+ operations-per-run: 100
@@ -1,19 +1,19 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: prodigy-prot
3
- Version: 2.4.0
3
+ Version: 2.5.1
4
4
  Summary: PROtein binDIng enerGY prediction
5
5
  Author: Anna Vangone, Joao Rodrigues, Joerg Schaarschmidt
6
6
  Maintainer-email: BonvinLab <bonvinlab.support@uu.nl>
7
7
  License-Expression: Apache-2.0
8
8
  License-File: LICENSE
9
9
  Classifier: Development Status :: 5 - Production/Stable
10
- Classifier: Programming Language :: Python :: 3.9
11
10
  Classifier: Programming Language :: Python :: 3.10
12
11
  Classifier: Programming Language :: Python :: 3.11
13
12
  Classifier: Programming Language :: Python :: 3.12
14
13
  Classifier: Programming Language :: Python :: 3.13
15
14
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
16
15
  Classifier: Topic :: Scientific/Engineering :: Chemistry
16
+ Requires-Python: >=3.10
17
17
  Requires-Dist: biopython>=1.80
18
18
  Requires-Dist: freesasa>=2.2.1
19
19
  Requires-Dist: numpy>=2
@@ -100,6 +100,7 @@ options:
100
100
  --contact_list Output a list of contacts
101
101
  --pymol_selection Output a script to highlight the interface (pymol)
102
102
  -q, --quiet Outputs only the predicted affinity value
103
+ -s, --showall Outputs all original prodigy features but BSA (mutually exclusive with `-q`)
103
104
  -np, --number-of-processors NUMBER_OF_PROCESSORS
104
105
  Number of processors to use (default: 1)
105
106
 
@@ -73,6 +73,7 @@ options:
73
73
  --contact_list Output a list of contacts
74
74
  --pymol_selection Output a script to highlight the interface (pymol)
75
75
  -q, --quiet Outputs only the predicted affinity value
76
+ -s, --showall Outputs all original prodigy features but BSA (mutually exclusive with `-q`)
76
77
  -np, --number-of-processors NUMBER_OF_PROCESSORS
77
78
  Number of processors to use (default: 1)
78
79
 
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "prodigy-prot"
3
3
  license = "Apache-2.0"
4
- version = "2.4.0"
4
+ version = "2.5.1"
5
5
  description = "PROtein binDIng enerGY prediction"
6
6
  authors = [
7
7
  { name = "Anna Vangone" },
@@ -10,9 +10,9 @@ authors = [
10
10
  ]
11
11
  maintainers = [{ name = "BonvinLab", email = "bonvinlab.support@uu.nl" }]
12
12
  readme = "README.md"
13
+ requires-python = ">=3.10"
13
14
  classifiers = [
14
15
  "Development Status :: 5 - Production/Stable",
15
- "Programming Language :: Python :: 3.9",
16
16
  "Programming Language :: Python :: 3.10",
17
17
  "Programming Language :: Python :: 3.11",
18
18
  "Programming Language :: Python :: 3.12",
@@ -55,6 +55,12 @@ ap.add_argument(
55
55
  action="store_true",
56
56
  help="Outputs only the predicted affinity value",
57
57
  )
58
+ ap.add_argument(
59
+ "-s",
60
+ "--showall",
61
+ action="store_true",
62
+ help="Outputs all original prodigy features but BSA (mutually exclusive with `-q`)",
63
+ )
58
64
  ap.add_argument(
59
65
  "-np",
60
66
  "--number-of-processors",
@@ -89,6 +95,11 @@ def main():
89
95
  args = ap.parse_args()
90
96
  log.setLevel(logging.ERROR if args.quiet else logging.INFO)
91
97
 
98
+ if args.quiet and args.showall:
99
+ log.error("Error: --quiet (-q) and --showall (-s) are mutually exclusive arguments")
100
+ sys.exit(1)
101
+ log.setLevel(logging.ERROR if args.quiet else logging.INFO)
102
+
92
103
  struct_path = Path(args.input_path)
93
104
 
94
105
  input_list = []
@@ -169,7 +180,7 @@ def process_model(model: Model, identifier: str, args: argparse.Namespace, struc
169
180
  prodigy.predict(
170
181
  distance_cutoff=args.distance_cutoff, acc_threshold=args.acc_threshold
171
182
  )
172
- prodigy.print_prediction(quiet=args.quiet)
183
+ prodigy.print_prediction(quiet=args.quiet, showall=args.showall)
173
184
  finally:
174
185
  sys.stdout = old_stdout
175
186
 
@@ -49,6 +49,32 @@ aa_character_protorp: dict[str, str] = {
49
49
  "TYR": "P",
50
50
  }
51
51
 
52
+ # Taken from pre-original prodigy code
53
+ # B for hydrophoBic
54
+ # Y for hydrophiLic
55
+ aa_character_hydro: dict[str, str] = {
56
+ "ALA": "B", #+
57
+ "CYS": "B", #+
58
+ "GLU": "L", #+
59
+ "ASP": "L", #+
60
+ "GLY": "L", # Glycine was B in my initial classification
61
+ "PHE": "B", #+
62
+ "ILE": "B", #+
63
+ "HIS": "L", #+
64
+ "LYS": "L", #+
65
+ "MET": "B", #+
66
+ "LEU": "B", #+
67
+ "ASN": "L", #+
68
+ "GLN": "L", #+
69
+ "PRO": "L", # Proline was B my initial classification
70
+ "SER": "L", #+
71
+ "ARG": "L", #+
72
+ "THR": "L", #+
73
+ "TRP": "L", #+
74
+ "VAL": "B", #+
75
+ "TYR": "L", #+
76
+ }
77
+
52
78
  # Scaling factors for relative ASA
53
79
  # Calculated using extended ALA-X-ALA peptides
54
80
  # Taken from NACCESS
@@ -33,6 +33,22 @@ def ignore(r):
33
33
  return r.id[0][0] == "W" or r.id[0][0] == "H"
34
34
 
35
35
 
36
+ # Force-field (CHARMM, AMBER) names of standard residues
37
+ FORCEFIELD_RESNAMES = {
38
+ "HSD": "HIS",
39
+ "HSE": "HIS",
40
+ "HSP": "HIS",
41
+ "HID": "HIS",
42
+ "HIE": "HIS",
43
+ "HIP": "HIS",
44
+ "CYX": "CYS",
45
+ "CYM": "CYS",
46
+ "ASH": "ASP",
47
+ "GLH": "GLU",
48
+ "LYN": "LYS",
49
+ }
50
+
51
+
36
52
  def validate_structure(
37
53
  input_strcture_obj: Structure,
38
54
  selection: Optional[list[str]] = None,
@@ -90,6 +106,7 @@ def validate_structure(
90
106
  res_list = list(model.get_residues())
91
107
 
92
108
  for res in res_list:
109
+ res.resname = FORCEFIELD_RESNAMES.get(res.resname, res.resname)
93
110
  if ignore(res):
94
111
  chain = res.parent
95
112
  assert chain is not None
@@ -4,7 +4,7 @@ from typing import Optional, TextIO, Union
4
4
 
5
5
  from Bio.PDB.Model import Model
6
6
  from Bio.PDB.NeighborSearch import NeighborSearch
7
- from Bio.PDB.Structure import Structure
7
+ #from Bio.PDB.Structure import Structure
8
8
 
9
9
  from prodigy_prot.modules import aa_properties
10
10
  from prodigy_prot.modules.freesasa_tools import execute_freesasa_api
@@ -59,6 +59,9 @@ def analyse_contacts(contact_list: list) -> dict[str, float]:
59
59
  "AP": 0.0,
60
60
  "CP": 0.0,
61
61
  "AC": 0.0,
62
+ "LL": 0.0,
63
+ "BL": 0.0,
64
+ "BB": 0.0
62
65
  }
63
66
 
64
67
  _data = aa_properties.aa_character_ic
@@ -69,6 +72,14 @@ def analyse_contacts(contact_list: list) -> dict[str, float]:
69
72
  contact_type = "".join(sorted((i, j)))
70
73
  bins[contact_type] += 1
71
74
 
75
+ _data = aa_properties.aa_character_hydro
76
+ for res_i, res_j in contact_list:
77
+ i = _data.get(res_i.resname)
78
+ j = _data.get(res_j.resname)
79
+ if i is not None and j is not None:
80
+ contact_type = "".join(sorted((i, j)))
81
+ bins[contact_type] += 1
82
+
72
83
  return bins
73
84
 
74
85
 
@@ -95,7 +106,6 @@ def analyse_nis(sasa_dict: dict, acc_threshold: float = 0.05) -> list[float]:
95
106
  count[aa_index] += 1
96
107
 
97
108
  percentages = [100.0 * x / sum(count) for x in count]
98
- # print('[+] No. of buried interface residues: {0}'.format(sum(count)))
99
109
  return percentages
100
110
 
101
111
 
@@ -123,10 +133,14 @@ class Prodigy:
123
133
  "PP": 0.0,
124
134
  "AP": 0.0,
125
135
  "AA": 0.0,
136
+ "LL": 0.0,
137
+ "BL": 0.0,
138
+ "BB": 0.0
126
139
  }
127
140
 
128
141
  self.nis_a = 0.0
129
142
  self.nis_c = 0.0
143
+ self.nis_p = 0.0
130
144
  self.ba_val = 0.0
131
145
  self.kd_val = 0.0
132
146
 
@@ -154,10 +168,9 @@ class Prodigy:
154
168
  )
155
169
 
156
170
  self.bins = analyse_contacts(self.ic_network)
157
-
158
171
  # SASA
159
172
  _, cmplx_sasa = execute_freesasa_api(self.model)
160
- self.nis_a, self.nis_c, _ = analyse_nis(cmplx_sasa, acc_threshold=acc_threshold)
173
+ self.nis_a, self.nis_c, self.nis_p = analyse_nis(cmplx_sasa, acc_threshold=acc_threshold)
161
174
 
162
175
  # Affinity Calculation
163
176
  self.ba_val = IC_NIS(
@@ -178,13 +191,14 @@ class Prodigy:
178
191
  "ICs": len(self.ic_network),
179
192
  "nis_a": self.nis_a,
180
193
  "nis_c": self.nis_c,
194
+ "nis_p": self.nis_p,
181
195
  "ba_val": self.ba_val,
182
196
  "kd_val": self.kd_val,
183
197
  }
184
198
  return_dict.update(self.bins)
185
199
  return return_dict
186
200
 
187
- def print_prediction(self, outfile: str = "", quiet: bool = False) -> None:
201
+ def print_prediction(self, outfile: str = "", quiet: bool = False, showall: bool = False) -> None:
188
202
  handle: Union[TextIOWrapper, TextIO]
189
203
  if outfile:
190
204
  handle = open(outfile, "w")
@@ -194,42 +208,28 @@ class Prodigy:
194
208
  if quiet:
195
209
  handle.write("{0}\t{1:8.3f}\n".format(self.name, self.ba_val))
196
210
  else:
197
- handle.write(
198
- "[+] No. of intermolecular contacts: {0}\n".format(len(self.ic_network))
199
- )
200
- handle.write(
201
- "[+] No. of charged-charged contacts: {0}\n".format(self.bins["CC"])
202
- )
203
- handle.write(
204
- "[+] No. of charged-polar contacts: {0}\n".format(self.bins["CP"])
205
- )
206
- handle.write(
207
- "[+] No. of charged-apolar contacts: {0}\n".format(self.bins["AC"])
208
- )
209
- handle.write(
210
- "[+] No. of polar-polar contacts: {0}\n".format(self.bins["PP"])
211
- )
212
- handle.write(
213
- "[+] No. of apolar-polar contacts: {0}\n".format(self.bins["AP"])
214
- )
215
- handle.write(
216
- "[+] No. of apolar-apolar contacts: {0}\n".format(self.bins["AA"])
217
- )
218
-
219
- handle.write(
220
- "[+] Percentage of apolar NIS residues: {0:3.2f}\n".format(self.nis_a)
221
- )
222
- handle.write(
223
- "[+] Percentage of charged NIS residues: {0:3.2f}\n".format(self.nis_c)
224
- )
225
- handle.write(
226
- "[++] Predicted binding "
227
- "affinity (kcal.mol-1): {0:8.1f}\n".format(self.ba_val)
228
- )
229
- handle.write(
230
- "[++] Predicted dissociation constant (M) at {:.1f}˚C:"
231
- " {:8.1e}\n".format(self.temp, self.kd_val)
232
- )
211
+ # Collect output lines in order
212
+ lines = []
213
+ lines.append(f"[+] No. of intermolecular contacts: {len(self.ic_network)}\n")
214
+ lines.append(f"[+] No. of charged-charged contacts: {self.bins['CC']}\n")
215
+ lines.append(f"[+] No. of charged-polar contacts: {self.bins['CP']}\n")
216
+ lines.append(f"[+] No. of charged-apolar contacts: {self.bins['AC']}\n")
217
+ lines.append(f"[+] No. of polar-polar contacts: {self.bins['PP']}\n")
218
+ lines.append(f"[+] No. of apolar-polar contacts: {self.bins['AP']}\n")
219
+ lines.append(f"[+] No. of apolar-apolar contacts: {self.bins['AA']}\n")
220
+
221
+ if showall:
222
+ lines.append(f"[+] No. of hydrophiLic-hydrophiLic contacts: {self.bins['LL']}\n")
223
+ lines.append(f"[+] No. of hydrophoBic-hydrophiLic contacts: {self.bins['BL']}\n")
224
+ lines.append(f"[+] No. of hydrophoBic-hydrophoBic contacts: {self.bins['BB']}\n")
225
+ lines.append(f"[+] Percentage of Polar NIS residues: {self.nis_p:3.2f}\n")
226
+
227
+ lines.append(f"[+] Percentage of apolar NIS residues: {self.nis_a:3.2f}\n")
228
+ lines.append(f"[+] Percentage of charged NIS residues: {self.nis_c:3.2f}\n")
229
+ lines.append(f"[++] Predicted binding affinity (kcal.mol-1): {self.ba_val:8.1f}\n")
230
+ lines.append(f"[++] Predicted dissociation constant (M) at {self.temp:.1f}˚C: {self.kd_val:8.1e}\n")
231
+
232
+ handle.writelines(lines)
233
233
 
234
234
  if handle is not sys.stdout:
235
235
  handle.close()
@@ -52,6 +52,16 @@ def test_validate_structure_cif(input_structure_cif):
52
52
  assert result == structure.child_list
53
53
 
54
54
 
55
+ def test_validate_structure_forcefield_resnames(input_structure_pdb):
56
+
57
+ structure = PDBParser().get_structure("test_structure", input_structure_pdb)
58
+ his = next(r for r in structure.get_residues() if r.resname == "HIS")
59
+ his.resname = "HSD"
60
+
61
+ validate_structure(structure)
62
+ assert his.resname == "HIS"
63
+
64
+
55
65
  def test_parse_structure_pdb(input_structure_pdb):
56
66
 
57
67
  parser = PDBParser()
@@ -87,8 +87,10 @@ def test_analyse_contacts(input_model):
87
87
  "AP": 0.0,
88
88
  "CP": 1.0,
89
89
  "AC": 0.0,
90
+ "LL": 1.0,
91
+ "BL": 0.0,
92
+ "BB": 0.0
90
93
  }
91
-
92
94
  assert result == expected_output
93
95
 
94
96
 
@@ -119,7 +121,8 @@ def test_prodigy_as_dict(prodigy_class):
119
121
  result = prodigy_class.as_dict()
120
122
 
121
123
  assert isinstance(result, dict)
122
- assert len(result) == 14
124
+ # 14 'original' + 3 hydro + 1 %NIS
125
+ assert len(result) == 18
123
126
 
124
127
 
125
128
  def test_prodigy_print_prediction(prodigy_class):
@@ -128,7 +131,12 @@ def test_prodigy_print_prediction(prodigy_class):
128
131
  assert Path(outfile.name).stat().st_size == 0
129
132
 
130
133
  prodigy_class.print_prediction(outfile.name)
131
- assert Path(outfile.name).stat().st_size != 0
134
+ # Labels as in 2.4.0, read by scripts that parse the output
135
+ output = Path(outfile.name).read_text()
136
+ assert "[+] No. of charged-charged contacts:" in output
137
+ assert "[+] Percentage of apolar NIS residues:" in output
138
+ assert "[++] Predicted binding affinity (kcal.mol-1):" in output
139
+ assert "[++] Predicted dissociation constant (M) at" in output
132
140
 
133
141
  Path(outfile.name).unlink()
134
142
 
File without changes
File without changes
File without changes
File without changes
File without changes