biobb-io 5.0.0__tar.gz → 5.1.0__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 (32) hide show
  1. {biobb_io-5.0.0 → biobb_io-5.1.0}/PKG-INFO +12 -12
  2. {biobb_io-5.0.0 → biobb_io-5.1.0}/README.md +10 -10
  3. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io/__init__.py +1 -1
  4. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io/api/__init__.py +2 -2
  5. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io/api/alphafold.py +2 -0
  6. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io/api/api_binding_site.py +2 -0
  7. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io/api/canonical_fasta.py +2 -0
  8. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io/api/common.py +54 -48
  9. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io/api/ideal_sdf.py +2 -0
  10. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io/api/ligand.py +5 -3
  11. biobb_io-5.1.0/biobb_io/api/mddb.py +196 -0
  12. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io/api/memprotmd_sim.py +2 -0
  13. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io/api/memprotmd_sim_list.py +2 -0
  14. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io/api/memprotmd_sim_search.py +2 -0
  15. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io/api/mmcif.py +2 -0
  16. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io/api/pdb.py +2 -0
  17. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io/api/pdb_cluster_zip.py +6 -1
  18. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io/api/pdb_variants.py +4 -6
  19. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io/api/structure_info.py +2 -0
  20. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io.egg-info/PKG-INFO +13 -13
  21. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io.egg-info/SOURCES.txt +1 -1
  22. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io.egg-info/entry_points.txt +1 -1
  23. biobb_io-5.1.0/biobb_io.egg-info/requires.txt +1 -0
  24. {biobb_io-5.0.0 → biobb_io-5.1.0}/setup.py +3 -3
  25. biobb_io-5.0.0/biobb_io/api/drugbank.py +0 -151
  26. biobb_io-5.0.0/biobb_io.egg-info/requires.txt +0 -1
  27. {biobb_io-5.0.0 → biobb_io-5.1.0}/LICENSE +0 -0
  28. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io/py.typed +0 -0
  29. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io/test/__init__.py +0 -0
  30. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io.egg-info/dependency_links.txt +0 -0
  31. {biobb_io-5.0.0 → biobb_io-5.1.0}/biobb_io.egg-info/top_level.txt +0 -0
  32. {biobb_io-5.0.0 → biobb_io-5.1.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: biobb_io
3
- Version: 5.0.0
3
+ Version: 5.1.0
4
4
  Summary: Biobb_io is the Biobb module collection to fetch data to be consumed by the rest of the Biobb building blocks.
5
5
  Home-page: https://github.com/bioexcel/biobb_io
6
6
  Author: Biobb developers
@@ -17,14 +17,14 @@ Classifier: Operating System :: Unix
17
17
  Requires-Python: >=3.9
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
- Requires-Dist: biobb_common==5.0.0
20
+ Requires-Dist: biobb_common==5.1.0
21
21
 
22
22
  [![](https://img.shields.io/github/v/tag/bioexcel/biobb_io?label=Version)](https://GitHub.com/bioexcel/biobb_io/tags/)
23
23
  [![](https://img.shields.io/pypi/v/biobb-io.svg?label=Pypi)](https://pypi.python.org/pypi/biobb-io/)
24
24
  [![](https://img.shields.io/conda/vn/bioconda/biobb_io?label=Conda)](https://anaconda.org/bioconda/biobb_io)
25
25
  [![](https://img.shields.io/conda/dn/bioconda/biobb_io?label=Conda%20Downloads)](https://anaconda.org/bioconda/biobb_io)
26
26
  [![](https://img.shields.io/badge/Docker-Quay.io-blue)](https://quay.io/repository/biocontainers/biobb_io?tab=tags)
27
- [![](https://img.shields.io/badge/Singularity-GalaxyProject-blue)](https://depot.galaxyproject.org/singularity/biobb_io:5.0.0--pyhdfd78af_0)
27
+ [![](https://img.shields.io/badge/Singularity-GalaxyProject-blue)](https://depot.galaxyproject.org/singularity/biobb_io:5.1.0--pyhdfd78af_0)
28
28
 
29
29
  [![](https://img.shields.io/badge/OS-Unix%20%7C%20MacOS-blue)](https://github.com/bioexcel/biobb_io)
30
30
  [![](https://img.shields.io/pypi/pyversions/biobb-io.svg?label=Python%20Versions)](https://pypi.org/project/biobb-io/)
@@ -62,7 +62,7 @@ The latest documentation of this package can be found in our readthedocs site:
62
62
  [latest API documentation](http://biobb-io.readthedocs.io/en/latest/).
63
63
 
64
64
  ### Version
65
- v5.0.0 2024.2
65
+ v5.1.0 2025.1
66
66
 
67
67
  ### Installation
68
68
  Using PIP:
@@ -71,7 +71,7 @@ Using PIP:
71
71
 
72
72
  * Installation:
73
73
 
74
- pip install "biobb_io==5.0.0"
74
+ pip install "biobb_io==5.1.0"
75
75
 
76
76
  * Usage: [Python API documentation](https://biobb-io.readthedocs.io/en/latest/modules.html)
77
77
 
@@ -79,7 +79,7 @@ Using ANACONDA:
79
79
  * Installation:
80
80
 
81
81
 
82
- conda install -c bioconda "biobb_io==5.0.0"
82
+ conda install -c bioconda "biobb_io==5.1.0"
83
83
 
84
84
 
85
85
  * Usage: With conda installation BioBBs can be used with the [Python API documentation](https://biobb-io.readthedocs.io/en/latest/modules.html) and the [Command Line documentation](https://biobb-io.readthedocs.io/en/latest/command_line.html)
@@ -88,12 +88,12 @@ Using DOCKER:
88
88
  * Installation:
89
89
 
90
90
 
91
- docker pull quay.io/biocontainers/biobb_io:5.0.0--pyhdfd78af_0
91
+ docker pull quay.io/biocontainers/biobb_io:5.1.0--pyhdfd78af_0
92
92
 
93
93
  * Usage:
94
94
 
95
95
 
96
- docker run quay.io/biocontainers/biobb_io:5.0.0--pyhdfd78af_0 <command>
96
+ docker run quay.io/biocontainers/biobb_io:5.1.0--pyhdfd78af_0 <command>
97
97
 
98
98
 
99
99
  The command list and specification can be found at the [Command Line documentation](https://biobb-io.readthedocs.io/en/latest/command_line.html).
@@ -105,7 +105,7 @@ Using SINGULARITY:
105
105
  * Installation:
106
106
 
107
107
 
108
- singularity pull --name biobb_io.sif https://depot.galaxyproject.org/singularity/biobb_io:5.0.0--pyhdfd78af_0
108
+ singularity pull --name biobb_io.sif https://depot.galaxyproject.org/singularity/biobb_io:5.1.0--pyhdfd78af_0
109
109
 
110
110
 
111
111
  * Usage:
@@ -118,10 +118,10 @@ Using SINGULARITY:
118
118
  The command list and specification can be found at the [Command Line documentation](https://biobb-io.readthedocs.io/en/latest/command_line.html).
119
119
 
120
120
  ### Copyright & Licensing
121
- This software has been developed in the [MMB group](http://mmb.irbbarcelona.org) at the [BSC](http://www.bsc.es/) & [IRB](https://www.irbbarcelona.org/) for the [European BioExcel](http://bioexcel.eu/), funded by the European Commission (EU H2020 [823830](http://cordis.europa.eu/projects/823830), EU H2020 [675728](http://cordis.europa.eu/projects/675728)).
121
+ This software has been developed in the [MMB group](http://mmb.irbbarcelona.org) at the [BSC](http://www.bsc.es/) & [IRB](https://www.irbbarcelona.org/) for the [European BioExcel](http://bioexcel.eu/), funded by the European Commission (EU Horizon Europe [101093290](https://cordis.europa.eu/project/id/101093290), EU H2020 [823830](http://cordis.europa.eu/projects/823830), EU H2020 [675728](http://cordis.europa.eu/projects/675728)).
122
122
 
123
- * (c) 2015-2024 [Barcelona Supercomputing Center](https://www.bsc.es/)
124
- * (c) 2015-2024 [Institute for Research in Biomedicine](https://www.irbbarcelona.org/)
123
+ * (c) 2015-2025 [Barcelona Supercomputing Center](https://www.bsc.es/)
124
+ * (c) 2015-2025 [Institute for Research in Biomedicine](https://www.irbbarcelona.org/)
125
125
 
126
126
  Licensed under the
127
127
  [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0), see the file LICENSE for details.
@@ -3,7 +3,7 @@
3
3
  [![](https://img.shields.io/conda/vn/bioconda/biobb_io?label=Conda)](https://anaconda.org/bioconda/biobb_io)
4
4
  [![](https://img.shields.io/conda/dn/bioconda/biobb_io?label=Conda%20Downloads)](https://anaconda.org/bioconda/biobb_io)
5
5
  [![](https://img.shields.io/badge/Docker-Quay.io-blue)](https://quay.io/repository/biocontainers/biobb_io?tab=tags)
6
- [![](https://img.shields.io/badge/Singularity-GalaxyProject-blue)](https://depot.galaxyproject.org/singularity/biobb_io:5.0.0--pyhdfd78af_0)
6
+ [![](https://img.shields.io/badge/Singularity-GalaxyProject-blue)](https://depot.galaxyproject.org/singularity/biobb_io:5.1.0--pyhdfd78af_0)
7
7
 
8
8
  [![](https://img.shields.io/badge/OS-Unix%20%7C%20MacOS-blue)](https://github.com/bioexcel/biobb_io)
9
9
  [![](https://img.shields.io/pypi/pyversions/biobb-io.svg?label=Python%20Versions)](https://pypi.org/project/biobb-io/)
@@ -41,7 +41,7 @@ The latest documentation of this package can be found in our readthedocs site:
41
41
  [latest API documentation](http://biobb-io.readthedocs.io/en/latest/).
42
42
 
43
43
  ### Version
44
- v5.0.0 2024.2
44
+ v5.1.0 2025.1
45
45
 
46
46
  ### Installation
47
47
  Using PIP:
@@ -50,7 +50,7 @@ Using PIP:
50
50
 
51
51
  * Installation:
52
52
 
53
- pip install "biobb_io==5.0.0"
53
+ pip install "biobb_io==5.1.0"
54
54
 
55
55
  * Usage: [Python API documentation](https://biobb-io.readthedocs.io/en/latest/modules.html)
56
56
 
@@ -58,7 +58,7 @@ Using ANACONDA:
58
58
  * Installation:
59
59
 
60
60
 
61
- conda install -c bioconda "biobb_io==5.0.0"
61
+ conda install -c bioconda "biobb_io==5.1.0"
62
62
 
63
63
 
64
64
  * Usage: With conda installation BioBBs can be used with the [Python API documentation](https://biobb-io.readthedocs.io/en/latest/modules.html) and the [Command Line documentation](https://biobb-io.readthedocs.io/en/latest/command_line.html)
@@ -67,12 +67,12 @@ Using DOCKER:
67
67
  * Installation:
68
68
 
69
69
 
70
- docker pull quay.io/biocontainers/biobb_io:5.0.0--pyhdfd78af_0
70
+ docker pull quay.io/biocontainers/biobb_io:5.1.0--pyhdfd78af_0
71
71
 
72
72
  * Usage:
73
73
 
74
74
 
75
- docker run quay.io/biocontainers/biobb_io:5.0.0--pyhdfd78af_0 <command>
75
+ docker run quay.io/biocontainers/biobb_io:5.1.0--pyhdfd78af_0 <command>
76
76
 
77
77
 
78
78
  The command list and specification can be found at the [Command Line documentation](https://biobb-io.readthedocs.io/en/latest/command_line.html).
@@ -84,7 +84,7 @@ Using SINGULARITY:
84
84
  * Installation:
85
85
 
86
86
 
87
- singularity pull --name biobb_io.sif https://depot.galaxyproject.org/singularity/biobb_io:5.0.0--pyhdfd78af_0
87
+ singularity pull --name biobb_io.sif https://depot.galaxyproject.org/singularity/biobb_io:5.1.0--pyhdfd78af_0
88
88
 
89
89
 
90
90
  * Usage:
@@ -97,10 +97,10 @@ Using SINGULARITY:
97
97
  The command list and specification can be found at the [Command Line documentation](https://biobb-io.readthedocs.io/en/latest/command_line.html).
98
98
 
99
99
  ### Copyright & Licensing
100
- This software has been developed in the [MMB group](http://mmb.irbbarcelona.org) at the [BSC](http://www.bsc.es/) & [IRB](https://www.irbbarcelona.org/) for the [European BioExcel](http://bioexcel.eu/), funded by the European Commission (EU H2020 [823830](http://cordis.europa.eu/projects/823830), EU H2020 [675728](http://cordis.europa.eu/projects/675728)).
100
+ This software has been developed in the [MMB group](http://mmb.irbbarcelona.org) at the [BSC](http://www.bsc.es/) & [IRB](https://www.irbbarcelona.org/) for the [European BioExcel](http://bioexcel.eu/), funded by the European Commission (EU Horizon Europe [101093290](https://cordis.europa.eu/project/id/101093290), EU H2020 [823830](http://cordis.europa.eu/projects/823830), EU H2020 [675728](http://cordis.europa.eu/projects/675728)).
101
101
 
102
- * (c) 2015-2024 [Barcelona Supercomputing Center](https://www.bsc.es/)
103
- * (c) 2015-2024 [Institute for Research in Biomedicine](https://www.irbbarcelona.org/)
102
+ * (c) 2015-2025 [Barcelona Supercomputing Center](https://www.bsc.es/)
103
+ * (c) 2015-2025 [Institute for Research in Biomedicine](https://www.irbbarcelona.org/)
104
104
 
105
105
  Licensed under the
106
106
  [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0), see the file LICENSE for details.
@@ -2,4 +2,4 @@ from . import api
2
2
 
3
3
  name = "biobb_io"
4
4
  __all__ = ["api"]
5
- __version__ = "5.0.0"
5
+ __version__ = "5.1.0"
@@ -2,7 +2,6 @@ from . import (
2
2
  alphafold,
3
3
  api_binding_site,
4
4
  canonical_fasta,
5
- drugbank,
6
5
  ideal_sdf,
7
6
  ligand,
8
7
  memprotmd_sim,
@@ -13,11 +12,11 @@ from . import (
13
12
  pdb_cluster_zip,
14
13
  pdb_variants,
15
14
  structure_info,
15
+ mddb
16
16
  )
17
17
 
18
18
  name = "api"
19
19
  __all__ = [
20
- "drugbank",
21
20
  "ligand",
22
21
  "pdb",
23
22
  "alphafold",
@@ -31,4 +30,5 @@ __all__ = [
31
30
  "mmcif",
32
31
  "ideal_sdf",
33
32
  "structure_info",
33
+ "mddb"
34
34
  ]
@@ -118,6 +118,8 @@ def alphafold(output_pdb_path: str, properties: Optional[dict] = None, **kwargs)
118
118
  output_pdb_path=output_pdb_path, properties=properties, **kwargs
119
119
  ).launch()
120
120
 
121
+ alphafold.__doc__ = AlphaFold.__doc__
122
+
121
123
 
122
124
  def main():
123
125
  """Command line execution of this building block. Please check the command line documentation."""
@@ -130,6 +130,8 @@ def api_binding_site(
130
130
  output_json_path=output_json_path, properties=properties, **kwargs
131
131
  ).launch()
132
132
 
133
+ api_binding_site.__doc__ = ApiBindingSite.__doc__
134
+
133
135
 
134
136
  def main():
135
137
  """Command line execution of this building block. Please check the command line documentation."""
@@ -120,6 +120,8 @@ def canonical_fasta(
120
120
  output_fasta_path=output_fasta_path, properties=properties, **kwargs
121
121
  ).launch()
122
122
 
123
+ canonical_fasta.__doc__ = CanonicalFasta.__doc__
124
+
123
125
 
124
126
  def main():
125
127
  """Command line execution of this building block. Please check the command line documentation."""
@@ -4,6 +4,7 @@ import json
4
4
  import os
5
5
  import re
6
6
  import urllib.request
7
+ import urllib.parse
7
8
  from pathlib import Path, PurePath
8
9
 
9
10
  import requests
@@ -20,14 +21,12 @@ def check_output_path(path, argument, optional, out_log, classname) -> str:
20
21
  file_extension = PurePath(path).suffix
21
22
  if not is_valid_file(file_extension[1:], argument):
22
23
  fu.log(
23
- classname
24
- + ": Format %s in %s file is not compatible"
24
+ classname + ": Format %s in %s file is not compatible"
25
25
  % (file_extension[1:], argument),
26
26
  out_log,
27
27
  )
28
28
  raise SystemExit(
29
- classname
30
- + ": Format %s in %s file is not compatible"
29
+ classname + ": Format %s in %s file is not compatible"
31
30
  % (file_extension[1:], argument)
32
31
  )
33
32
  return path
@@ -45,6 +44,8 @@ def is_valid_file(ext, argument):
45
44
  "output_json_path": ["json"],
46
45
  "output_fasta_path": ["fasta"],
47
46
  "output_mmcif_path": ["mmcif", "cif"],
47
+ "output_top_path": ["pdb"],
48
+ "output_trj_path": ["mdcrd", "trr", "xtc"]
48
49
  }
49
50
  return ext in formats[argument]
50
51
 
@@ -84,6 +85,42 @@ def download_af(uniprot_code, out_log=None, global_log=None, classname=None):
84
85
  return r.content.decode("utf-8")
85
86
 
86
87
 
88
+ def download_mddb_top(project_id, node_id, selection, out_log=None, global_log=None, classname=None):
89
+ """
90
+ Returns:
91
+ String: Content of the pdb file.
92
+ """
93
+
94
+ url = "https://" + node_id + ".mddbr.eu/api/rest/v1/projects/" + project_id + "/structure?selection=" + urllib.parse.quote(str(selection))
95
+
96
+ fu.log("Downloading %s topology from: %s" % (project_id, url), out_log, global_log)
97
+
98
+ r = requests.get(url)
99
+ if r.status_code == 404:
100
+ fu.log(classname + ": Incorrect url, check project_id, node_id and selection: %s" % (url), out_log)
101
+ raise SystemExit(classname + ": Incorrect url, check project_id, node_id and selection: %s" % (url))
102
+
103
+ return r.content.decode("utf-8")
104
+
105
+
106
+ def download_mddb_trj(project_id, node_id, trj_format, frames, selection, out_log=None, global_log=None, classname=None):
107
+ """
108
+ Returns:
109
+ String: Content of the trajectory file.
110
+ """
111
+
112
+ url = "https://" + node_id + ".mddbr.eu/api/rest/v1/projects/" + project_id + "/trajectory?format=" + trj_format + "&frames=" + frames + "&selection=" + urllib.parse.quote(str(selection))
113
+
114
+ fu.log("Downloading %s trajectory from: %s" % (project_id, url), out_log, global_log)
115
+
116
+ r = requests.get(url)
117
+ if r.status_code == 404:
118
+ fu.log(classname + ": Incorrect url, check project_id, node_id, trj_format, frames and selection: %s" % (url), out_log)
119
+ raise SystemExit(classname + ": Incorrect url, check project_id, node_id, trj_format, frames and selection: %s" % (url))
120
+
121
+ return r.content
122
+
123
+
87
124
  def download_mmcif(pdb_code, api_id, out_log=None, global_log=None):
88
125
  """
89
126
  Returns:
@@ -112,9 +149,7 @@ def download_ligand(ligand_code, api_id, out_log=None, global_log=None):
112
149
  text = requests.get(url, verify=True).content.decode("utf-8")
113
150
  elif api_id == "pdbe":
114
151
  url = (
115
- "https://www.ebi.ac.uk/pdbe/static/files/pdbechem_v2/"
116
- + ligand_code.upper()
117
- + "_ideal.pdb"
152
+ "https://www.ebi.ac.uk/pdbe/static/files/pdbechem_v2/" + ligand_code.upper() + "_ideal.pdb"
118
153
  )
119
154
  text = urllib.request.urlopen(url).read().decode("utf-8")
120
155
 
@@ -143,25 +178,6 @@ def download_fasta(pdb_code, api_id, out_log=None, global_log=None):
143
178
  return requests.get(url, verify=True).content.decode("utf-8")
144
179
 
145
180
 
146
- def download_drugbank(
147
- drugbank_id,
148
- url="https://www.drugbank.ca/structures/small_molecule_drugs/%s.sdf?type=3d",
149
- out_log=None,
150
- global_log=None,
151
- ):
152
- """
153
- Returns:
154
- String: Content of the component file.
155
- """
156
- url = url % drugbank_id
157
-
158
- fu.log("Downloading %s from: %s" % (drugbank_id, url), out_log, global_log)
159
-
160
- text = requests.get(url, verify=True).content.decode("utf-8")
161
-
162
- return text
163
-
164
-
165
181
  def download_binding_site(
166
182
  pdb_code,
167
183
  url="https://www.ebi.ac.uk/pdbe/api/pdb/entry/binding_sites/%s",
@@ -192,16 +208,12 @@ def download_ideal_sdf(ligand_code, api_id, out_log=None, global_log=None):
192
208
 
193
209
  if api_id == "pdb":
194
210
  url = (
195
- "https://files.rcsb.org/ligands/download/"
196
- + ligand_code.upper()
197
- + "_ideal.sdf"
211
+ "https://files.rcsb.org/ligands/download/" + ligand_code.upper() + "_ideal.sdf"
198
212
  )
199
213
  text = requests.get(url, verify=True).content.decode("utf-8")
200
214
  elif api_id == "pdbe":
201
215
  url = (
202
- "https://www.ebi.ac.uk/pdbe/static/files/pdbechem_v2/"
203
- + ligand_code.upper()
204
- + "_ideal.sdf"
216
+ "https://www.ebi.ac.uk/pdbe/static/files/pdbechem_v2/" + ligand_code.upper() + "_ideal.sdf"
205
217
  )
206
218
  text = urllib.request.urlopen(url).read().decode("utf-8")
207
219
 
@@ -249,6 +261,13 @@ def write_pdb(pdb_string, output_pdb_path, filt=None, out_log=None, global_log=N
249
261
  output_pdb_file.write(pdb_string)
250
262
 
251
263
 
264
+ def write_bin(bin_string, output_bin_path, out_log=None, global_log=None):
265
+ """Writes a BIN"""
266
+ fu.log("Writting bin to: %s" % (output_bin_path), out_log, global_log)
267
+ with open(output_bin_path, "wb") as output_bin_file:
268
+ output_bin_file.write(bin_string)
269
+
270
+
252
271
  def write_mmcif(mmcif_string, output_mmcif_path, out_log=None, global_log=None):
253
272
  """Writes a mmcif"""
254
273
  fu.log("Writting mmcif to: %s" % (output_mmcif_path), out_log, global_log)
@@ -287,22 +306,11 @@ def get_cluster_pdb_codes(pdb_code, cluster, out_log=None, global_log=None):
287
306
 
288
307
  if out_log:
289
308
  out_log.info(
290
- "Cluster: "
291
- + str(cluster)
292
- + " of pdb_code: "
293
- + pdb_code
294
- + "\n List: "
295
- + str(pdb_codes)
309
+ "Cluster: " + str(cluster) + " of pdb_code: " + pdb_code + "\n List: " + str(pdb_codes)
296
310
  )
297
311
  if global_log:
298
312
  global_log.info(
299
- fu.get_logs_prefix()
300
- + "Cluster: "
301
- + str(cluster)
302
- + " of pdb_code: "
303
- + pdb_code
304
- + "\n List: "
305
- + str(pdb_codes)
313
+ fu.get_logs_prefix() + "Cluster: " + str(cluster) + " of pdb_code: " + pdb_code + "\n List: " + str(pdb_codes)
306
314
  )
307
315
 
308
316
  return pdb_codes
@@ -414,9 +422,7 @@ def get_memprotmd_sim(pdb_code, output_file, out_log=None, global_log=None):
414
422
  fu.log("Getting simulation file from pdb code %s" % (pdb_code), out_log, global_log)
415
423
 
416
424
  url = (
417
- "http://memprotmd.bioch.ox.ac.uk/data/memprotmd/simulations/"
418
- + pdb_code
419
- + "_default_dppc/files/run/at.zip"
425
+ "http://memprotmd.bioch.ox.ac.uk/data/memprotmd/simulations/" + pdb_code + "_default_dppc/files/run/at.zip"
420
426
  )
421
427
  response = requests.get(url)
422
428
 
@@ -118,6 +118,8 @@ def ideal_sdf(output_sdf_path: str, properties: Optional[dict] = None, **kwargs)
118
118
  output_sdf_path=output_sdf_path, properties=properties, **kwargs
119
119
  ).launch()
120
120
 
121
+ ideal_sdf.__doc__ = IdealSdf.__doc__
122
+
121
123
 
122
124
  def main():
123
125
  """Command line execution of this building block. Please check the command line documentation."""
@@ -27,7 +27,7 @@ class Ligand(BiobbObject):
27
27
  output_pdb_path (str): Path to the output PDB ligand file. File type: output. `Sample file <https://github.com/bioexcel/biobb_io/raw/master/biobb_io/test/reference/api/output_ligand.pdb>`_. Accepted formats: pdb (edam:format_1476).
28
28
  properties (dic - Python dictionary object containing the tool parameters, not input/output files):
29
29
  * **ligand_code** (*str*) - (None) RSCB PDB ligand code.
30
- * **api_id** (*str*) - ("mmb") Identifier of the PDB REST API from which the PDB structure will be downloaded. Values: pdbe (`PDB in Europe REST API <https://www.ebi.ac.uk/pdbe/pdbe-rest-api>`_), mmb (`MMB PDB mirror API <http://mmb.irbbarcelona.org/api/>`_).
30
+ * **api_id** (*str*) - ("pdbe") Identifier of the PDB REST API from which the PDB structure will be downloaded. Values: pdbe (`PDB in Europe REST API <https://www.ebi.ac.uk/pdbe/pdbe-rest-api>`_), mmb (`MMB PDB mirror API <http://mmb.irbbarcelona.org/api/>`_).
31
31
  * **remove_tmp** (*bool*) - (True) [WF property] Remove temporal files.
32
32
  * **restart** (*bool*) - (False) [WF property] Do not execute if output files exist.
33
33
  * **sandbox_path** (*str*) - ("./") [WF property] Parent path to the sandbox directory.
@@ -38,7 +38,7 @@ class Ligand(BiobbObject):
38
38
  from biobb_io.api.ligand import ligand
39
39
  prop = {
40
40
  'ligand_code': 'CPB',
41
- 'api_id': 'mmb'
41
+ 'api_id': 'pdbe'
42
42
  }
43
43
  ligand(output_pdb_path='/path/to/newLigand.pdb',
44
44
  properties=prop)
@@ -64,7 +64,7 @@ class Ligand(BiobbObject):
64
64
  self.io_dict = {"out": {"output_pdb_path": output_pdb_path}}
65
65
 
66
66
  # Properties specific for BB
67
- self.api_id = properties.get("api_id", "mmb")
67
+ self.api_id = properties.get("api_id", "pdbe")
68
68
  self.ligand_code = properties.get("ligand_code", None)
69
69
  self.properties = properties
70
70
 
@@ -118,6 +118,8 @@ def ligand(output_pdb_path: str, properties: Optional[dict] = None, **kwargs) ->
118
118
  output_pdb_path=output_pdb_path, properties=properties, **kwargs
119
119
  ).launch()
120
120
 
121
+ ligand.__doc__ = Ligand.__doc__
122
+
121
123
 
122
124
  def main():
123
125
  """Command line execution of this building block. Please check the command line documentation."""
@@ -0,0 +1,196 @@
1
+ #!/usr/bin/env python
2
+
3
+ """Module containing the MDDB class and the command line interface."""
4
+
5
+ import argparse
6
+ from typing import Optional
7
+
8
+ from biobb_common.configuration import settings
9
+ from biobb_common.generic.biobb_object import BiobbObject
10
+ from biobb_common.tools.file_utils import launchlogger
11
+
12
+ from biobb_io.api.common import (
13
+ check_mandatory_property,
14
+ check_output_path,
15
+ download_mddb_top,
16
+ write_pdb,
17
+ download_mddb_trj,
18
+ write_bin
19
+ )
20
+
21
+
22
+ class MDDB(BiobbObject):
23
+ """
24
+ | biobb_io MDDB
25
+ | This class is a wrapper for downloading a trajectory / topology pair from the MDDB Database.
26
+ | Wrapper for the `MDDB Database <https://mmb.mddbr.eu/>`_ for downloading a trajectory and its corresponding topology.
27
+
28
+ Args:
29
+ output_top_path (str): Path to the output toplogy file. File type: output. `Sample file <https://github.com/bioexcel/biobb_io/raw/master/biobb_io/test/reference/api/output_mddb.pdb>`_. Accepted formats: pdb (edam:format_1476).
30
+ output_trj_path (str): Path to the output trajectory file. File type: output. `Sample file <https://github.com/bioexcel/biobb_io/raw/master/biobb_io/test/reference/api/output_mddb.xtc>`_. Accepted formats: mdcrd (edam:format_3878), trr (edam:format_3910), xtc (edam:format_3875).
31
+ properties (dic - Python dictionary object containing the tool parameters, not input/output files):
32
+ * **project_id** (*str*) - (None) Project accession or identifier.
33
+ * **node_id** (*str*) - ("mmb") MDDB node identifier.
34
+ * **trj_format** (*str*) - ("xtc") Trajectory format. Values: mdcrd (AMBER trajectory format), trr (Trajectory of a simulation experiment used by GROMACS), xtc (Portable binary format for trajectories produced by GROMACS package).
35
+ * **frames** (*str*) - (None) Specify a frame range for the returned trajectory. Ranges are defined by dashes, and multiple ranges can be defined separated by commas. It can also be defined as the start:end:step format (ie: '10:20:2').
36
+ * **selection** (*str*) - (None) Specify a NGL-formatted selection for the returned trajectory. See here for the kind of selection that can be used: http://nglviewer.org/ngl/api/manual/usage/selection-language.html.
37
+ * **remove_tmp** (*bool*) - (True) [WF property] Remove temporal files.
38
+ * **restart** (*bool*) - (False) [WF property] Do not execute if output files exist.
39
+ * **sandbox_path** (*str*) - ("./") [WF property] Parent path to the sandbox directory.
40
+
41
+ Examples:
42
+ This is a use example of how to use the building block from Python::
43
+
44
+ from biobb_io.api.mddb import mddb
45
+ prop = {
46
+ 'project_id': 'A0001',
47
+ 'trj_format': 'xtc'
48
+ }
49
+ mddb(output_top_path='/path/to/newTopology.pdb',
50
+ output_trj_path='/path/to/newTrajectory.pdb',
51
+ properties=prop)
52
+
53
+ Info:
54
+ * wrapped_software:
55
+ * name: MDDB Database
56
+ * license: Apache-2.0
57
+ * ontology:
58
+ * name: EDAM
59
+ * schema: http://edamontology.org/EDAM.owl
60
+
61
+ """
62
+
63
+ def __init__(self, output_top_path, output_trj_path, properties=None, **kwargs) -> None:
64
+ properties = properties or {}
65
+
66
+ # Call parent class constructor
67
+ super().__init__(properties)
68
+ self.locals_var_dict = locals().copy()
69
+
70
+ # Input/Output files
71
+ self.io_dict = {"out": {"output_top_path": output_top_path, "output_trj_path": output_trj_path}}
72
+
73
+ # Properties specific for BB
74
+ self.project_id = properties.get("project_id", None)
75
+ self.node_id = properties.get("node_id", "mmb")
76
+ self.trj_format = properties.get("trj_format", "xtc")
77
+ self.frames = properties.get("frames", "")
78
+ self.selection = properties.get("selection", "*")
79
+ self.properties = properties
80
+
81
+ # Check the properties
82
+ self.check_properties(properties)
83
+ self.check_arguments()
84
+
85
+ def check_data_params(self, out_log, err_log):
86
+ """Checks all the input/output paths and parameters"""
87
+ self.output_top_path = check_output_path(
88
+ self.io_dict["out"]["output_top_path"],
89
+ "output_top_path",
90
+ False,
91
+ out_log,
92
+ self.__class__.__name__,
93
+ )
94
+ self.output_trj_path = check_output_path(
95
+ self.io_dict["out"]["output_trj_path"],
96
+ "output_trj_path",
97
+ False,
98
+ out_log,
99
+ self.__class__.__name__,
100
+ )
101
+
102
+ @launchlogger
103
+ def launch(self) -> int:
104
+ """Execute the :class:`MDDB <api.mddb.MDDB>` api.mddb.MDDB object."""
105
+
106
+ # check input/output paths and parameters
107
+ self.check_data_params(self.out_log, self.err_log)
108
+
109
+ # Setup Biobb
110
+ if self.check_restart():
111
+ return 0
112
+
113
+ check_mandatory_property(
114
+ self.project_id, "project_id", self.out_log, self.__class__.__name__
115
+ )
116
+
117
+ self.project_id = self.project_id.strip().upper()
118
+
119
+ # Downloading topology file
120
+ top_string = download_mddb_top(
121
+ self.project_id,
122
+ self.node_id,
123
+ self.selection,
124
+ self.out_log,
125
+ self.global_log,
126
+ self.__class__.__name__
127
+ )
128
+ write_pdb(top_string, self.output_top_path, None, self.out_log, self.global_log)
129
+
130
+ # Downloading trajectory file
131
+ trj_string = download_mddb_trj(
132
+ self.project_id,
133
+ self.node_id,
134
+ self.trj_format,
135
+ self.frames,
136
+ self.selection,
137
+ self.out_log,
138
+ self.global_log,
139
+ self.__class__.__name__,
140
+ )
141
+ write_bin(trj_string, self.output_trj_path, self.out_log, self.global_log)
142
+
143
+ self.check_arguments(output_files_created=True, raise_exception=False)
144
+
145
+ return 0
146
+
147
+
148
+ def mddb(output_top_path: str, output_trj_path: str, properties: Optional[dict] = None, **kwargs) -> int:
149
+ """Execute the :class:`MDDB <api.mddb.MDDB>` class and
150
+ execute the :meth:`launch() <api.mddb.MDDB.launch>` method."""
151
+
152
+ return MDDB(
153
+ output_top_path=output_top_path, output_trj_path=output_trj_path, properties=properties, **kwargs
154
+ ).launch()
155
+
156
+ mddb.__doc__ = MDDB.__doc__
157
+
158
+
159
+ def main():
160
+ """Command line execution of this building block. Please check the command line documentation."""
161
+ parser = argparse.ArgumentParser(
162
+ description="This class is a wrapper for downloading a trajectory / topology pair from the MDDB Database.",
163
+ formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999),
164
+ )
165
+ parser.add_argument(
166
+ "-c",
167
+ "--config",
168
+ required=False,
169
+ help="This file can be a YAML file, JSON file or JSON string",
170
+ )
171
+
172
+ # Specific args of each building block
173
+ required_args = parser.add_argument_group("required arguments")
174
+ required_args.add_argument(
175
+ "-o",
176
+ "--output_top_path",
177
+ required=True,
178
+ help="Path to the output toplogy file. Accepted formats: pdb.",
179
+ )
180
+ required_args.add_argument(
181
+ "-t",
182
+ "--output_trj_path",
183
+ required=True,
184
+ help="Path to the output trajectory file. Accepted formats: mdcrd, trr, xtc.",
185
+ )
186
+
187
+ args = parser.parse_args()
188
+ config = args.config if args.config else None
189
+ properties = settings.ConfReader(config=config).get_prop_dic()
190
+
191
+ # Specific call of each building block
192
+ mddb(output_top_path=args.output_top_path, output_trj_path=args.output_trj_path, properties=properties)
193
+
194
+
195
+ if __name__ == "__main__":
196
+ main()
@@ -113,6 +113,8 @@ def memprotmd_sim(
113
113
  output_simulation=output_simulation, properties=properties, **kwargs
114
114
  ).launch()
115
115
 
116
+ memprotmd_sim.__doc__ = MemProtMDSim.__doc__
117
+
116
118
 
117
119
  def main():
118
120
  """Command line execution of this building block. Please check the command line documentation."""
@@ -102,6 +102,8 @@ def memprotmd_sim_list(
102
102
  output_simulations=output_simulations, properties=properties, **kwargs
103
103
  ).launch()
104
104
 
105
+ memprotmd_sim_list.__doc__ = MemProtMDSimList.__doc__
106
+
105
107
 
106
108
  def main():
107
109
  """Command line execution of this building block. Please check the command line documentation."""
@@ -113,6 +113,8 @@ def memprotmd_sim_search(
113
113
  output_simulations=output_simulations, properties=properties, **kwargs
114
114
  ).launch()
115
115
 
116
+ memprotmd_sim_search.__doc__ = MemProtMDSimSearch.__doc__
117
+
116
118
 
117
119
  def main():
118
120
  """Command line execution of this building block. Please check the command line documentation."""
@@ -118,6 +118,8 @@ def mmcif(output_mmcif_path: str, properties: Optional[dict] = None, **kwargs) -
118
118
  output_mmcif_path=output_mmcif_path, properties=properties, **kwargs
119
119
  ).launch()
120
120
 
121
+ mmcif.__doc__ = Mmcif.__doc__
122
+
121
123
 
122
124
  def main():
123
125
  """Command line execution of this building block. Please check the command line documentation."""
@@ -123,6 +123,8 @@ def pdb(output_pdb_path: str, properties: Optional[dict] = None, **kwargs) -> in
123
123
  output_pdb_path=output_pdb_path, properties=properties, **kwargs
124
124
  ).launch()
125
125
 
126
+ pdb.__doc__ = Pdb.__doc__
127
+
126
128
 
127
129
  def main():
128
130
  """Command line execution of this building block. Please check the command line documentation."""
@@ -132,7 +132,10 @@ class PdbClusterZip(BiobbObject):
132
132
  fu.log("Zipping the pdb files to: %s" % self.output_pdb_zip_path)
133
133
  fu.zip_list(self.output_pdb_zip_path, file_list, out_log=self.out_log)
134
134
 
135
- self.tmp_files.extend([self.stage_io_dict.get("unique_dir", ""), unique_dir])
135
+ self.tmp_files.extend([
136
+ # self.stage_io_dict.get("unique_dir", ""),
137
+ unique_dir
138
+ ])
136
139
  self.remove_tmp_files()
137
140
 
138
141
  self.check_arguments(output_files_created=True, raise_exception=False)
@@ -150,6 +153,8 @@ def pdb_cluster_zip(
150
153
  output_pdb_zip_path=output_pdb_zip_path, properties=properties, **kwargs
151
154
  ).launch()
152
155
 
156
+ pdb_cluster_zip.__doc__ = PdbClusterZip.__doc__
157
+
153
158
 
154
159
  def main():
155
160
  """Command line execution of this building block. Please check the command line documentation."""
@@ -131,14 +131,10 @@ class PdbVariants(BiobbObject):
131
131
  for k in mapdic.keys():
132
132
  for fragment in mapdic[k]:
133
133
  if (
134
- int(fragment["unp_start"])
135
- <= int(uni_mut["resnum"])
136
- <= int(fragment["unp_end"])
134
+ int(fragment["unp_start"]) <= int(uni_mut["resnum"]) <= int(fragment["unp_end"])
137
135
  ):
138
136
  resnum = (
139
- int(uni_mut["resnum"])
140
- + int(fragment["pdb_start"])
141
- - int(fragment["unp_start"])
137
+ int(uni_mut["resnum"]) + int(fragment["pdb_start"]) - int(fragment["unp_start"])
142
138
  )
143
139
  mutations.append(
144
140
  k[-1] + "." + uni_mut["wt"] + str(resnum) + uni_mut["mt"]
@@ -179,6 +175,8 @@ def pdb_variants(
179
175
  **kwargs,
180
176
  ).launch()
181
177
 
178
+ pdb_variants.__doc__ = PdbVariants.__doc__
179
+
182
180
 
183
181
  def main():
184
182
  """Command line execution of this building block. Please check the command line documentation."""
@@ -118,6 +118,8 @@ def structure_info(
118
118
  output_json_path=output_json_path, properties=properties, **kwargs
119
119
  ).launch()
120
120
 
121
+ structure_info.__doc__ = StructureInfo.__doc__
122
+
121
123
 
122
124
  def main():
123
125
  """Command line execution of this building block. Please check the command line documentation."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
- Name: biobb_io
3
- Version: 5.0.0
2
+ Name: biobb-io
3
+ Version: 5.1.0
4
4
  Summary: Biobb_io is the Biobb module collection to fetch data to be consumed by the rest of the Biobb building blocks.
5
5
  Home-page: https://github.com/bioexcel/biobb_io
6
6
  Author: Biobb developers
@@ -17,14 +17,14 @@ Classifier: Operating System :: Unix
17
17
  Requires-Python: >=3.9
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
- Requires-Dist: biobb_common==5.0.0
20
+ Requires-Dist: biobb_common==5.1.0
21
21
 
22
22
  [![](https://img.shields.io/github/v/tag/bioexcel/biobb_io?label=Version)](https://GitHub.com/bioexcel/biobb_io/tags/)
23
23
  [![](https://img.shields.io/pypi/v/biobb-io.svg?label=Pypi)](https://pypi.python.org/pypi/biobb-io/)
24
24
  [![](https://img.shields.io/conda/vn/bioconda/biobb_io?label=Conda)](https://anaconda.org/bioconda/biobb_io)
25
25
  [![](https://img.shields.io/conda/dn/bioconda/biobb_io?label=Conda%20Downloads)](https://anaconda.org/bioconda/biobb_io)
26
26
  [![](https://img.shields.io/badge/Docker-Quay.io-blue)](https://quay.io/repository/biocontainers/biobb_io?tab=tags)
27
- [![](https://img.shields.io/badge/Singularity-GalaxyProject-blue)](https://depot.galaxyproject.org/singularity/biobb_io:5.0.0--pyhdfd78af_0)
27
+ [![](https://img.shields.io/badge/Singularity-GalaxyProject-blue)](https://depot.galaxyproject.org/singularity/biobb_io:5.1.0--pyhdfd78af_0)
28
28
 
29
29
  [![](https://img.shields.io/badge/OS-Unix%20%7C%20MacOS-blue)](https://github.com/bioexcel/biobb_io)
30
30
  [![](https://img.shields.io/pypi/pyversions/biobb-io.svg?label=Python%20Versions)](https://pypi.org/project/biobb-io/)
@@ -62,7 +62,7 @@ The latest documentation of this package can be found in our readthedocs site:
62
62
  [latest API documentation](http://biobb-io.readthedocs.io/en/latest/).
63
63
 
64
64
  ### Version
65
- v5.0.0 2024.2
65
+ v5.1.0 2025.1
66
66
 
67
67
  ### Installation
68
68
  Using PIP:
@@ -71,7 +71,7 @@ Using PIP:
71
71
 
72
72
  * Installation:
73
73
 
74
- pip install "biobb_io==5.0.0"
74
+ pip install "biobb_io==5.1.0"
75
75
 
76
76
  * Usage: [Python API documentation](https://biobb-io.readthedocs.io/en/latest/modules.html)
77
77
 
@@ -79,7 +79,7 @@ Using ANACONDA:
79
79
  * Installation:
80
80
 
81
81
 
82
- conda install -c bioconda "biobb_io==5.0.0"
82
+ conda install -c bioconda "biobb_io==5.1.0"
83
83
 
84
84
 
85
85
  * Usage: With conda installation BioBBs can be used with the [Python API documentation](https://biobb-io.readthedocs.io/en/latest/modules.html) and the [Command Line documentation](https://biobb-io.readthedocs.io/en/latest/command_line.html)
@@ -88,12 +88,12 @@ Using DOCKER:
88
88
  * Installation:
89
89
 
90
90
 
91
- docker pull quay.io/biocontainers/biobb_io:5.0.0--pyhdfd78af_0
91
+ docker pull quay.io/biocontainers/biobb_io:5.1.0--pyhdfd78af_0
92
92
 
93
93
  * Usage:
94
94
 
95
95
 
96
- docker run quay.io/biocontainers/biobb_io:5.0.0--pyhdfd78af_0 <command>
96
+ docker run quay.io/biocontainers/biobb_io:5.1.0--pyhdfd78af_0 <command>
97
97
 
98
98
 
99
99
  The command list and specification can be found at the [Command Line documentation](https://biobb-io.readthedocs.io/en/latest/command_line.html).
@@ -105,7 +105,7 @@ Using SINGULARITY:
105
105
  * Installation:
106
106
 
107
107
 
108
- singularity pull --name biobb_io.sif https://depot.galaxyproject.org/singularity/biobb_io:5.0.0--pyhdfd78af_0
108
+ singularity pull --name biobb_io.sif https://depot.galaxyproject.org/singularity/biobb_io:5.1.0--pyhdfd78af_0
109
109
 
110
110
 
111
111
  * Usage:
@@ -118,10 +118,10 @@ Using SINGULARITY:
118
118
  The command list and specification can be found at the [Command Line documentation](https://biobb-io.readthedocs.io/en/latest/command_line.html).
119
119
 
120
120
  ### Copyright & Licensing
121
- This software has been developed in the [MMB group](http://mmb.irbbarcelona.org) at the [BSC](http://www.bsc.es/) & [IRB](https://www.irbbarcelona.org/) for the [European BioExcel](http://bioexcel.eu/), funded by the European Commission (EU H2020 [823830](http://cordis.europa.eu/projects/823830), EU H2020 [675728](http://cordis.europa.eu/projects/675728)).
121
+ This software has been developed in the [MMB group](http://mmb.irbbarcelona.org) at the [BSC](http://www.bsc.es/) & [IRB](https://www.irbbarcelona.org/) for the [European BioExcel](http://bioexcel.eu/), funded by the European Commission (EU Horizon Europe [101093290](https://cordis.europa.eu/project/id/101093290), EU H2020 [823830](http://cordis.europa.eu/projects/823830), EU H2020 [675728](http://cordis.europa.eu/projects/675728)).
122
122
 
123
- * (c) 2015-2024 [Barcelona Supercomputing Center](https://www.bsc.es/)
124
- * (c) 2015-2024 [Institute for Research in Biomedicine](https://www.irbbarcelona.org/)
123
+ * (c) 2015-2025 [Barcelona Supercomputing Center](https://www.bsc.es/)
124
+ * (c) 2015-2025 [Institute for Research in Biomedicine](https://www.irbbarcelona.org/)
125
125
 
126
126
  Licensed under the
127
127
  [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0), see the file LICENSE for details.
@@ -14,9 +14,9 @@ biobb_io/api/alphafold.py
14
14
  biobb_io/api/api_binding_site.py
15
15
  biobb_io/api/canonical_fasta.py
16
16
  biobb_io/api/common.py
17
- biobb_io/api/drugbank.py
18
17
  biobb_io/api/ideal_sdf.py
19
18
  biobb_io/api/ligand.py
19
+ biobb_io/api/mddb.py
20
20
  biobb_io/api/memprotmd_sim.py
21
21
  biobb_io/api/memprotmd_sim_list.py
22
22
  biobb_io/api/memprotmd_sim_search.py
@@ -2,9 +2,9 @@
2
2
  alphafold = biobb_io.api.alphafold:main
3
3
  api_binding_site = biobb_io.api.api_binding_site:main
4
4
  canonical_fasta = biobb_io.api.canonical_fasta:main
5
- drugbank = biobb_io.api.drugbank:main
6
5
  ideal_sdf = biobb_io.api.ideal_sdf:main
7
6
  ligand = biobb_io.api.ligand:main
7
+ mddb = biobb_io.api.mddb:main
8
8
  memprotmd_sim = biobb_io.api.memprotmd_sim:main
9
9
  memprotmd_sim_list = biobb_io.api.memprotmd_sim_list:main
10
10
  memprotmd_sim_search = biobb_io.api.memprotmd_sim_search:main
@@ -0,0 +1 @@
1
+ biobb_common==5.1.0
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="biobb_io",
8
- version="5.0.0",
8
+ version="5.1.0",
9
9
  author="Biobb developers",
10
10
  author_email="pau.andrio@bsc.es",
11
11
  description="Biobb_io is the Biobb module collection to fetch data to be consumed by the rest of the Biobb building blocks.",
@@ -19,16 +19,16 @@ setuptools.setup(
19
19
  },
20
20
  packages=setuptools.find_packages(exclude=["docs", "test"]),
21
21
  package_data={"biobb_io": ["py.typed"]},
22
- install_requires=["biobb_common==5.0.0"],
22
+ install_requires=["biobb_common==5.1.0"],
23
23
  python_requires=">=3.9",
24
24
  entry_points={
25
25
  "console_scripts": [
26
26
  "alphafold = biobb_io.api.alphafold:main",
27
27
  "api_binding_site = biobb_io.api.api_binding_site:main",
28
28
  "canonical_fasta = biobb_io.api.canonical_fasta:main",
29
- "drugbank = biobb_io.api.drugbank:main",
30
29
  "ideal_sdf = biobb_io.api.ideal_sdf:main",
31
30
  "ligand = biobb_io.api.ligand:main",
31
+ "mddb = biobb_io.api.mddb:main",
32
32
  "memprotmd_sim_list = biobb_io.api.memprotmd_sim_list:main",
33
33
  "memprotmd_sim_search = biobb_io.api.memprotmd_sim_search:main",
34
34
  "memprotmd_sim = biobb_io.api.memprotmd_sim:main",
@@ -1,151 +0,0 @@
1
- #!/usr/bin/env python
2
-
3
- """Module containing the Drugbank class and the command line interface."""
4
-
5
- import argparse
6
- from typing import Optional
7
-
8
- from biobb_common.configuration import settings
9
- from biobb_common.generic.biobb_object import BiobbObject
10
- from biobb_common.tools.file_utils import launchlogger
11
-
12
- from biobb_io.api.common import (
13
- check_mandatory_property,
14
- check_output_path,
15
- download_drugbank,
16
- write_sdf,
17
- )
18
-
19
-
20
- class Drugbank(BiobbObject):
21
- """
22
- | biobb_io Drugbank
23
- | This class is a wrapper for the `Drugbank <https://www.drugbank.ca/>`_ REST API.
24
- | Download a single component in SDF format from the `Drugbank <https://www.drugbank.ca/>`_ REST API.
25
-
26
- Args:
27
- output_sdf_path (str): Path to the output SDF component file. File type: output. `Sample file <https://github.com/bioexcel/biobb_io/raw/master/biobb_io/test/reference/api/output_drugbank.sdf>`_. Accepted formats: sdf (edam:format_3814).
28
- properties (dic - Python dictionary object containing the tool parameters, not input/output files):
29
- * **drugbank_id** (*str*) - (None) Drugbank component id.
30
- * **remove_tmp** (*bool*) - (True) [WF property] Remove temporal files.
31
- * **restart** (*bool*) - (False) [WF property] Do not execute if output files exist.
32
- * **sandbox_path** (*str*) - ("./") [WF property] Parent path to the sandbox directory.
33
-
34
- Examples:
35
- This is a use example of how to use the building block from Python::
36
-
37
- from biobb_io.api.drugbank import drugbank
38
- prop = {
39
- 'drugbank_id': 'DB00530'
40
- }
41
- drugbank(output_sdf_path='/path/to/newComponent.sdf',
42
- properties=prop)
43
-
44
- Info:
45
- * wrapped_software:
46
- * name: Drugbank
47
- * license: Creative Commons
48
- * ontology:
49
- * name: EDAM
50
- * schema: http://edamontology.org/EDAM.owl
51
-
52
- """
53
-
54
- def __init__(self, output_sdf_path, properties=None, **kwargs) -> None:
55
- properties = properties or {}
56
-
57
- # Call parent class constructor
58
- super().__init__(properties)
59
- self.locals_var_dict = locals().copy()
60
-
61
- # Input/Output files
62
- self.io_dict = {"out": {"output_sdf_path": output_sdf_path}}
63
-
64
- # Properties specific for BB
65
- self.drugbank_id = properties.get("drugbank_id", None)
66
- self.properties = properties
67
-
68
- # Check the properties
69
- self.check_properties(properties)
70
- self.check_arguments()
71
-
72
- def check_data_params(self, out_log, err_log):
73
- """Checks all the input/output paths and parameters"""
74
- self.output_sdf_path = check_output_path(
75
- self.io_dict["out"]["output_sdf_path"],
76
- "output_sdf_path",
77
- False,
78
- out_log,
79
- self.__class__.__name__,
80
- )
81
-
82
- @launchlogger
83
- def launch(self) -> int:
84
- """Execute the :class:`Drugbank <api.drugbank.Drugbank>` api.drugbank.Drugbank object."""
85
-
86
- # check input/output paths and parameters
87
- self.check_data_params(self.out_log, self.err_log)
88
-
89
- # Setup Biobb
90
- if self.check_restart():
91
- return 0
92
-
93
- check_mandatory_property(
94
- self.drugbank_id, "drugbank_id", self.out_log, self.__class__.__name__
95
- )
96
-
97
- self.drugbank_id = self.drugbank_id.strip().lower()
98
- url = "https://www.drugbank.ca/structures/small_molecule_drugs/%s.sdf?type=3d"
99
-
100
- # Downloading SDF file
101
- sdf_string = download_drugbank(
102
- self.drugbank_id, url, self.out_log, self.global_log
103
- )
104
- write_sdf(sdf_string, self.output_sdf_path, self.out_log, self.global_log)
105
-
106
- self.check_arguments(output_files_created=True, raise_exception=False)
107
-
108
- return 0
109
-
110
-
111
- def drugbank(output_sdf_path: str, properties: Optional[dict] = None, **kwargs) -> int:
112
- """Execute the :class:`Drugbank <api.drugbank.Drugbank>` class and
113
- execute the :meth:`launch() <api.drugbank.Drugbank.launch>` method."""
114
-
115
- return Drugbank(
116
- output_sdf_path=output_sdf_path, properties=properties, **kwargs
117
- ).launch()
118
-
119
-
120
- def main():
121
- """Command line execution of this building block. Please check the command line documentation."""
122
- parser = argparse.ArgumentParser(
123
- description="Download a component in SDF format from the Drugbank (https://www.drugbank.ca/).",
124
- formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999),
125
- )
126
- parser.add_argument(
127
- "-c",
128
- "--config",
129
- required=False,
130
- help="This file can be a YAML file, JSON file or JSON string",
131
- )
132
-
133
- # Specific args of each building block
134
- required_args = parser.add_argument_group("required arguments")
135
- required_args.add_argument(
136
- "-o",
137
- "--output_sdf_path",
138
- required=True,
139
- help="Path to the output SDF component file. Accepted formats: sdf.",
140
- )
141
-
142
- args = parser.parse_args()
143
- config = args.config if args.config else None
144
- properties = settings.ConfReader(config=config).get_prop_dic()
145
-
146
- # Specific call of each building block
147
- drugbank(output_sdf_path=args.output_sdf_path, properties=properties)
148
-
149
-
150
- if __name__ == "__main__":
151
- main()
@@ -1 +0,0 @@
1
- biobb_common==5.0.0
File without changes
File without changes
File without changes