biobb-structure-checking 3.16.1__tar.gz → 3.16.3__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 (66) hide show
  1. {biobb_structure_checking-3.16.1/biobb_structure_checking.egg-info → biobb_structure_checking-3.16.3}/PKG-INFO +9 -8
  2. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/README.md +7 -6
  3. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/check_structure.py +1 -1
  4. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/add_hydrogen.py +8 -4
  5. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/altloc.py +36 -31
  6. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/backbone.py +6 -1
  7. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/chains.py +3 -5
  8. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/sequences.py +10 -0
  9. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/constants.py +9 -7
  10. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/dat/commands.hlp +2 -2
  11. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/modelling/modelsdata.py +7 -4
  12. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/modelling/residue_set.py +5 -7
  13. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/modelling/sequencedata.py +44 -6
  14. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/modelling/structuredata.py +30 -19
  15. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/modelling/utils.py +20 -9
  16. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/mutation_manager.py +2 -3
  17. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/pdbio/mmb_server.py +4 -41
  18. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/pdbio/param_input.py +4 -3
  19. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/structure_checking.py +16 -20
  20. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/structure_manager.py +60 -22
  21. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3/biobb_structure_checking.egg-info}/PKG-INFO +9 -8
  22. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/setup.py +3 -3
  23. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/LICENSE +0 -0
  24. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/MANIFEST.in +0 -0
  25. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/__init__.py +0 -0
  26. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/__init__.py +0 -0
  27. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/amide.py +0 -0
  28. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/chiral.py +0 -0
  29. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/chiral_bck.py +0 -0
  30. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/cistransbck.py +0 -0
  31. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/clashes.py +0 -0
  32. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/fixside.py +0 -0
  33. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/getss.py +0 -0
  34. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/inscodes.py +0 -0
  35. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/ligands.py +0 -0
  36. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/metals.py +0 -0
  37. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/models.py +0 -0
  38. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/mutateside.py +0 -0
  39. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/rem_hydrogen.py +0 -0
  40. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/commands/water.py +0 -0
  41. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/dat/ADT_prm.json +0 -0
  42. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/dat/CMIP_prm.json +0 -0
  43. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/dat/all_residues.in +0 -0
  44. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/dat/data_lib.json +0 -0
  45. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/dat/modRes/modSER.json +0 -0
  46. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/dat/modRes/modTHR.json +0 -0
  47. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/dat/modRes/modTYR.json +0 -0
  48. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/dat/modRes/modres.json +0 -0
  49. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/dat/modRes/modres_phospho.json +0 -0
  50. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/libs/__init__.py +0 -0
  51. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/libs/data_lib_manager.py +0 -0
  52. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/libs/residue_lib_manager.py +0 -0
  53. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/modeller_manager.py +0 -0
  54. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/modelling/__init__.py +0 -0
  55. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/modelling/chainsdata.py +0 -0
  56. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/pdbio/PDBIO_extended.py +0 -0
  57. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/pdbio/__init__.py +0 -0
  58. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/pdbio/bare_builder.py +0 -0
  59. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/pdbio/json_writer.py +0 -0
  60. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking/py.typed +0 -0
  61. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking.egg-info/SOURCES.txt +0 -0
  62. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking.egg-info/dependency_links.txt +0 -0
  63. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking.egg-info/entry_points.txt +0 -0
  64. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking.egg-info/requires.txt +0 -0
  65. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/biobb_structure_checking.egg-info/top_level.txt +0 -0
  66. {biobb_structure_checking-3.16.1 → biobb_structure_checking-3.16.3}/setup.cfg +0 -0
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: biobb_structure_checking
3
- Version: 3.16.1
3
+ Version: 3.16.3
4
4
  Summary: BioBB_structure_checking performs MDWeb structure checking tool set as a command line utility.
5
5
  Home-page: https://github.com/bioexcel/biobb_structure_checking
6
6
  Author: Biobb developers
7
7
  Author-email: gelpi@ub.edu
8
- Project-URL: Documentation, http://BioBB_structure_checking.readthedocs.io/en/latest/
8
+ Project-URL: Documentation, http://biobb-structure-checking.readthedocs.io/en/latest/
9
9
  Project-URL: Bioexcel, https://bioexcel.eu/
10
10
  Keywords: Bioinformatics Workflows BioExcel Compatibility
11
11
  Classifier: Development Status :: 3 - Alpha
