biobb-io 5.0.0__py3-none-any.whl → 5.0.1__py3-none-any.whl

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.
biobb_io/__init__.py CHANGED
@@ -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.0.1"
biobb_io/api/__init__.py CHANGED
@@ -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,
@@ -17,7 +16,6 @@ from . import (
17
16
 
18
17
  name = "api"
19
18
  __all__ = [
20
- "drugbank",
21
19
  "ligand",
22
20
  "pdb",
23
21
  "alphafold",
biobb_io/api/common.py CHANGED
@@ -143,25 +143,6 @@ def download_fasta(pdb_code, api_id, out_log=None, global_log=None):
143
143
  return requests.get(url, verify=True).content.decode("utf-8")
144
144
 
145
145
 
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
146
  def download_binding_site(
166
147
  pdb_code,
167
148
  url="https://www.ebi.ac.uk/pdbe/api/pdb/entry/binding_sites/%s",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: biobb_io
3
- Version: 5.0.0
3
+ Version: 5.0.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
@@ -24,7 +24,7 @@ Requires-Dist: biobb-common==5.0.0
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.0.1--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.0.1 2024.2
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.0.1"
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.0.1"
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.0.1--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.0.1--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.0.1--pyhdfd78af_0
109
109
 
110
110
 
111
111
  * Usage:
@@ -1,11 +1,10 @@
1
- biobb_io/__init__.py,sha256=u4wwu8481yYlqD4TJ-BbjFb1wPRB8WaU-uCtpYkmjsY,77
1
+ biobb_io/__init__.py,sha256=5fB4i9qgGOZ0ZrZRiZrdxgVxzntL56ErhlDSvnqqnP8,77
2
2
  biobb_io/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- biobb_io/api/__init__.py,sha256=N_LYOBpatHnyZOKo9p3Klx75yD9tWMGx6ZM9XaO3cCM,568
3
+ biobb_io/api/__init__.py,sha256=fR17sA2mh78x2NoyM25XN3vlsjka4aNubzaP4SvpCDc,538
4
4
  biobb_io/api/alphafold.py,sha256=e_5N0yntKTjI-Sd9cM1IGv56FwlD1HqeODXooSLmSBg,5402
5
5
  biobb_io/api/api_binding_site.py,sha256=cu6McFh1e75J8JMaZHjnfiK2ljQVOsREsXH3ZvOyUyU,5884
6
6
  biobb_io/api/canonical_fasta.py,sha256=DTwvoV8yY_xX_X3E9PbhucNaLk21jJ-K_34db1p9SOU,5785
7
- biobb_io/api/common.py,sha256=U2HGW7D4vf5SyRCE2vXPe0zAWkaA3aH5kkWRG8GkTFw,13819
8
- biobb_io/api/drugbank.py,sha256=emortzx57bBD69nUSVnznNNqwqJ-pi-6SNGm2VXhHaI,5260
7
+ biobb_io/api/common.py,sha256=TQD3oSWL-WtXxJHnNp9469Iun-REqFeAb8dmKWU3UJc,13384
9
8
  biobb_io/api/ideal_sdf.py,sha256=MxNiFLoQU0tF7k3mztDYHkIpmZ5s9Z0p4BI-NlTW7Dc,5599
10
9
  biobb_io/api/ligand.py,sha256=_iFZWxuMPz2c0IOQPpeaBsvjsFcOr0wqtf0c6QICX2M,5654
11
10
  biobb_io/api/memprotmd_sim.py,sha256=bnZFaAMkMIYzS75VognyNh0H8F5gZCwQM1ErhLrrtWw,5167
@@ -17,9 +16,9 @@ biobb_io/api/pdb_cluster_zip.py,sha256=eml2QmX0NTUk8YkEwDPqSPu3ZjTtBqYUVl9r4eWtF
17
16
  biobb_io/api/pdb_variants.py,sha256=GbovaDIQZQDPiSQaHp1ohr_Ds3eucdkdLR7bcW3c7Q4,7969
18
17
  biobb_io/api/structure_info.py,sha256=VKy9lxMTpbkGMuxWoEwP9NLwdw8AapLFutHs8J0qgjA,5503
19
18
  biobb_io/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- biobb_io-5.0.0.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
21
- biobb_io-5.0.0.dist-info/METADATA,sha256=EIU79yXiA3RJHh66BTgpXvky13Xdc4uGVDI8ty0iU5M,6713
22
- biobb_io-5.0.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
23
- biobb_io-5.0.0.dist-info/entry_points.txt,sha256=oksijOyG3dbONd1oOcNd5VDcGaHufkIk11ubPka8fJg,652
24
- biobb_io-5.0.0.dist-info/top_level.txt,sha256=1VPldlX2AnFaqODGFJK10WN8AOQuulpX88bLSaQdoS8,9
25
- biobb_io-5.0.0.dist-info/RECORD,,
19
+ biobb_io-5.0.1.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
20
+ biobb_io-5.0.1.dist-info/METADATA,sha256=fbV5Ca_iWW37qv4RVIsre4cCvwBx7BPtwUGWduZBsk4,6713
21
+ biobb_io-5.0.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
22
+ biobb_io-5.0.1.dist-info/entry_points.txt,sha256=UdQz4F28f13ergWXqKMrx15mH05nX7G85xBaP8W2Wdw,614
23
+ biobb_io-5.0.1.dist-info/top_level.txt,sha256=1VPldlX2AnFaqODGFJK10WN8AOQuulpX88bLSaQdoS8,9
24
+ biobb_io-5.0.1.dist-info/RECORD,,
@@ -2,7 +2,6 @@
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
8
7
  memprotmd_sim = biobb_io.api.memprotmd_sim:main
biobb_io/api/drugbank.py DELETED
@@ -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()