biobb-io 5.0.1__tar.gz → 5.1.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 (31) hide show
  1. {biobb_io-5.0.1 → biobb_io-5.1.1}/PKG-INFO +25 -13
  2. {biobb_io-5.0.1 → biobb_io-5.1.1}/README.md +10 -10
  3. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io/__init__.py +1 -1
  4. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io/api/__init__.py +2 -0
  5. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io/api/alphafold.py +3 -36
  6. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io/api/api_binding_site.py +3 -36
  7. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io/api/canonical_fasta.py +3 -36
  8. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io/api/common.py +72 -29
  9. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io/api/ideal_sdf.py +3 -36
  10. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io/api/ligand.py +6 -39
  11. biobb_io-5.1.1/biobb_io/api/mddb.py +175 -0
  12. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io/api/memprotmd_sim.py +3 -36
  13. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io/api/memprotmd_sim_list.py +3 -39
  14. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io/api/memprotmd_sim_search.py +3 -38
  15. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io/api/mmcif.py +3 -36
  16. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io/api/pdb.py +3 -36
  17. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io/api/pdb_cluster_zip.py +4 -37
  18. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io/api/pdb_variants.py +6 -47
  19. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io/api/structure_info.py +3 -36
  20. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io.egg-info/PKG-INFO +25 -13
  21. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io.egg-info/SOURCES.txt +1 -0
  22. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io.egg-info/entry_points.txt +1 -0
  23. biobb_io-5.1.1/biobb_io.egg-info/requires.txt +1 -0
  24. {biobb_io-5.0.1 → biobb_io-5.1.1}/setup.py +3 -2
  25. biobb_io-5.0.1/biobb_io.egg-info/requires.txt +0 -1
  26. {biobb_io-5.0.1 → biobb_io-5.1.1}/LICENSE +0 -0
  27. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io/py.typed +0 -0
  28. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io/test/__init__.py +0 -0
  29. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io.egg-info/dependency_links.txt +0 -0
  30. {biobb_io-5.0.1 → biobb_io-5.1.1}/biobb_io.egg-info/top_level.txt +0 -0
  31. {biobb_io-5.0.1 → biobb_io-5.1.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: biobb_io
3
- Version: 5.0.1
3
+ Version: 5.1.1
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,26 @@ 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.1
21
+ Dynamic: author
22
+ Dynamic: author-email
23
+ Dynamic: classifier
24
+ Dynamic: description
25
+ Dynamic: description-content-type
26
+ Dynamic: home-page
27
+ Dynamic: keywords
28
+ Dynamic: license-file
29
+ Dynamic: project-url
30
+ Dynamic: requires-dist
31
+ Dynamic: requires-python
32
+ Dynamic: summary
21
33
 
22
34
  [![](https://img.shields.io/github/v/tag/bioexcel/biobb_io?label=Version)](https://GitHub.com/bioexcel/biobb_io/tags/)
23
35
  [![](https://img.shields.io/pypi/v/biobb-io.svg?label=Pypi)](https://pypi.python.org/pypi/biobb-io/)
24
36
  [![](https://img.shields.io/conda/vn/bioconda/biobb_io?label=Conda)](https://anaconda.org/bioconda/biobb_io)
25
37
  [![](https://img.shields.io/conda/dn/bioconda/biobb_io?label=Conda%20Downloads)](https://anaconda.org/bioconda/biobb_io)
26
38
  [![](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.1--pyhdfd78af_0)
39
+ [![](https://img.shields.io/badge/Singularity-GalaxyProject-blue)](https://depot.galaxyproject.org/singularity/biobb_io:5.1.1--pyhdfd78af_0)
28
40
 
29
41
  [![](https://img.shields.io/badge/OS-Unix%20%7C%20MacOS-blue)](https://github.com/bioexcel/biobb_io)
30
42
  [![](https://img.shields.io/pypi/pyversions/biobb-io.svg?label=Python%20Versions)](https://pypi.org/project/biobb-io/)
@@ -62,7 +74,7 @@ The latest documentation of this package can be found in our readthedocs site:
62
74
  [latest API documentation](http://biobb-io.readthedocs.io/en/latest/).
63
75
 
64
76
  ### Version
65
- v5.0.1 2024.2
77
+ v5.1.1 2025.1
66
78
 
67
79
  ### Installation
68
80
  Using PIP:
@@ -71,7 +83,7 @@ Using PIP:
71
83
 
72
84
  * Installation:
73
85
 
74
- pip install "biobb_io==5.0.1"
86
+ pip install "biobb_io==5.1.1"
75
87
 
76
88
  * Usage: [Python API documentation](https://biobb-io.readthedocs.io/en/latest/modules.html)
77
89
 
@@ -79,7 +91,7 @@ Using ANACONDA:
79
91
  * Installation:
80
92
 
81
93
 
82
- conda install -c bioconda "biobb_io==5.0.1"
94
+ conda install -c bioconda "biobb_io==5.1.1"
83
95
 
84
96
 
85
97
  * 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 +100,12 @@ Using DOCKER:
88
100
  * Installation:
89
101
 
90
102
 
91
- docker pull quay.io/biocontainers/biobb_io:5.0.1--pyhdfd78af_0
103
+ docker pull quay.io/biocontainers/biobb_io:5.1.1--pyhdfd78af_0
92
104
 
93
105
  * Usage:
94
106
 
95
107
 
96
- docker run quay.io/biocontainers/biobb_io:5.0.1--pyhdfd78af_0 <command>
108
+ docker run quay.io/biocontainers/biobb_io:5.1.1--pyhdfd78af_0 <command>
97
109
 
98
110
 
99
111
  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 +117,7 @@ Using SINGULARITY:
105
117
  * Installation:
106
118
 
107
119
 
108
- singularity pull --name biobb_io.sif https://depot.galaxyproject.org/singularity/biobb_io:5.0.1--pyhdfd78af_0
120
+ singularity pull --name biobb_io.sif https://depot.galaxyproject.org/singularity/biobb_io:5.1.1--pyhdfd78af_0
109
121
 
110
122
 
111
123
  * Usage:
@@ -118,10 +130,10 @@ Using SINGULARITY:
118
130
  The command list and specification can be found at the [Command Line documentation](https://biobb-io.readthedocs.io/en/latest/command_line.html).
119
131
 
120
132
  ### 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)).
133
+ 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
134
 
123
- * (c) 2015-2024 [Barcelona Supercomputing Center](https://www.bsc.es/)
124
- * (c) 2015-2024 [Institute for Research in Biomedicine](https://www.irbbarcelona.org/)
135
+ * (c) 2015-2025 [Barcelona Supercomputing Center](https://www.bsc.es/)
136
+ * (c) 2015-2025 [Institute for Research in Biomedicine](https://www.irbbarcelona.org/)
125
137
 
126
138
  Licensed under the
127
139
  [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.1--pyhdfd78af_0)
6
+ [![](https://img.shields.io/badge/Singularity-GalaxyProject-blue)](https://depot.galaxyproject.org/singularity/biobb_io:5.1.1--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.1 2024.2
44
+ v5.1.1 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.1"
53
+ pip install "biobb_io==5.1.1"
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.1"
61
+ conda install -c bioconda "biobb_io==5.1.1"
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.1--pyhdfd78af_0
70
+ docker pull quay.io/biocontainers/biobb_io:5.1.1--pyhdfd78af_0
71
71
 
72
72
  * Usage:
73
73
 
74
74
 
75
- docker run quay.io/biocontainers/biobb_io:5.0.1--pyhdfd78af_0 <command>
75
+ docker run quay.io/biocontainers/biobb_io:5.1.1--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.1--pyhdfd78af_0
87
+ singularity pull --name biobb_io.sif https://depot.galaxyproject.org/singularity/biobb_io:5.1.1--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.1"
5
+ __version__ = "5.1.1"
@@ -12,6 +12,7 @@ from . import (
12
12
  pdb_cluster_zip,
13
13
  pdb_variants,
14
14
  structure_info,
15
+ mddb
15
16
  )
16
17
 
17
18
  name = "api"
@@ -29,4 +30,5 @@ __all__ = [
29
30
  "mmcif",
30
31
  "ideal_sdf",
31
32
  "structure_info",
33
+ "mddb"
32
34
  ]
@@ -2,10 +2,7 @@
2
2
 
3
3
  """Module containing the AlphaFold class and the command line interface."""
4
4
 
5
- import argparse
6
5
  from typing import Optional
7
-
8
- from biobb_common.configuration import settings
9
6
  from biobb_common.generic.biobb_object import BiobbObject
10
7
  from biobb_common.tools.file_utils import launchlogger
11
8
 
@@ -113,41 +110,11 @@ class AlphaFold(BiobbObject):
113
110
  def alphafold(output_pdb_path: str, properties: Optional[dict] = None, **kwargs) -> int:
114
111
  """Execute the :class:`AlphaFold <api.alphafold.AlphaFold>` class and
115
112
  execute the :meth:`launch() <api.alphafold.AlphaFold.launch>` method."""
113
+ return AlphaFold(**dict(locals())).launch()
116
114
 
117
- return AlphaFold(
118
- output_pdb_path=output_pdb_path, properties=properties, **kwargs
119
- ).launch()
120
-
121
-
122
- def main():
123
- """Command line execution of this building block. Please check the command line documentation."""
124
- parser = argparse.ArgumentParser(
125
- description="This class is a wrapper for downloading a PDB structure from the Protein Data Bank.",
126
- formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999),
127
- )
128
- parser.add_argument(
129
- "-c",
130
- "--config",
131
- required=False,
132
- help="This file can be a YAML file, JSON file or JSON string",
133
- )
134
-
135
- # Specific args of each building block
136
- required_args = parser.add_argument_group("required arguments")
137
- required_args.add_argument(
138
- "-o",
139
- "--output_pdb_path",
140
- required=True,
141
- help="Path to the output PDB file. Accepted formats: pdb.",
142
- )
143
-
144
- args = parser.parse_args()
145
- config = args.config if args.config else None
146
- properties = settings.ConfReader(config=config).get_prop_dic()
147
-
148
- # Specific call of each building block
149
- alphafold(output_pdb_path=args.output_pdb_path, properties=properties)
150
115
 
116
+ alphafold.__doc__ = AlphaFold.__doc__
117
+ main = AlphaFold.get_main(alphafold, "This class is a wrapper for downloading a PDB structure from the Protein Data Bank.")
151
118
 
152
119
  if __name__ == "__main__":
153
120
  main()
@@ -2,11 +2,8 @@
2
2
 
3
3
  """Module containing the ApiBindingSite class and the command line interface."""
4
4
 
5
- import argparse
6
5
  import json
7
6
  from typing import Optional
8
-
9
- from biobb_common.configuration import settings
10
7
  from biobb_common.generic.biobb_object import BiobbObject
11
8
  from biobb_common.tools import file_utils as fu
12
9
  from biobb_common.tools.file_utils import launchlogger
@@ -125,41 +122,11 @@ def api_binding_site(
125
122
  ) -> int:
126
123
  """Execute the :class:`ApiBindingSite <api.api_binding_site.ApiBindingSite>` class and
127
124
  execute the :meth:`launch() <api.api_binding_site.ApiBindingSite.launch>` method."""
125
+ return ApiBindingSite(**dict(locals())).launch()
128
126
 
129
- return ApiBindingSite(
130
- output_json_path=output_json_path, properties=properties, **kwargs
131
- ).launch()
132
-
133
-
134
- def main():
135
- """Command line execution of this building block. Please check the command line documentation."""
136
- parser = argparse.ArgumentParser(
137
- description="This class is a wrapper for the PDBe REST API Binding Sites endpoint",
138
- formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999),
139
- )
140
- parser.add_argument(
141
- "-c",
142
- "--config",
143
- required=False,
144
- help="This file can be a YAML file, JSON file or JSON string",
145
- )
146
-
147
- # Specific args of each building block
148
- required_args = parser.add_argument_group("required arguments")
149
- required_args.add_argument(
150
- "-o",
151
- "--output_json_path",
152
- required=True,
153
- help="Path to the JSON file with the binding sites for the requested structure. Accepted formats: json.",
154
- )
155
-
156
- args = parser.parse_args()
157
- config = args.config if args.config else None
158
- properties = settings.ConfReader(config=config).get_prop_dic()
159
-
160
- # Specific call of each building block
161
- api_binding_site(output_json_path=args.output_json_path, properties=properties)
162
127
 
128
+ api_binding_site.__doc__ = ApiBindingSite.__doc__
129
+ main = ApiBindingSite.get_main(api_binding_site, "This class is a wrapper for the PDBe REST API Binding Sites endpoint")
163
130
 
164
131
  if __name__ == "__main__":
165
132
  main()
@@ -2,10 +2,7 @@
2
2
 
3
3
  """Module containing the CanonicalFasta class and the command line interface."""
4
4
 
5
- import argparse
6
5
  from typing import Optional
7
-
8
- from biobb_common.configuration import settings
9
6
  from biobb_common.generic.biobb_object import BiobbObject
10
7
  from biobb_common.tools.file_utils import launchlogger
11
8
 
@@ -115,41 +112,11 @@ def canonical_fasta(
115
112
  ) -> int:
116
113
  """Execute the :class:`CanonicalFasta <api.canonical_fasta.CanonicalFasta>` class and
117
114
  execute the :meth:`launch() <api.canonical_fasta.CanonicalFasta.launch>` method."""
115
+ return CanonicalFasta(**dict(locals())).launch()
118
116
 
119
- return CanonicalFasta(
120
- output_fasta_path=output_fasta_path, properties=properties, **kwargs
121
- ).launch()
122
-
123
-
124
- def main():
125
- """Command line execution of this building block. Please check the command line documentation."""
126
- parser = argparse.ArgumentParser(
127
- description="This class is a wrapper for downloading a FASTA structure from the Protein Data Bank.",
128
- formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999),
129
- )
130
- parser.add_argument(
131
- "-c",
132
- "--config",
133
- required=False,
134
- help="This file can be a YAML file, JSON file or JSON string",
135
- )
136
-
137
- # Specific args of each building block
138
- required_args = parser.add_argument_group("required arguments")
139
- required_args.add_argument(
140
- "-o",
141
- "--output_fasta_path",
142
- required=True,
143
- help="Path to the canonical FASTA file. Accepted formats: fasta.",
144
- )
145
-
146
- args = parser.parse_args()
147
- config = args.config if args.config else None
148
- properties = settings.ConfReader(config=config).get_prop_dic()
149
-
150
- # Specific call of each building block
151
- canonical_fasta(output_fasta_path=args.output_fasta_path, properties=properties)
152
117
 
118
+ canonical_fasta.__doc__ = CanonicalFasta.__doc__
119
+ main = CanonicalFasta.get_main(canonical_fasta, "This class is a wrapper for downloading a FASTA structure from the Protein Data Bank.")
153
120
 
154
121
  if __name__ == "__main__":
155
122
  main()
@@ -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,60 @@ 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
+
124
+ def download_mddb_file(project_id, node_id, file_name, out_log=None, global_log=None, classname=None):
125
+ """
126
+ Returns:
127
+ String: Content of the trajectory file.
128
+ """
129
+
130
+ url = "https://" + node_id + ".mddbr.eu/api/rest/v1/projects/" + project_id + "/files/" + file_name
131
+
132
+ fu.log("Downloading %s file from: %s" % (project_id, url), out_log, global_log)
133
+
134
+ r = requests.get(url)
135
+ if r.status_code == 404:
136
+ fu.log(classname + ": Incorrect url, check project_id, node_id, trj_format, frames and selection: %s" % (url), out_log)
137
+ raise SystemExit(classname + ": Incorrect url, check project_id, node_id, trj_format, frames and selection: %s" % (url))
138
+
139
+ return r.content
140
+
141
+
87
142
  def download_mmcif(pdb_code, api_id, out_log=None, global_log=None):
88
143
  """
89
144
  Returns:
@@ -112,9 +167,7 @@ def download_ligand(ligand_code, api_id, out_log=None, global_log=None):
112
167
  text = requests.get(url, verify=True).content.decode("utf-8")
113
168
  elif api_id == "pdbe":
114
169
  url = (
115
- "https://www.ebi.ac.uk/pdbe/static/files/pdbechem_v2/"
116
- + ligand_code.upper()
117
- + "_ideal.pdb"
170
+ "https://www.ebi.ac.uk/pdbe/static/files/pdbechem_v2/" + ligand_code.upper() + "_ideal.pdb"
118
171
  )
119
172
  text = urllib.request.urlopen(url).read().decode("utf-8")
120
173
 
@@ -173,16 +226,12 @@ def download_ideal_sdf(ligand_code, api_id, out_log=None, global_log=None):
173
226
 
174
227
  if api_id == "pdb":
175
228
  url = (
176
- "https://files.rcsb.org/ligands/download/"
177
- + ligand_code.upper()
178
- + "_ideal.sdf"
229
+ "https://files.rcsb.org/ligands/download/" + ligand_code.upper() + "_ideal.sdf"
179
230
  )
180
231
  text = requests.get(url, verify=True).content.decode("utf-8")
181
232
  elif api_id == "pdbe":
182
233
  url = (
183
- "https://www.ebi.ac.uk/pdbe/static/files/pdbechem_v2/"
184
- + ligand_code.upper()
185
- + "_ideal.sdf"
234
+ "https://www.ebi.ac.uk/pdbe/static/files/pdbechem_v2/" + ligand_code.upper() + "_ideal.sdf"
186
235
  )
187
236
  text = urllib.request.urlopen(url).read().decode("utf-8")
188
237
 
@@ -230,6 +279,13 @@ def write_pdb(pdb_string, output_pdb_path, filt=None, out_log=None, global_log=N
230
279
  output_pdb_file.write(pdb_string)
231
280
 
232
281
 
282
+ def write_bin(bin_string, output_bin_path, out_log=None, global_log=None):
283
+ """Writes a BIN"""
284
+ fu.log("Writting bin to: %s" % (output_bin_path), out_log, global_log)
285
+ with open(output_bin_path, "wb") as output_bin_file:
286
+ output_bin_file.write(bin_string)
287
+
288
+
233
289
  def write_mmcif(mmcif_string, output_mmcif_path, out_log=None, global_log=None):
234
290
  """Writes a mmcif"""
235
291
  fu.log("Writting mmcif to: %s" % (output_mmcif_path), out_log, global_log)
@@ -268,22 +324,11 @@ def get_cluster_pdb_codes(pdb_code, cluster, out_log=None, global_log=None):
268
324
 
269
325
  if out_log:
270
326
  out_log.info(
271
- "Cluster: "
272
- + str(cluster)
273
- + " of pdb_code: "
274
- + pdb_code
275
- + "\n List: "
276
- + str(pdb_codes)
327
+ "Cluster: " + str(cluster) + " of pdb_code: " + pdb_code + "\n List: " + str(pdb_codes)
277
328
  )
278
329
  if global_log:
279
330
  global_log.info(
280
- fu.get_logs_prefix()
281
- + "Cluster: "
282
- + str(cluster)
283
- + " of pdb_code: "
284
- + pdb_code
285
- + "\n List: "
286
- + str(pdb_codes)
331
+ fu.get_logs_prefix() + "Cluster: " + str(cluster) + " of pdb_code: " + pdb_code + "\n List: " + str(pdb_codes)
287
332
  )
288
333
 
289
334
  return pdb_codes
@@ -395,9 +440,7 @@ def get_memprotmd_sim(pdb_code, output_file, out_log=None, global_log=None):
395
440
  fu.log("Getting simulation file from pdb code %s" % (pdb_code), out_log, global_log)
396
441
 
397
442
  url = (
398
- "http://memprotmd.bioch.ox.ac.uk/data/memprotmd/simulations/"
399
- + pdb_code
400
- + "_default_dppc/files/run/at.zip"
443
+ "http://memprotmd.bioch.ox.ac.uk/data/memprotmd/simulations/" + pdb_code + "_default_dppc/files/run/at.zip"
401
444
  )
402
445
  response = requests.get(url)
403
446
 
@@ -2,10 +2,7 @@
2
2
 
3
3
  """Module containing the IdealSdf class and the command line interface."""
4
4
 
5
- import argparse
6
5
  from typing import Optional
7
-
8
- from biobb_common.configuration import settings
9
6
  from biobb_common.generic.biobb_object import BiobbObject
10
7
  from biobb_common.tools.file_utils import launchlogger
11
8
 
@@ -113,41 +110,11 @@ class IdealSdf(BiobbObject):
113
110
  def ideal_sdf(output_sdf_path: str, properties: Optional[dict] = None, **kwargs) -> int:
114
111
  """Execute the :class:`IdealSdf <api.ideal_sdf.IdealSdf>` class and
115
112
  execute the :meth:`launch() <api.ideal_sdf.IdealSdf.launch>` method."""
113
+ return IdealSdf(**dict(locals())).launch()
116
114
 
117
- return IdealSdf(
118
- output_sdf_path=output_sdf_path, properties=properties, **kwargs
119
- ).launch()
120
-
121
-
122
- def main():
123
- """Command line execution of this building block. Please check the command line documentation."""
124
- parser = argparse.ArgumentParser(
125
- description="This class is a wrapper for downloading an ideal SDF ligand from the Protein Data Bank.",
126
- formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999),
127
- )
128
- parser.add_argument(
129
- "-c",
130
- "--config",
131
- required=False,
132
- help="This file can be a YAML file, JSON file or JSON string",
133
- )
134
-
135
- # Specific args of each building block
136
- required_args = parser.add_argument_group("required arguments")
137
- required_args.add_argument(
138
- "-o",
139
- "--output_sdf_path",
140
- required=True,
141
- help="Path to the output SDF file. Accepted formats: sdf.",
142
- )
143
-
144
- args = parser.parse_args()
145
- config = args.config if args.config else None
146
- properties = settings.ConfReader(config=config).get_prop_dic()
147
-
148
- # Specific call of each building block
149
- ideal_sdf(output_sdf_path=args.output_sdf_path, properties=properties)
150
115
 
116
+ ideal_sdf.__doc__ = IdealSdf.__doc__
117
+ main = IdealSdf.get_main(ideal_sdf, "This class is a wrapper for downloading an ideal SDF ligand from the Protein Data Bank.")
151
118
 
152
119
  if __name__ == "__main__":
153
120
  main()