@@ -54,10 +54,10 @@ Biobb_structure_checking package allows to configure the system (selection of mo
54
54
  The Biobb_structure_checking package provides a command line utility ([check_structure](https://biobb-structure-checking.readthedocs.io/en/latest/command_line_usage.html)) and a python [API](https://biobb-structure-checking.readthedocs.io/en/latest/biobb_structure_checking.html).
55
55
 
56
56
  The latest documentation of this package can be found in our readthedocs site:
57
- [latest package documentation](http://biobb_structure_checking.readthedocs.io/en/latest/).
57
+ [latest package documentation](http://biobb-structure-checking.readthedocs.io/en/latest/).
58
58
 
59
59
  ### Version
60
- v3.16.1 Feb 2026
60
+ v3.16.3 Aug 2026
61
61
 
62
62
  ### Requirements
63
63
 
@@ -76,7 +76,7 @@ Using PIP:
76
76
 
77
77
  pip install "biobb_structure_checking>=3.16.0"
78
78
 
79
- * Usage: [Python API documentation](https://biobb_structure_checking.readthedocs.io/en/latest/modules.html).
79
+ * Usage: [Python API documentation](https://biobb-structure-checking.readthedocs.io/en/latest/modules.html).
80
80
 
81
81
  Using ANACONDA:
82
82
 
@@ -84,14 +84,15 @@ Using ANACONDA:
84
84
 
85
85
  conda install -c bioconda "biobb_structure_checking>=3.16.0"
86
86
 
87
- * Usage: With conda installation BioBBs can be used with the [Python API documentation](https://biobb_structure_checking.readthedocs.io/en/latest/modules.html) and the [Command Line documentation](https://biobb_structure_checking.readthedocs.io/en/latest/command_line.html)
87
+ * Usage: With conda installation BioBBs can be used with the [Python API documentation](https://biobb-structure-checking.readthedocs.io/en/latest/modules.html) and the [Command Line documentation](https://biobb-structure-checking.readthedocs.io/en/latest/command_line.html)
88
88
 
89
89
  ### Copyright & Licensing
90
90
  This software has been developed in the MMB group (http://mmb.irbbarcelona.org) at the
91
91
  BSC (https://www.bsc.es/) & IRB (https://www.irbbarcelona.org/) for the European BioExcel (https://bioexcel.eu/). BioExcel is funded by the European Union Horizon 2020 program under grant agreements 823830, 675728 and by the EuroHPC Joint Undertaking and Sweden, Netherlands, Germany, Spain, Finland and Norway under grant agreement 101093290 funded by the European Commission.
92
92
 
93
- * (c) 2015-2025 [Barcelona Supercomputing Center](https://www.bsc.es/)
94
- * (c) 2015-2025 [Institute for Research in Biomedicine](https://www.irbbarcelona.org/)
93
+ * (c) 2015-2026 [Barcelona Supercomputing Center](https://www.bsc.es/)
94
+ * (c) 2015-2026 [Institute for Research in Biomedicine](https://www.irbbarcelona.org/)
95
+ * (c) 2015-2026 [University of Barcelona](https://www.ub.edu/)
95
96
 
96
97
  Licensed under the
97
98
  [GNU Lesser General Public License v2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html).
@@ -20,10 +20,10 @@ Biobb_structure_checking package allows to configure the system (selection of mo
20
20
  The Biobb_structure_checking package provides a command line utility ([check_structure](https://biobb-structure-checking.readthedocs.io/en/latest/command_line_usage.html)) and a python [API](https://biobb-structure-checking.readthedocs.io/en/latest/biobb_structure_checking.html).
21
21
 
22
22
  The latest documentation of this package can be found in our readthedocs site:
23
- [latest package documentation](http://biobb_structure_checking.readthedocs.io/en/latest/).
23
+ [latest package documentation](http://biobb-structure-checking.readthedocs.io/en/latest/).
24
24
 
25
25
  ### Version
26
- v3.16.1 Feb 2026
26
+ v3.16.3 Aug 2026
27
27
 
28
28
  ### Requirements
29
29
 
@@ -42,7 +42,7 @@ Using PIP:
42
42
 
43
43
  pip install "biobb_structure_checking>=3.16.0"
44
44
 
45
- * Usage: [Python API documentation](https://biobb_structure_checking.readthedocs.io/en/latest/modules.html).
45
+ * Usage: [Python API documentation](https://biobb-structure-checking.readthedocs.io/en/latest/modules.html).
46
46
 
47
47
  Using ANACONDA:
48
48
 
@@ -50,14 +50,15 @@ Using ANACONDA:
50
50
 
51
51
  conda install -c bioconda "biobb_structure_checking>=3.16.0"
52
52
 
53
- * Usage: With conda installation BioBBs can be used with the [Python API documentation](https://biobb_structure_checking.readthedocs.io/en/latest/modules.html) and the [Command Line documentation](https://biobb_structure_checking.readthedocs.io/en/latest/command_line.html)
53
+ * Usage: With conda installation BioBBs can be used with the [Python API documentation](https://biobb-structure-checking.readthedocs.io/en/latest/modules.html) and the [Command Line documentation](https://biobb-structure-checking.readthedocs.io/en/latest/command_line.html)
54
54
 
55
55
  ### Copyright & Licensing
56
56
  This software has been developed in the MMB group (http://mmb.irbbarcelona.org) at the
57
57
  BSC (https://www.bsc.es/) & IRB (https://www.irbbarcelona.org/) for the European BioExcel (https://bioexcel.eu/). BioExcel is funded by the European Union Horizon 2020 program under grant agreements 823830, 675728 and by the EuroHPC Joint Undertaking and Sweden, Netherlands, Germany, Spain, Finland and Norway under grant agreement 101093290 funded by the European Commission.
58
58
 
59
- * (c) 2015-2025 [Barcelona Supercomputing Center](https://www.bsc.es/)
60
- * (c) 2015-2025 [Institute for Research in Biomedicine](https://www.irbbarcelona.org/)
59
+ * (c) 2015-2026 [Barcelona Supercomputing Center](https://www.bsc.es/)
60
+ * (c) 2015-2026 [Institute for Research in Biomedicine](https://www.irbbarcelona.org/)
61
+ * (c) 2015-2026 [University of Barcelona](https://www.ub.edu/)
61
62
 
62
63
  Licensed under the
63
64
  [GNU Lesser General Public License v2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html).
@@ -37,7 +37,7 @@ def main():
37
37
 
38
38
  if args.command == 'commands':
39
39
  help_str = header()
40
- with open(opj(data_dir_path, cts.COMMANDS_HELP_PATH)) as help_file:
40
+ with open(opj(data_dir_path, cts.COMMANDS_HELP_PATH), 'r', encoding='utf-8') as help_file:
41
41
  help_str += help_file.read()
42
42
  pydoc.pager(help_str)
43
43
  sys.exit(0)
@@ -109,7 +109,8 @@ def fix(strcheck, opts, fix_data=None):
109
109
  for r_at in fix_data['ion_res_list']:
110
110
  res = r_at[0]
111
111
  rcode = res.get_resname()
112
- if ph_value <= std_ion[rcode]['pK']:
112
+
113
+ if float(ph_value) <= std_ion[rcode]['pK']:
113
114
  ion_to_fix[res] = std_ion[rcode]['lowpH']
114
115
  else:
115
116
  ion_to_fix[res] = std_ion[rcode]['highpH']
@@ -132,6 +133,7 @@ def fix(strcheck, opts, fix_data=None):
132
133
  for mut_res in mut.mutations:
133
134
  ion_to_fix[mut_res['resobj']] = mut_res['new_id']
134
135
  else:
136
+ strcheck.summary['add_hydrogen']['selection'] = []
135
137
  if add_h_mode == 'int':
136
138
  if not strcheck.args['quiet']:
137
139
  print('Selection: interactive')
@@ -143,13 +145,15 @@ def fix(strcheck, opts, fix_data=None):
143
145
  r_at for r_at in fix_data['ion_res_list']
144
146
  if r_at[0].get_resname() == 'HIS'
145
147
  ]
146
- strcheck.summary['add_hydrogen']['selection'] = []
148
+ else:
149
+ res_list = []
150
+
147
151
  for r_at in res_list:
148
152
  rcode = r_at[0].get_resname()
149
153
  input_line = ParamInput(
150
154
  "Select residue form for " + mu.residue_id(r_at[0]),
151
- strcheck.args['non_interactive']
152
- )
155
+ strcheck.args['non_interactive']
156
+ )
153
157
  input_line.add_option_list('list', r_at[1].keys())
154
158
  input_line.default = std_ion[rcode]['std']
155
159
 
@@ -26,17 +26,21 @@ def check(strcheck):
26
26
  print(rid)
27
27
  strcheck.summary['altloc'][rid] = {}
28
28
  fix_data['altlocs'][res] = sorted(alt_loc_res[res][0].child_dict)
29
+ alts = set()
29
30
  for atm in alt_loc_res[res]:
30
31
  strcheck.summary['altloc'][rid][atm.id] = []
31
32
  alt_str = f" {atm.id:4}"
32
33
  for alt in sorted(atm.child_dict):
34
+ alts.add(alt)
33
35
  alt_str += f" {alt} ({atm.child_dict[alt].occupancy:4.2f})"
34
36
  strcheck.summary['altloc'][rid][atm.id].append({
35
37
  'loc_label': alt,
36
38
  'occupancy': atm.child_dict[alt].occupancy
37
39
  })
38
40
  print(alt_str)
39
-
41
+ if 'A' not in alts:
42
+ print(cts.MSGS['ALTLOC_NO_A'])
43
+ strcheck.summary['altloc'][rid]['no_altA'] = True
40
44
  return fix_data
41
45
 
42
46
 
@@ -60,7 +64,7 @@ def fix(strcheck, opts, fix_data=None):
60
64
  strcheck.args['non_interactive'],
61
65
  set_none='All'
62
66
  )
63
- input_line.add_option_all()
67
+ input_line.add_option_none()
64
68
  input_line.add_option_list('occup', ['occupancy'])
65
69
  input_line.add_option_list('altids', altlocs, case='upper')
66
70
  input_line.add_option_list(
@@ -78,34 +82,35 @@ def fix(strcheck, opts, fix_data=None):
78
82
  if input_option == 'error':
79
83
  return cts.MSGS['UNKNOWN_SELECTION'], select_altloc
80
84
 
81
- if input_option != 'all':
82
- print(f"Selecting location {select_altloc}")
83
- if input_option in ('occup', 'altids'):
84
- select_altloc = select_altloc.upper()
85
- to_fix = {
86
- res: {
87
- 'ats': value,
88
- 'select' : select_altloc
89
- } for res, value in fix_data['alt_loc_res'].items()
90
- }
91
-
92
- elif input_option == 'resnum':
93
- to_fix = {}
94
- selected_rnums = {}
95
- for rsel in select_altloc.split(','):
96
- rnum, alt = rsel.split(':')
97
- selected_rnums[rnum] = alt
98
- to_fix = {
99
- res: {
100
- 'ats': value,
101
- 'select': selected_rnums[mu.residue_num(res)]
102
- }
103
- for res, value in fix_data['alt_loc_res'].items()
104
- if mu.residue_num(res) in selected_rnums
105
- }
106
- for res in to_fix:
107
- strcheck.strucm.select_altloc_residue(res, to_fix[res])
108
-
109
85
  strcheck.summary['altloc']['selected'] = select_altloc
110
-
86
+ if input_option == 'none':
87
+ print(cts.MSGS['ALTLOC_NO_SELECTION'])
88
+ return False
89
+
90
+ print(f"Selecting location {select_altloc}")
91
+ to_fix = {}
92
+ if input_option in ('occup', 'altids'):
93
+ select_altloc = select_altloc.upper()
94
+ to_fix = {
95
+ res: {
96
+ 'ats': value,
97
+ 'select' : select_altloc
98
+ } for res, value in fix_data['alt_loc_res'].items()
99
+ }
100
+ elif input_option == 'resnum':
101
+ to_fix = {}
102
+ selected_rnums = {}
103
+ for rsel in select_altloc.split(','):
104
+ rnum, alt = rsel.split(':')
105
+ selected_rnums[rnum] = alt
106
+ to_fix = {
107
+ res: {
108
+ 'ats': value,
109
+ 'select': selected_rnums[mu.residue_num(res)]
110
+ }
111
+ for res, value in fix_data['alt_loc_res'].items()
112
+ if mu.residue_num(res) in selected_rnums
113
+ }
114
+ for res in to_fix:
115
+ strcheck.strucm.select_altloc_residue(res, to_fix[res])
111
116
  return False
@@ -86,7 +86,12 @@ def check(strcheck):
86
86
  print(cts.MSGS['MODIF_RESIDUES'])
87
87
  strcheck.summary['backbone']['mod_residues'] = []
88
88
  for brk in strcheck.strucm.st_data.modified_residue_list:
89
- print(f" {mu.residue_id(brk):10}")
89
+ if strcheck.strucm.st_data.no_network:
90
+ print(f" {mu.residue_id(brk):10}")
91
+ else:
92
+ print(
93
+ f" {mu.residue_id(brk):10} ({mu.fetch_residue_name_by_id(brk.get_resname())})"
94
+ )
90
95
  strcheck.summary['backbone']['mod_residues'].append(mu.residue_id(brk))
91
96
  # Provisional only missing atoms can be fixed
92
97
  fix_data['modified_residue_list'] = True
@@ -49,21 +49,19 @@ def check(strcheck):
49
49
 
50
50
 
51
51
  def fix(strcheck, opts, fix_data=None):
52
+ rename_chains = ''
53
+ rebuild_chains = False
54
+ renumber_chains = False
52
55
  if isinstance(opts, str):
53
56
  select_chains = opts
54
- rename_chains = ''
55
57
  else:
56
58
  select_chains = opts['select']
57
59
  if 'rename' in opts:
58
60
  rename_chains = opts['rename']
59
- else:
60
- rename_chains = ''
61
61
  if 'renumber' in opts:
62
62
  renumber_chains = opts['renumber']
63
63
  if 'rebuild' in opts:
64
64
  rebuild_chains = opts['rebuild']
65
- else:
66
- rebuild_chains = False
67
65
 
68
66
  if strcheck.strucm.chains_data.has_chains_to_rename:
69
67
  input_line = ParamInput(
@@ -21,6 +21,16 @@ def check(strcheck):
21
21
  'canonical': can_seq,
22
22
  'structure': pdb_seq
23
23
  }
24
+ mismatches = strcheck.strucm.sequence_data.compare_sequences(strcheck.strucm)
25
+ if mismatches:
26
+ print(f"Found {len(mismatches)} mismatch(es)")
27
+ for chain_id, mismatch in mismatches.items():
28
+ print(
29
+ f"Chain {chain_id}\n"
30
+ f"{mismatch['canonical']}\n"
31
+ f"{mismatch['structure']}"
32
+ )
33
+ strcheck.summary['sequence_mismatches'] = mismatches
24
34
  return fasta
25
35
 
26
36
 
@@ -2,14 +2,13 @@
2
2
  Global constants for structure_checking module
3
3
  """
4
4
  import argparse
5
- import os
6
5
  from os.path import dirname
7
6
  from os.path import join as opj
8
7
 
9
8
 
10
9
  from biobb_structure_checking.pdbio.param_input import Dialog
11
10
 
12
- VERSION = '3.16.1'
11
+ VERSION = '3.16.3'
13
12
 
14
13
  # Default locations and settings
15
14
  DATA_DIR_DEFAULT_PATH = 'dat'
@@ -23,7 +22,6 @@ ATOM_LIMIT = 1000000
23
22
  TIME_LIMIT = 3600
24
23
 
25
24
  ALT_SERVERS = {
26
- 'mmb': 'https://mmb.irbbarcelona.org/api/pdb',
27
25
  'bsc': 'http://mdb-login.bsc.es/api/pdb'
28
26
  }
29
27
 
@@ -113,8 +111,8 @@ CMD_LINE.add_argument(
113
111
  '--file_format',
114
112
  dest='file_format',
115
113
  help='Format for retrieving remote structures '
116
- '(mmCif(=cif, default)|pdb|xml)',
117
- choices=['mmCif', 'pdb', 'cif', 'xml']
114
+ '(mmCif(=cif, default)|pdb)',
115
+ choices=['mmCif', 'pdb', 'cif']
118
116
  )
119
117
 
120
118
  CMD_LINE.add_argument(
@@ -412,7 +410,8 @@ DIALOGS.add_option('metals', '--remove', 'remove', 'Remove Metal ions')
412
410
 
413
411
  DIALOGS.add_entry('water', 'Checks and optionally removes water molecules')
414
412
  DIALOGS.add_option('water', '--remove', 'remove', 'Remove All Water molecules')
415
- DIALOGS.add_option('water', '--keep_min_contacts', 'keep', 'Remove All Water molecules with less contacts')
413
+ DIALOGS.add_option('water', '--keep_min_contacts', 'keep',
414
+ 'Remove All Water molecules with less contacts')
416
415
 
417
416
  DIALOGS.add_entry(
418
417
  'ligands',
@@ -652,6 +651,7 @@ MSGS = {
652
651
  'use --limit to adjust',
653
652
  'TIME_LIMIT': 'Execution time limit ({}s) exceeded, aborting, use --time_limit to adjust',
654
653
  'CA_ONLY_STRUCTURE': 'CA-Only structure, skipping',
654
+ 'NO_NETWORK': 'Network disabled, unable to download {}, and no cached file available',
655
655
  # command line
656
656
  'ERROR_OPEN_FILE': 'Error when opening file',
657
657
  'COMMAND_LIST_COMPLETED': 'Command list completed',
@@ -683,6 +683,8 @@ MSGS = {
683
683
  # altloc
684
684
  'ALTLOC_FOUND': 'Detected {} residues with alternative location labels',
685
685
  'NO_ALTLOC_FOUND': 'Detected no residues with alternative location labels',
686
+ 'ALTLOC_NO_A': 'Possible microheterogeneity: No A altloc found',
687
+ 'ALTLOC_NO_SELECTION': 'No selection made, keeping all alternative locations',
686
688
  # metals
687
689
  'METALS_FOUND': 'Found {} Metal ions',
688
690
  'NO_METALS_FOUND': 'No metal ions found',
@@ -783,7 +785,7 @@ def help(command=None):
783
785
  DATA_DIR_DEFAULT_PATH,
784
786
  COMMANDS_HELP_PATH
785
787
  )
786
- with open(help_path) as help_file:
788
+ with open(help_path, 'r', encoding='utf-8') as help_file:
787
789
  print(help_file.read())
788
790
  else:
789
791
  DIALOGS.get_parameter(command, '', print_help=True)
@@ -24,6 +24,7 @@ chains [--select chain_ids | molecule_type] [--rename (auto|new label)]
24
24
  --rename allow to fix unlabelled chains
25
25
  --renumber allow to reorganize residues and chains by moving or renunbering fragments. Auto generate consecutive residue numbers.
26
26
  --rem_inscodes removes insertion codes when renumbering chains
27
+ --rebuild rebuild chains from coordinates
27
28
  inscodes
28
29
  Detects residues with insertion codes.
29
30
  --renumber fix insertion codes by renumbering chain residues
@@ -38,7 +39,6 @@ getss Detect SS Bonds
38
39
  water [--remove Yes|No] [--keep_min_contacts KEEP]
39
40
  --remove Remove Water molecules
40
41
  --keep_min_contacts KEEP - Remove All Water molecules with less then KEEP contacts (0-4)
41
-
42
42
  rem_hydrogen [--remove Yes|No]
43
43
  Remove Hydrogen atoms from structure
44
44
  mutateside [--mut mutation_list|file:mutations_file] [--no_check_clashes]
@@ -83,5 +83,5 @@ backbone [--fix_atoms All|None|Residue List]
83
83
  3. Structure Warnings (no fix)
84
84
 
85
85
  cistransbck Analyzes cis-trans dihedrals on backbone atoms
86
- clashes Steric clashes (Severe, Apolar, Polar Donors, Polar Acceptors,
86
+ clashes Steric clashes (Severe/Covalent, Apolar, Polar Donors, Polar Acceptors,
87
87
  Ionic Positive, Ionic Negative)
@@ -14,7 +14,10 @@ class ModelsData():
14
14
  def stats(self, prefix='') -> None:
15
15
  """ Print stats """
16
16
  if self.nmodels > 1:
17
- return f"{prefix} Num. models: {self.nmodels} (type: {mu.MODEL_TYPE_LABELS[self.models_type['type']]}, {self.models_type['rmsd']:8.3f} A)"
17
+ return \
18
+ f"{prefix} Num. models: {self.nmodels} " \
19
+ f"(type: {mu.MODEL_TYPE_LABELS[self.models_type['type']]}, " \
20
+ f"{self.models_type['rmsd']:8.3f} A)"
18
21
  return f"{prefix} Num. models: {self.nmodels}"
19
22
 
20
23
  def select(self, keep_model: str) -> None:
@@ -54,10 +57,10 @@ class ModelsData():
54
57
  fix_atoms = [
55
58
  at
56
59
  for at in self.st[0].get_atoms()
57
- if at.id == 'CA' or at.id == 'P'
60
+ if at.id in ('CA', 'P')
58
61
  ]
59
62
  if not fix_atoms:
60
- print("No CA atoms found, skipping superimposition")
63
+ print("No CA or P atoms found, skipping superimposition")
61
64
  return False
62
65
  for mod in self.st.get_models():
63
66
  if mod.id == 0:
@@ -65,7 +68,7 @@ class ModelsData():
65
68
  mov_atoms = [
66
69
  at
67
70
  for at in self.st[mod.id].get_atoms()
68
- if at.id == 'CA' or at.id == 'P'
71
+ if at.id in ('CA', 'P')
69
72
  ]
70
73
  spimp.set_atoms(fix_atoms, mov_atoms)
71
74
  spimp.apply(self.st[mod.id].get_atoms())
@@ -1,6 +1,4 @@
1
1
  ''' Class to manage Residue Sets to chain building'''
2
- import re
3
- import sys
4
2
  import biobb_structure_checking.modelling.utils as mu
5
3
 
6
4
 
@@ -48,8 +46,7 @@ class ResidueSetList():
48
46
  i += 1
49
47
  if i == self.n:
50
48
  return -1
51
- else:
52
- return i
49
+ return i
53
50
 
54
51
  def _append_rset(self, item):
55
52
  self.sets.append(item)
@@ -73,14 +70,15 @@ class ResidueSet():
73
70
  self.items = set()
74
71
  self.type = ''
75
72
  self.id = ''
73
+ self.name = ''
76
74
 
77
- def set_meta(self, id):
75
+ def set_meta(self, mol_id):
78
76
  """ Add molecule type to residue set"""
79
77
  if self._is_protein():
80
78
  self.type = 'prot'
81
79
  else:
82
80
  self.type = 'na'
83
- self.id = id
81
+ self.id = mol_id
84
82
 
85
83
  def _is_protein(self):
86
84
  chain_type = mu.guess_chain_type_list(self._get_residues())['type']
@@ -134,4 +132,4 @@ class ResidueSet():
134
132
  def __str__(self):
135
133
  # residue_list = self._get_residues()
136
134
  return f"{self.id} ({mu.residue_id(self.inir)}-{mu.residue_id(self.finr)}) ({self.type}): {self.get_sequence()}"
137
-
135
+
@@ -1,5 +1,10 @@
1
1
  """ Module to manage sequence information for structures """
2
2
 
3
+ import sys
4
+ import os
5
+ import gzip
6
+ # from typing import List, Dict
7
+ from urllib.request import urlretrieve, urlcleanup
3
8
  from biobb_structure_checking.constants import FASTA_DOWNLOAD_PREFIX
4
9
  import biobb_structure_checking.modelling.utils as mu
5
10
  from Bio.SeqFeature import SeqFeature, FeatureLocation
@@ -8,11 +13,6 @@ from Bio.SeqUtils import IUPACData
8
13
  from Bio.Seq import Seq, MutableSeq
9
14
  from Bio.PDB.Polypeptide import PPBuilder
10
15
  from Bio import SeqIO
11
- import sys
12
- import os
13
- import gzip
14
- # from typing import List, Dict
15
- from urllib.request import urlretrieve, urlcleanup
16
16
 
17
17
  # pairwise2 to be deprecated, replaced by PairwiseAligner
18
18
  # But Alignment structure has changed from v1.79
@@ -341,7 +341,8 @@ class SequenceData():
341
341
  for ch_id, ch_data in self.data[mod.id].items():
342
342
  # print(f"{ch_id=} {ch_data=}")
343
343
  # print(f"{self.has_canonical=} {mod.id=}")
344
- if ch_id not in self.has_canonical.get(mod.id, []) or not self.has_canonical.get(mod.id, dict()).get(ch_id, []):
344
+ if ch_id not in self.has_canonical[mod.id] or\
345
+ not self.has_canonical[mod.id].get(ch_id, []):
345
346
  continue
346
347
  frgs = ch_data['pdb']['frgs']
347
348
  ch_data['pdb']['match_numbering'] = True
@@ -573,7 +574,43 @@ class SequenceData():
573
574
  matches.append((mod_id, ch_id, score))
574
575
  return matches
575
576
 
577
+ def compare_sequences(self, strucm):
578
+ """ SequenceData.compare_sequences
579
+ Compares canonical and structure sequences
580
+
581
+ Args:
582
+ strucm (StructureManager) : Object containing the loaded structure
583
+ """
584
+ summary = {}
585
+ for mod in strucm.st:
586
+ for ch_id in self.data[mod.id]:
587
+ mismatches = []
588
+ can_seq_mis = ''
589
+ pdb_seq_mis = ''
576
590
 
591
+ if not self.has_canonical[mod.id][ch_id]:
592
+ continue
593
+
594
+ can_seq = self.get_canonical().split("\n")[1]
595
+ pdb_seq = self.get_pdbseq().split("\n")[1]
596
+
597
+ for i in range(len(can_seq)):
598
+ if can_seq[i] != pdb_seq[i] and pdb_seq[i] != '-':
599
+ mismatches.append(i)
600
+ can_seq_mis += can_seq[i]
601
+ pdb_seq_mis += pdb_seq[i]
602
+ continue
603
+ can_seq_mis += '-'
604
+ pdb_seq_mis += '-'
605
+
606
+ if mismatches:
607
+ summary[f"{ch_id}/{mod.id}"] = {
608
+ 'mismatches': mismatches,
609
+ 'canonical': can_seq_mis,
610
+ 'structure': pdb_seq_mis
611
+ }
612
+ return summary
613
+
577
614
  def _get_pack_str_seqs(strucm):
578
615
  strucm.revert_can_resnames(canonical=True)
579
616
  seqs = {}
@@ -589,3 +626,4 @@ def _get_pack_str_seqs(strucm):
589
626
  )
590
627
  strucm.revert_can_resnames(canonical=False)
591
628
  return seqs
629
+
@@ -1,4 +1,5 @@
1
1
  ''' Class to manage internal Structure data'''
2
+ import sys
2
3
  import biobb_structure_checking.modelling.utils as mu
3
4
 
4
5
 
@@ -159,15 +160,17 @@ class StructureData():
159
160
  for org, fin in map_fields.items():
160
161
  if org in self.headers:
161
162
  self.meta[fin] = self.headers[org]
162
- if 'resolution' not in self.headers or\
163
- not self.headers['resolution']:
164
- self.meta['resolution'] = 'N.A.'
165
- else:
166
- self.meta['resolution'] = self.headers['resolution']
167
163
  if self.biounit:
168
164
  self.meta['biounit'] = self.biounit
169
- if self.meta['entry_id'] == 'XXXX': # Recovering PDB id for Assemblies
165
+ if self.meta['entry_id'] in ('XXXX', 'User'): # Recovering PDB id for Assemblies
170
166
  self.meta['entry_id'] = self.st.id
167
+ # Missing fields from AF entries
168
+ if 'title' not in self.meta:
169
+ self.meta['title'] = 'N.A.'
170
+ if 'method' not in self.meta:
171
+ self.meta['method'] = 'N.A.'
172
+
173
+
171
174
 
172
175
  def print_headers(self) -> None:
173
176
  """
@@ -180,7 +183,7 @@ class StructureData():
180
183
  else:
181
184
  asstxt = ""
182
185
  print(
183
- f" PDB id: {self.meta['entry_id']} {asstxt}\n"
186
+ f" Entry id: {self.meta['entry_id']} {asstxt}\n"
184
187
  f" Title: {self.meta['title']}\n"
185
188
  f" Experimental method: {self.meta['method']}"
186
189
  )
@@ -212,26 +215,34 @@ class StructureData():
212
215
  else:
213
216
  self.hetatm[mu.ORGANIC].append(res)
214
217
 
218
+ def _print_het_group_stats(self, res_list):
219
+ for res in res_list:
220
+ if res.get_parent().get_parent().id > 0:
221
+ continue
222
+ res_label = ''
223
+ if self.no_network:
224
+ print(mu.residue_id(res))
225
+ else:
226
+ res_label = mu.fetch_residue_name_by_id(res.get_resname())
227
+ if len(self.st) > 1:
228
+ res_id = f"{mu.residue_id(res, False)}/*"
229
+ else:
230
+ res_id = mu.residue_id(res)
231
+ print(f"{res_id} ({res_label})")
232
+
233
+
215
234
  def print_hetatm_stats(self):
216
235
  '''Print statistics on HETATM'''
236
+
217
237
  if self.hetatm[mu.MODRES]:
218
238
  print('Modified residues found')
219
- for res in self.hetatm[mu.MODRES]:
220
- print(mu.residue_id(res))
239
+ self._print_het_group_stats(self.hetatm[mu.MODRES])
221
240
  if self.hetatm[mu.METAL]:
222
241
  print('Metal/Ion residues found')
223
- for res in self.hetatm[mu.METAL]:
224
- if self.no_network:
225
- print(mu.residue_id(res))
226
- else:
227
- print(f"{mu.residue_id(res)} ({mu.fetch_residue_name_by_id(res.get_resname())})")
242
+ self._print_het_group_stats(self.hetatm[mu.METAL])
228
243
  if self.hetatm[mu.ORGANIC]:
229
244
  print('Small mol ligands found')
230
- for res in self.hetatm[mu.ORGANIC]:
231
- if self.no_network:
232
- print(mu.residue_id(res))
233
- else:
234
- print(f"{mu.residue_id(res)} ({mu.fetch_residue_name_by_id(res.get_resname())})")
245
+ self._print_het_group_stats(self.hetatm[mu.ORGANIC])
235
246
 
236
247
  def _check_ca_only(self):
237
248
  ca_only = True