biobb-io 4.0.0__tar.gz → 4.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.
- {biobb_io-4.0.0 → biobb_io-4.1.1}/PKG-INFO +24 -14
- {biobb_io-4.0.0 → biobb_io-4.1.1}/README.md +17 -10
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io/__init__.py +1 -1
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io/api/__init__.py +1 -1
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io/api/alphafold.py +17 -15
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io/api/api_binding_site.py +22 -17
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io/api/canonical_fasta.py +19 -17
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io/api/common.py +46 -22
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io/api/drugbank.py +20 -18
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io/api/ideal_sdf.py +19 -17
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io/api/ligand.py +24 -22
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io/api/memprotmd_sim.py +19 -17
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io/api/memprotmd_sim_list.py +14 -12
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io/api/memprotmd_sim_search.py +19 -17
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io/api/mmcif.py +19 -17
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io/api/pdb.py +19 -17
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io/api/pdb_cluster_zip.py +26 -23
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io/api/pdb_variants.py +20 -17
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io/api/structure_info.py +18 -16
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io.egg-info/PKG-INFO +24 -14
- biobb_io-4.1.1/biobb_io.egg-info/requires.txt +1 -0
- {biobb_io-4.0.0 → biobb_io-4.1.1}/setup.py +8 -6
- biobb_io-4.0.0/biobb_io.egg-info/requires.txt +0 -1
- {biobb_io-4.0.0 → biobb_io-4.1.1}/LICENSE +0 -0
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io/test/__init__.py +0 -0
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io.egg-info/SOURCES.txt +0 -0
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io.egg-info/dependency_links.txt +0 -0
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io.egg-info/entry_points.txt +0 -0
- {biobb_io-4.0.0 → biobb_io-4.1.1}/biobb_io.egg-info/top_level.txt +0 -0
- {biobb_io-4.0.0 → biobb_io-4.1.1}/setup.cfg +0 -0
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: biobb_io
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.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
|
|
7
7
|
Author-email: pau.andrio@bsc.es
|
|
8
|
-
Project-URL: Documentation, http://
|
|
8
|
+
Project-URL: Documentation, http://biobb-io.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
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
15
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
16
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
15
17
|
Classifier: Operating System :: POSIX
|
|
16
|
-
Requires-Python: >=3.
|
|
18
|
+
Requires-Python: >=3.8
|
|
17
19
|
Description-Content-Type: text/markdown
|
|
18
20
|
License-File: LICENSE
|
|
21
|
+
Requires-Dist: biobb_common==4.1.0
|
|
19
22
|
|
|
20
23
|
[](https://GitHub.com/bioexcel/biobb_io/tags/)
|
|
21
24
|
[](https://pypi.python.org/pypi/biobb-io/)
|
|
22
25
|
[](https://anaconda.org/bioconda/biobb_io)
|
|
23
26
|
[](https://anaconda.org/bioconda/biobb_io)
|
|
24
27
|
[](https://quay.io/repository/biocontainers/biobb_io?tab=tags)
|
|
25
|
-
[](https://depot.galaxyproject.org/singularity/biobb_io:4.
|
|
28
|
+
[](https://depot.galaxyproject.org/singularity/biobb_io:4.1.1--pyhdfd78af_0)
|
|
26
29
|
|
|
27
30
|
[](https://github.com/bioexcel/biobb_io)
|
|
28
31
|
[](https://pypi.org/project/biobb-io/)
|
|
@@ -41,6 +44,13 @@ License-File: LICENSE
|
|
|
41
44
|
[](https://github.com/bioexcel/biobb_io/commits/master)
|
|
42
45
|
[](https://GitHub.com/bioexcel/biobb_io/issues/)
|
|
43
46
|
|
|
47
|
+
[](https://fair-software.eu)
|
|
48
|
+
[](https://www.bestpractices.dev/projects/8847)
|
|
49
|
+
|
|
50
|
+
[](https://bestpractices.coreinfrastructure.org/projects/8847/badge)
|
|
51
|
+
|
|
52
|
+
[//]: # (The previous line invisible link is for compatibility with the howfairis script https://github.com/fair-software/howfairis-github-action/tree/main wich uses the old bestpractices URL)
|
|
53
|
+
|
|
44
54
|
# biobb_io
|
|
45
55
|
|
|
46
56
|
### Introduction
|
|
@@ -50,10 +60,10 @@ Biobb (BioExcel building blocks) packages are Python building blocks that
|
|
|
50
60
|
create new layer of compatibility and interoperability over popular
|
|
51
61
|
bioinformatics tools.
|
|
52
62
|
The latest documentation of this package can be found in our readthedocs site:
|
|
53
|
-
[latest API documentation](http://
|
|
63
|
+
[latest API documentation](http://biobb-io.readthedocs.io/en/latest/).
|
|
54
64
|
|
|
55
65
|
### Version
|
|
56
|
-
v4.
|
|
66
|
+
v4.1.1 2024.1
|
|
57
67
|
|
|
58
68
|
### Installation
|
|
59
69
|
Using PIP:
|
|
@@ -62,7 +72,7 @@ Using PIP:
|
|
|
62
72
|
|
|
63
73
|
* Installation:
|
|
64
74
|
|
|
65
|
-
pip install "biobb_io==4.
|
|
75
|
+
pip install "biobb_io==4.1.1"
|
|
66
76
|
|
|
67
77
|
* Usage: [Python API documentation](https://biobb-io.readthedocs.io/en/latest/modules.html)
|
|
68
78
|
|
|
@@ -70,7 +80,7 @@ Using ANACONDA:
|
|
|
70
80
|
* Installation:
|
|
71
81
|
|
|
72
82
|
|
|
73
|
-
conda install -c bioconda "biobb_io==4.
|
|
83
|
+
conda install -c bioconda "biobb_io==4.1.1"
|
|
74
84
|
|
|
75
85
|
|
|
76
86
|
* 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)
|
|
@@ -79,12 +89,12 @@ Using DOCKER:
|
|
|
79
89
|
* Installation:
|
|
80
90
|
|
|
81
91
|
|
|
82
|
-
docker pull quay.io/biocontainers/biobb_io:4.
|
|
92
|
+
docker pull quay.io/biocontainers/biobb_io:4.1.1--pyhdfd78af_0
|
|
83
93
|
|
|
84
94
|
* Usage:
|
|
85
95
|
|
|
86
96
|
|
|
87
|
-
docker run quay.io/biocontainers/biobb_io:4.
|
|
97
|
+
docker run quay.io/biocontainers/biobb_io:4.1.1--pyhdfd78af_0 <command>
|
|
88
98
|
|
|
89
99
|
|
|
90
100
|
The command list and specification can be found at the [Command Line documentation](https://biobb-io.readthedocs.io/en/latest/command_line.html).
|
|
@@ -96,7 +106,7 @@ Using SINGULARITY:
|
|
|
96
106
|
* Installation:
|
|
97
107
|
|
|
98
108
|
|
|
99
|
-
singularity pull --name biobb_io.sif https://depot.galaxyproject.org/singularity/biobb_io:4.
|
|
109
|
+
singularity pull --name biobb_io.sif https://depot.galaxyproject.org/singularity/biobb_io:4.1.1--pyhdfd78af_0
|
|
100
110
|
|
|
101
111
|
|
|
102
112
|
* Usage:
|
|
@@ -111,8 +121,8 @@ The command list and specification can be found at the [Command Line documentati
|
|
|
111
121
|
### Copyright & Licensing
|
|
112
122
|
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)).
|
|
113
123
|
|
|
114
|
-
* (c) 2015-
|
|
115
|
-
* (c) 2015-
|
|
124
|
+
* (c) 2015-2024 [Barcelona Supercomputing Center](https://www.bsc.es/)
|
|
125
|
+
* (c) 2015-2024 [Institute for Research in Biomedicine](https://www.irbbarcelona.org/)
|
|
116
126
|
|
|
117
127
|
Licensed under the
|
|
118
128
|
[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://anaconda.org/bioconda/biobb_io)
|
|
4
4
|
[](https://anaconda.org/bioconda/biobb_io)
|
|
5
5
|
[](https://quay.io/repository/biocontainers/biobb_io?tab=tags)
|
|
6
|
-
[](https://depot.galaxyproject.org/singularity/biobb_io:4.
|
|
6
|
+
[](https://depot.galaxyproject.org/singularity/biobb_io:4.1.1--pyhdfd78af_0)
|
|
7
7
|
|
|
8
8
|
[](https://github.com/bioexcel/biobb_io)
|
|
9
9
|
[](https://pypi.org/project/biobb-io/)
|
|
@@ -22,6 +22,13 @@
|
|
|
22
22
|
[](https://github.com/bioexcel/biobb_io/commits/master)
|
|
23
23
|
[](https://GitHub.com/bioexcel/biobb_io/issues/)
|
|
24
24
|
|
|
25
|
+
[](https://fair-software.eu)
|
|
26
|
+
[](https://www.bestpractices.dev/projects/8847)
|
|
27
|
+
|
|
28
|
+
[](https://bestpractices.coreinfrastructure.org/projects/8847/badge)
|
|
29
|
+
|
|
30
|
+
[//]: # (The previous line invisible link is for compatibility with the howfairis script https://github.com/fair-software/howfairis-github-action/tree/main wich uses the old bestpractices URL)
|
|
31
|
+
|
|
25
32
|
# biobb_io
|
|
26
33
|
|
|
27
34
|
### Introduction
|
|
@@ -31,10 +38,10 @@ Biobb (BioExcel building blocks) packages are Python building blocks that
|
|
|
31
38
|
create new layer of compatibility and interoperability over popular
|
|
32
39
|
bioinformatics tools.
|
|
33
40
|
The latest documentation of this package can be found in our readthedocs site:
|
|
34
|
-
[latest API documentation](http://
|
|
41
|
+
[latest API documentation](http://biobb-io.readthedocs.io/en/latest/).
|
|
35
42
|
|
|
36
43
|
### Version
|
|
37
|
-
v4.
|
|
44
|
+
v4.1.1 2024.1
|
|
38
45
|
|
|
39
46
|
### Installation
|
|
40
47
|
Using PIP:
|
|
@@ -43,7 +50,7 @@ Using PIP:
|
|
|
43
50
|
|
|
44
51
|
* Installation:
|
|
45
52
|
|
|
46
|
-
pip install "biobb_io==4.
|
|
53
|
+
pip install "biobb_io==4.1.1"
|
|
47
54
|
|
|
48
55
|
* Usage: [Python API documentation](https://biobb-io.readthedocs.io/en/latest/modules.html)
|
|
49
56
|
|
|
@@ -51,7 +58,7 @@ Using ANACONDA:
|
|
|
51
58
|
* Installation:
|
|
52
59
|
|
|
53
60
|
|
|
54
|
-
conda install -c bioconda "biobb_io==4.
|
|
61
|
+
conda install -c bioconda "biobb_io==4.1.1"
|
|
55
62
|
|
|
56
63
|
|
|
57
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)
|
|
@@ -60,12 +67,12 @@ Using DOCKER:
|
|
|
60
67
|
* Installation:
|
|
61
68
|
|
|
62
69
|
|
|
63
|
-
docker pull quay.io/biocontainers/biobb_io:4.
|
|
70
|
+
docker pull quay.io/biocontainers/biobb_io:4.1.1--pyhdfd78af_0
|
|
64
71
|
|
|
65
72
|
* Usage:
|
|
66
73
|
|
|
67
74
|
|
|
68
|
-
docker run quay.io/biocontainers/biobb_io:4.
|
|
75
|
+
docker run quay.io/biocontainers/biobb_io:4.1.1--pyhdfd78af_0 <command>
|
|
69
76
|
|
|
70
77
|
|
|
71
78
|
The command list and specification can be found at the [Command Line documentation](https://biobb-io.readthedocs.io/en/latest/command_line.html).
|
|
@@ -77,7 +84,7 @@ Using SINGULARITY:
|
|
|
77
84
|
* Installation:
|
|
78
85
|
|
|
79
86
|
|
|
80
|
-
singularity pull --name biobb_io.sif https://depot.galaxyproject.org/singularity/biobb_io:4.
|
|
87
|
+
singularity pull --name biobb_io.sif https://depot.galaxyproject.org/singularity/biobb_io:4.1.1--pyhdfd78af_0
|
|
81
88
|
|
|
82
89
|
|
|
83
90
|
* Usage:
|
|
@@ -92,8 +99,8 @@ The command list and specification can be found at the [Command Line documentati
|
|
|
92
99
|
### Copyright & Licensing
|
|
93
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)).
|
|
94
101
|
|
|
95
|
-
* (c) 2015-
|
|
96
|
-
* (c) 2015-
|
|
102
|
+
* (c) 2015-2024 [Barcelona Supercomputing Center](https://www.bsc.es/)
|
|
103
|
+
* (c) 2015-2024 [Institute for Research in Biomedicine](https://www.irbbarcelona.org/)
|
|
97
104
|
|
|
98
105
|
Licensed under the
|
|
99
106
|
[Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0), see the file LICENSE for details.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
name = "api"
|
|
2
|
-
__all__ = ["drugbank", "ligand", "pdb", "alphafold", "pdb_cluster_zip", "pdb_variants", "memprotmd_sim_list", "memprotmd_sim_search", "memprotmd_sim", "api_binding_site","canonical_fasta", "mmcif", "ideal_sdf", "structure_info"]
|
|
2
|
+
__all__ = ["drugbank", "ligand", "pdb", "alphafold", "pdb_cluster_zip", "pdb_variants", "memprotmd_sim_list", "memprotmd_sim_search", "memprotmd_sim", "api_binding_site", "canonical_fasta", "mmcif", "ideal_sdf", "structure_info"]
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
"""Module containing the AlphaFold class and the command line interface."""
|
|
4
4
|
import argparse
|
|
5
5
|
from biobb_common.generic.biobb_object import BiobbObject
|
|
6
|
-
from biobb_common.configuration import
|
|
7
|
-
from biobb_common.tools import file_utils as fu
|
|
6
|
+
from biobb_common.configuration import settings
|
|
8
7
|
from biobb_common.tools.file_utils import launchlogger
|
|
9
|
-
from biobb_io.api.common import
|
|
8
|
+
from biobb_io.api.common import check_output_path, check_mandatory_property, check_uniprot_code, download_af, write_pdb
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
class AlphaFold(BiobbObject):
|
|
@@ -26,10 +25,10 @@ class AlphaFold(BiobbObject):
|
|
|
26
25
|
This is a use example of how to use the building block from Python::
|
|
27
26
|
|
|
28
27
|
from biobb_io.api.alphafold import alphafold
|
|
29
|
-
prop = {
|
|
28
|
+
prop = {
|
|
30
29
|
'uniprot_code': 'P00489'
|
|
31
30
|
}
|
|
32
|
-
alphafold(output_pdb_path='/path/to/newStructure.pdb',
|
|
31
|
+
alphafold(output_pdb_path='/path/to/newStructure.pdb',
|
|
33
32
|
properties=prop)
|
|
34
33
|
|
|
35
34
|
Info:
|
|
@@ -42,8 +41,8 @@ class AlphaFold(BiobbObject):
|
|
|
42
41
|
|
|
43
42
|
"""
|
|
44
43
|
|
|
45
|
-
def __init__(self, output_pdb_path,
|
|
46
|
-
|
|
44
|
+
def __init__(self, output_pdb_path,
|
|
45
|
+
properties=None, **kwargs) -> None:
|
|
47
46
|
properties = properties or {}
|
|
48
47
|
|
|
49
48
|
# Call parent class constructor
|
|
@@ -51,8 +50,8 @@ class AlphaFold(BiobbObject):
|
|
|
51
50
|
self.locals_var_dict = locals().copy()
|
|
52
51
|
|
|
53
52
|
# Input/Output files
|
|
54
|
-
self.io_dict = {
|
|
55
|
-
"out": {
|
|
53
|
+
self.io_dict = {
|
|
54
|
+
"out": {"output_pdb_path": output_pdb_path}
|
|
56
55
|
}
|
|
57
56
|
|
|
58
57
|
# Properties specific for BB
|
|
@@ -70,13 +69,13 @@ class AlphaFold(BiobbObject):
|
|
|
70
69
|
@launchlogger
|
|
71
70
|
def launch(self) -> int:
|
|
72
71
|
"""Execute the :class:`AlphaFold <api.alphafold.AlphaFold>` api.alphafold.AlphaFold object."""
|
|
73
|
-
|
|
72
|
+
|
|
74
73
|
# check input/output paths and parameters
|
|
75
74
|
self.check_data_params(self.out_log, self.err_log)
|
|
76
75
|
|
|
77
76
|
# Setup Biobb
|
|
78
|
-
if self.check_restart():
|
|
79
|
-
|
|
77
|
+
if self.check_restart():
|
|
78
|
+
return 0
|
|
80
79
|
|
|
81
80
|
check_mandatory_property(self.uniprot_code, 'uniprot_code', self.out_log, self.__class__.__name__)
|
|
82
81
|
|
|
@@ -92,12 +91,14 @@ class AlphaFold(BiobbObject):
|
|
|
92
91
|
|
|
93
92
|
return 0
|
|
94
93
|
|
|
94
|
+
|
|
95
95
|
def alphafold(output_pdb_path: str, properties: dict = None, **kwargs) -> int:
|
|
96
96
|
"""Execute the :class:`AlphaFold <api.alphafold.AlphaFold>` class and
|
|
97
97
|
execute the :meth:`launch() <api.alphafold.AlphaFold.launch>` method."""
|
|
98
98
|
|
|
99
99
|
return AlphaFold(output_pdb_path=output_pdb_path,
|
|
100
|
-
|
|
100
|
+
properties=properties, **kwargs).launch()
|
|
101
|
+
|
|
101
102
|
|
|
102
103
|
def main():
|
|
103
104
|
"""Command line execution of this building block. Please check the command line documentation."""
|
|
@@ -113,8 +114,9 @@ def main():
|
|
|
113
114
|
properties = settings.ConfReader(config=config).get_prop_dic()
|
|
114
115
|
|
|
115
116
|
# Specific call of each building block
|
|
116
|
-
alphafold(output_pdb_path=args.output_pdb_path,
|
|
117
|
-
|
|
117
|
+
alphafold(output_pdb_path=args.output_pdb_path,
|
|
118
|
+
properties=properties)
|
|
119
|
+
|
|
118
120
|
|
|
119
121
|
if __name__ == '__main__':
|
|
120
122
|
main()
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
"""Module containing the ApiBindingSite class and the command line interface."""
|
|
4
4
|
import argparse
|
|
5
|
+
import json
|
|
5
6
|
from biobb_common.generic.biobb_object import BiobbObject
|
|
6
|
-
from biobb_common.configuration import
|
|
7
|
+
from biobb_common.configuration import settings
|
|
7
8
|
from biobb_common.tools import file_utils as fu
|
|
8
9
|
from biobb_common.tools.file_utils import launchlogger
|
|
9
|
-
from biobb_io.api.common import
|
|
10
|
+
from biobb_io.api.common import check_output_path, check_mandatory_property, download_binding_site, write_json
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class ApiBindingSite(BiobbObject):
|
|
@@ -26,10 +27,10 @@ class ApiBindingSite(BiobbObject):
|
|
|
26
27
|
This is a use example of how to use the building block from Python::
|
|
27
28
|
|
|
28
29
|
from biobb_io.api.api_binding_site import api_binding_site
|
|
29
|
-
prop = {
|
|
30
|
-
'pdb_code': '4i23'
|
|
30
|
+
prop = {
|
|
31
|
+
'pdb_code': '4i23'
|
|
31
32
|
}
|
|
32
|
-
api_binding_site(output_json_path='/path/to/newBindingSites.json',
|
|
33
|
+
api_binding_site(output_json_path='/path/to/newBindingSites.json',
|
|
33
34
|
properties=prop)
|
|
34
35
|
|
|
35
36
|
Info:
|
|
@@ -42,8 +43,8 @@ class ApiBindingSite(BiobbObject):
|
|
|
42
43
|
|
|
43
44
|
"""
|
|
44
45
|
|
|
45
|
-
def __init__(self, output_json_path,
|
|
46
|
-
|
|
46
|
+
def __init__(self, output_json_path,
|
|
47
|
+
properties=None, **kwargs) -> None:
|
|
47
48
|
properties = properties or {}
|
|
48
49
|
|
|
49
50
|
# Call parent class constructor
|
|
@@ -51,8 +52,8 @@ class ApiBindingSite(BiobbObject):
|
|
|
51
52
|
self.locals_var_dict = locals().copy()
|
|
52
53
|
|
|
53
54
|
# Input/Output files
|
|
54
|
-
self.io_dict = {
|
|
55
|
-
"out": {
|
|
55
|
+
self.io_dict = {
|
|
56
|
+
"out": {"output_json_path": output_json_path}
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
# Properties specific for BB
|
|
@@ -62,7 +63,7 @@ class ApiBindingSite(BiobbObject):
|
|
|
62
63
|
# Check the properties
|
|
63
64
|
self.check_properties(properties)
|
|
64
65
|
self.check_arguments()
|
|
65
|
-
|
|
66
|
+
|
|
66
67
|
def check_data_params(self, out_log, err_log):
|
|
67
68
|
""" Checks all the input/output paths and parameters """
|
|
68
69
|
self.output_json_path = check_output_path(self.io_dict["out"]["output_json_path"], "output_json_path", False, out_log, self.__class__.__name__)
|
|
@@ -75,8 +76,9 @@ class ApiBindingSite(BiobbObject):
|
|
|
75
76
|
self.check_data_params(self.out_log, self.err_log)
|
|
76
77
|
|
|
77
78
|
# Setup Biobb
|
|
78
|
-
if self.check_restart():
|
|
79
|
-
|
|
79
|
+
if self.check_restart():
|
|
80
|
+
return 0
|
|
81
|
+
# self.stage_files()
|
|
80
82
|
|
|
81
83
|
check_mandatory_property(self.pdb_code, 'pdb_code', self.out_log, self.__class__.__name__)
|
|
82
84
|
|
|
@@ -96,19 +98,21 @@ class ApiBindingSite(BiobbObject):
|
|
|
96
98
|
|
|
97
99
|
return 0
|
|
98
100
|
|
|
101
|
+
|
|
99
102
|
def api_binding_site(output_json_path: str, properties: dict = None, **kwargs) -> int:
|
|
100
103
|
"""Execute the :class:`ApiBindingSite <api.api_binding_site.ApiBindingSite>` class and
|
|
101
104
|
execute the :meth:`launch() <api.api_binding_site.ApiBindingSite.launch>` method."""
|
|
102
105
|
|
|
103
106
|
return ApiBindingSite(output_json_path=output_json_path,
|
|
104
|
-
|
|
107
|
+
properties=properties, **kwargs).launch()
|
|
108
|
+
|
|
105
109
|
|
|
106
110
|
def main():
|
|
107
111
|
"""Command line execution of this building block. Please check the command line documentation."""
|
|
108
112
|
parser = argparse.ArgumentParser(description="This class is a wrapper for the PDBe REST API Binding Sites endpoint", formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999))
|
|
109
113
|
parser.add_argument('-c', '--config', required=False, help="This file can be a YAML file, JSON file or JSON string")
|
|
110
114
|
|
|
111
|
-
#Specific args of each building block
|
|
115
|
+
# Specific args of each building block
|
|
112
116
|
required_args = parser.add_argument_group('required arguments')
|
|
113
117
|
required_args.add_argument('-o', '--output_json_path', required=True, help="Path to the JSON file with the binding sites for the requested structure. Accepted formats: json.")
|
|
114
118
|
|
|
@@ -116,9 +120,10 @@ def main():
|
|
|
116
120
|
config = args.config if args.config else None
|
|
117
121
|
properties = settings.ConfReader(config=config).get_prop_dic()
|
|
118
122
|
|
|
119
|
-
#Specific call of each building block
|
|
120
|
-
api_binding_site(output_json_path=args.output_json_path,
|
|
121
|
-
|
|
123
|
+
# Specific call of each building block
|
|
124
|
+
api_binding_site(output_json_path=args.output_json_path,
|
|
125
|
+
properties=properties)
|
|
126
|
+
|
|
122
127
|
|
|
123
128
|
if __name__ == '__main__':
|
|
124
129
|
main()
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
"""Module containing the CanonicalFasta class and the command line interface."""
|
|
4
4
|
import argparse
|
|
5
5
|
from biobb_common.generic.biobb_object import BiobbObject
|
|
6
|
-
from biobb_common.configuration import
|
|
7
|
-
from biobb_common.tools import file_utils as fu
|
|
6
|
+
from biobb_common.configuration import settings
|
|
8
7
|
from biobb_common.tools.file_utils import launchlogger
|
|
9
|
-
from biobb_io.api.common import
|
|
8
|
+
from biobb_io.api.common import check_output_path, check_mandatory_property, download_fasta, write_fasta
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
class CanonicalFasta(BiobbObject):
|
|
@@ -27,11 +26,11 @@ class CanonicalFasta(BiobbObject):
|
|
|
27
26
|
This is a use example of how to use the building block from Python::
|
|
28
27
|
|
|
29
28
|
from biobb_io.api.canonical_fasta import canonical_fasta
|
|
30
|
-
prop = {
|
|
29
|
+
prop = {
|
|
31
30
|
'pdb_code': '4i23',
|
|
32
31
|
'api_id': 'pdb'
|
|
33
32
|
}
|
|
34
|
-
canonical_fasta(output_fasta_path='/path/to/newFasta.fasta',
|
|
33
|
+
canonical_fasta(output_fasta_path='/path/to/newFasta.fasta',
|
|
35
34
|
properties=prop)
|
|
36
35
|
|
|
37
36
|
Info:
|
|
@@ -44,8 +43,8 @@ class CanonicalFasta(BiobbObject):
|
|
|
44
43
|
|
|
45
44
|
"""
|
|
46
45
|
|
|
47
|
-
def __init__(self, output_fasta_path,
|
|
48
|
-
|
|
46
|
+
def __init__(self, output_fasta_path,
|
|
47
|
+
properties=None, **kwargs) -> None:
|
|
49
48
|
properties = properties or {}
|
|
50
49
|
|
|
51
50
|
# Call parent class constructor
|
|
@@ -53,8 +52,8 @@ class CanonicalFasta(BiobbObject):
|
|
|
53
52
|
self.locals_var_dict = locals().copy()
|
|
54
53
|
|
|
55
54
|
# Input/Output files
|
|
56
|
-
self.io_dict = {
|
|
57
|
-
"out": {
|
|
55
|
+
self.io_dict = {
|
|
56
|
+
"out": {"output_fasta_path": output_fasta_path}
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
# Properties specific for BB
|
|
@@ -65,7 +64,7 @@ class CanonicalFasta(BiobbObject):
|
|
|
65
64
|
# Check the properties
|
|
66
65
|
self.check_properties(properties)
|
|
67
66
|
self.check_arguments()
|
|
68
|
-
|
|
67
|
+
|
|
69
68
|
def check_data_params(self, out_log, err_log):
|
|
70
69
|
""" Checks all the input/output paths and parameters """
|
|
71
70
|
self.output_fasta_path = check_output_path(self.io_dict["out"]["output_fasta_path"], "output_fasta_path", False, out_log, self.__class__.__name__)
|
|
@@ -78,8 +77,8 @@ class CanonicalFasta(BiobbObject):
|
|
|
78
77
|
self.check_data_params(self.out_log, self.err_log)
|
|
79
78
|
|
|
80
79
|
# Setup Biobb
|
|
81
|
-
if self.check_restart():
|
|
82
|
-
|
|
80
|
+
if self.check_restart():
|
|
81
|
+
return 0
|
|
83
82
|
|
|
84
83
|
check_mandatory_property(self.pdb_code, 'pdb_code', self.out_log, self.__class__.__name__)
|
|
85
84
|
|
|
@@ -93,19 +92,21 @@ class CanonicalFasta(BiobbObject):
|
|
|
93
92
|
|
|
94
93
|
return 0
|
|
95
94
|
|
|
95
|
+
|
|
96
96
|
def canonical_fasta(output_fasta_path: str, properties: dict = None, **kwargs) -> int:
|
|
97
97
|
"""Execute the :class:`CanonicalFasta <api.canonical_fasta.CanonicalFasta>` class and
|
|
98
98
|
execute the :meth:`launch() <api.canonical_fasta.CanonicalFasta.launch>` method."""
|
|
99
99
|
|
|
100
100
|
return CanonicalFasta(output_fasta_path=output_fasta_path,
|
|
101
|
-
|
|
101
|
+
properties=properties, **kwargs).launch()
|
|
102
|
+
|
|
102
103
|
|
|
103
104
|
def main():
|
|
104
105
|
"""Command line execution of this building block. Please check the command line documentation."""
|
|
105
106
|
parser = argparse.ArgumentParser(description="This class is a wrapper for downloading a FASTA structure from the Protein Data Bank.", formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999))
|
|
106
107
|
parser.add_argument('-c', '--config', required=False, help="This file can be a YAML file, JSON file or JSON string")
|
|
107
108
|
|
|
108
|
-
#Specific args of each building block
|
|
109
|
+
# Specific args of each building block
|
|
109
110
|
required_args = parser.add_argument_group('required arguments')
|
|
110
111
|
required_args.add_argument('-o', '--output_fasta_path', required=True, help="Path to the canonical FASTA file. Accepted formats: fasta.")
|
|
111
112
|
|
|
@@ -113,9 +114,10 @@ def main():
|
|
|
113
114
|
config = args.config if args.config else None
|
|
114
115
|
properties = settings.ConfReader(config=config).get_prop_dic()
|
|
115
116
|
|
|
116
|
-
#Specific call of each building block
|
|
117
|
-
canonical_fasta(output_fasta_path=args.output_fasta_path,
|
|
118
|
-
|
|
117
|
+
# Specific call of each building block
|
|
118
|
+
canonical_fasta(output_fasta_path=args.output_fasta_path,
|
|
119
|
+
properties=properties)
|
|
120
|
+
|
|
119
121
|
|
|
120
122
|
if __name__ == '__main__':
|
|
121
123
|
main()
|