biobb-io 4.0.0__py3-none-any.whl → 4.1.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 +1 -1
- biobb_io/api/__init__.py +1 -1
- biobb_io/api/alphafold.py +17 -15
- biobb_io/api/api_binding_site.py +22 -17
- biobb_io/api/canonical_fasta.py +19 -17
- biobb_io/api/common.py +46 -22
- biobb_io/api/drugbank.py +20 -18
- biobb_io/api/ideal_sdf.py +19 -17
- biobb_io/api/ligand.py +24 -22
- biobb_io/api/memprotmd_sim.py +19 -17
- biobb_io/api/memprotmd_sim_list.py +14 -12
- biobb_io/api/memprotmd_sim_search.py +19 -17
- biobb_io/api/mmcif.py +19 -17
- biobb_io/api/pdb.py +19 -17
- biobb_io/api/pdb_cluster_zip.py +26 -23
- biobb_io/api/pdb_variants.py +20 -17
- biobb_io/api/structure_info.py +18 -16
- {biobb_io-4.0.0.dist-info → biobb_io-4.1.1.dist-info}/METADATA +24 -15
- biobb_io-4.1.1.dist-info/RECORD +24 -0
- {biobb_io-4.0.0.dist-info → biobb_io-4.1.1.dist-info}/WHEEL +1 -1
- biobb_io-4.0.0.dist-info/RECORD +0 -24
- {biobb_io-4.0.0.dist-info → biobb_io-4.1.1.dist-info}/LICENSE +0 -0
- {biobb_io-4.0.0.dist-info → biobb_io-4.1.1.dist-info}/entry_points.txt +0 -0
- {biobb_io-4.0.0.dist-info → biobb_io-4.1.1.dist-info}/top_level.txt +0 -0
biobb_io/api/drugbank.py
CHANGED
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
"""Module containing the Drugbank 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_drugbank, write_sdf
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
class Drugbank(BiobbObject):
|
|
@@ -26,10 +25,10 @@ class Drugbank(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.drugbank import drugbank
|
|
29
|
-
prop = {
|
|
30
|
-
'drugbank_id': 'DB00530'
|
|
28
|
+
prop = {
|
|
29
|
+
'drugbank_id': 'DB00530'
|
|
31
30
|
}
|
|
32
|
-
drugbank(output_sdf_path='/path/to/newComponent.sdf',
|
|
31
|
+
drugbank(output_sdf_path='/path/to/newComponent.sdf',
|
|
33
32
|
properties=prop)
|
|
34
33
|
|
|
35
34
|
Info:
|
|
@@ -42,8 +41,8 @@ class Drugbank(BiobbObject):
|
|
|
42
41
|
|
|
43
42
|
"""
|
|
44
43
|
|
|
45
|
-
def __init__(self, output_sdf_path,
|
|
46
|
-
|
|
44
|
+
def __init__(self, output_sdf_path,
|
|
45
|
+
properties=None, **kwargs) -> None:
|
|
47
46
|
properties = properties or {}
|
|
48
47
|
|
|
49
48
|
# Call parent class constructor
|
|
@@ -51,8 +50,8 @@ class Drugbank(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_sdf_path": output_sdf_path}
|
|
56
55
|
}
|
|
57
56
|
|
|
58
57
|
# Properties specific for BB
|
|
@@ -62,7 +61,7 @@ class Drugbank(BiobbObject):
|
|
|
62
61
|
# Check the properties
|
|
63
62
|
self.check_properties(properties)
|
|
64
63
|
self.check_arguments()
|
|
65
|
-
|
|
64
|
+
|
|
66
65
|
def check_data_params(self, out_log, err_log):
|
|
67
66
|
""" Checks all the input/output paths and parameters """
|
|
68
67
|
self.output_sdf_path = check_output_path(self.io_dict["out"]["output_sdf_path"], "output_sdf_path", False, out_log, self.__class__.__name__)
|
|
@@ -75,15 +74,15 @@ class Drugbank(BiobbObject):
|
|
|
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.drugbank_id, 'drugbank_id', self.out_log, self.__class__.__name__)
|
|
82
81
|
|
|
83
82
|
self.drugbank_id = self.drugbank_id.strip().lower()
|
|
84
83
|
url = "https://www.drugbank.ca/structures/small_molecule_drugs/%s.sdf?type=3d"
|
|
85
84
|
|
|
86
|
-
#Downloading SDF file
|
|
85
|
+
# Downloading SDF file
|
|
87
86
|
sdf_string = download_drugbank(self.drugbank_id, url, self.out_log, self.global_log)
|
|
88
87
|
write_sdf(sdf_string, self.output_sdf_path, self.out_log, self.global_log)
|
|
89
88
|
|
|
@@ -91,6 +90,7 @@ class Drugbank(BiobbObject):
|
|
|
91
90
|
|
|
92
91
|
return 0
|
|
93
92
|
|
|
93
|
+
|
|
94
94
|
def drugbank(output_sdf_path: str, properties: dict = None, **kwargs) -> int:
|
|
95
95
|
"""Execute the :class:`Drugbank <api.drugbank.Drugbank>` class and
|
|
96
96
|
execute the :meth:`launch() <api.drugbank.Drugbank.launch>` method."""
|
|
@@ -98,12 +98,13 @@ def drugbank(output_sdf_path: str, properties: dict = None, **kwargs) -> int:
|
|
|
98
98
|
return Drugbank(output_sdf_path=output_sdf_path,
|
|
99
99
|
properties=properties, **kwargs).launch()
|
|
100
100
|
|
|
101
|
+
|
|
101
102
|
def main():
|
|
102
103
|
"""Command line execution of this building block. Please check the command line documentation."""
|
|
103
104
|
parser = argparse.ArgumentParser(description="Download a component in SDF format from the Drugbank (https://www.drugbank.ca/).", formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999))
|
|
104
105
|
parser.add_argument('-c', '--config', required=False, help="This file can be a YAML file, JSON file or JSON string")
|
|
105
106
|
|
|
106
|
-
#Specific args of each building block
|
|
107
|
+
# Specific args of each building block
|
|
107
108
|
required_args = parser.add_argument_group('required arguments')
|
|
108
109
|
required_args.add_argument('-o', '--output_sdf_path', required=True, help="Path to the output SDF component file. Accepted formats: sdf.")
|
|
109
110
|
|
|
@@ -111,9 +112,10 @@ def main():
|
|
|
111
112
|
config = args.config if args.config else None
|
|
112
113
|
properties = settings.ConfReader(config=config).get_prop_dic()
|
|
113
114
|
|
|
114
|
-
#Specific call of each building block
|
|
115
|
-
drugbank(output_sdf_path=args.output_sdf_path,
|
|
116
|
-
|
|
115
|
+
# Specific call of each building block
|
|
116
|
+
drugbank(output_sdf_path=args.output_sdf_path,
|
|
117
|
+
properties=properties)
|
|
118
|
+
|
|
117
119
|
|
|
118
120
|
if __name__ == '__main__':
|
|
119
121
|
main()
|
biobb_io/api/ideal_sdf.py
CHANGED
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
"""Module containing the IdealSdf 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_ideal_sdf, write_sdf
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
class IdealSdf(BiobbObject):
|
|
@@ -27,11 +26,11 @@ class IdealSdf(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.ideal_sdf import ideal_sdf
|
|
30
|
-
prop = {
|
|
31
|
-
'ligand_code': 'HYZ',
|
|
32
|
-
'api_id': 'pdbe'
|
|
29
|
+
prop = {
|
|
30
|
+
'ligand_code': 'HYZ',
|
|
31
|
+
'api_id': 'pdbe'
|
|
33
32
|
}
|
|
34
|
-
ideal_sdf(output_sdf_path='/path/to/newStructure.sdf',
|
|
33
|
+
ideal_sdf(output_sdf_path='/path/to/newStructure.sdf',
|
|
35
34
|
properties=prop)
|
|
36
35
|
|
|
37
36
|
Info:
|
|
@@ -44,8 +43,8 @@ class IdealSdf(BiobbObject):
|
|
|
44
43
|
|
|
45
44
|
"""
|
|
46
45
|
|
|
47
|
-
def __init__(self, output_sdf_path,
|
|
48
|
-
|
|
46
|
+
def __init__(self, output_sdf_path,
|
|
47
|
+
properties=None, **kwargs) -> None:
|
|
49
48
|
properties = properties or {}
|
|
50
49
|
|
|
51
50
|
# Call parent class constructor
|
|
@@ -53,8 +52,8 @@ class IdealSdf(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_sdf_path": output_sdf_path}
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
# Properties specific for BB
|
|
@@ -73,13 +72,13 @@ class IdealSdf(BiobbObject):
|
|
|
73
72
|
@launchlogger
|
|
74
73
|
def launch(self) -> int:
|
|
75
74
|
"""Execute the :class:`IdealSdf <api.ideal_sdf.IdealSdf>` api.ideal_sdf.IdealSdf object."""
|
|
76
|
-
|
|
75
|
+
|
|
77
76
|
# check input/output paths and parameters
|
|
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.ligand_code, 'ligand_code', self.out_log, self.__class__.__name__)
|
|
85
84
|
|
|
@@ -93,12 +92,14 @@ class IdealSdf(BiobbObject):
|
|
|
93
92
|
|
|
94
93
|
return 0
|
|
95
94
|
|
|
95
|
+
|
|
96
96
|
def ideal_sdf(output_sdf_path: str, properties: dict = None, **kwargs) -> int:
|
|
97
97
|
"""Execute the :class:`IdealSdf <api.ideal_sdf.IdealSdf>` class and
|
|
98
98
|
execute the :meth:`launch() <api.ideal_sdf.IdealSdf.launch>` method."""
|
|
99
99
|
|
|
100
100
|
return IdealSdf(output_sdf_path=output_sdf_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."""
|
|
@@ -114,8 +115,9 @@ def main():
|
|
|
114
115
|
properties = settings.ConfReader(config=config).get_prop_dic()
|
|
115
116
|
|
|
116
117
|
# Specific call of each building block
|
|
117
|
-
ideal_sdf(output_sdf_path=args.output_sdf_path,
|
|
118
|
-
|
|
118
|
+
ideal_sdf(output_sdf_path=args.output_sdf_path,
|
|
119
|
+
properties=properties)
|
|
120
|
+
|
|
119
121
|
|
|
120
122
|
if __name__ == '__main__':
|
|
121
123
|
main()
|
biobb_io/api/ligand.py
CHANGED
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
"""Module containing the Ligand 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_ligand, write_pdb
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
class Ligand(BiobbObject):
|
|
@@ -19,7 +18,7 @@ class Ligand(BiobbObject):
|
|
|
19
18
|
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).
|
|
20
19
|
properties (dic - Python dictionary object containing the tool parameters, not input/output files):
|
|
21
20
|
* **ligand_code** (*str*) - (None) RSCB PDB ligand code.
|
|
22
|
-
* **api_id** (*str*) - ("
|
|
21
|
+
* **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/>`_).
|
|
23
22
|
* **remove_tmp** (*bool*) - (True) [WF property] Remove temporal files.
|
|
24
23
|
* **restart** (*bool*) - (False) [WF property] Do not execute if output files exist.
|
|
25
24
|
|
|
@@ -27,11 +26,11 @@ class Ligand(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.ligand import ligand
|
|
30
|
-
prop = {
|
|
31
|
-
'ligand_code': 'CPB',
|
|
32
|
-
'api_id': '
|
|
29
|
+
prop = {
|
|
30
|
+
'ligand_code': 'CPB',
|
|
31
|
+
'api_id': 'mmb'
|
|
33
32
|
}
|
|
34
|
-
ligand(output_pdb_path='/path/to/newLigand.pdb',
|
|
33
|
+
ligand(output_pdb_path='/path/to/newLigand.pdb',
|
|
35
34
|
properties=prop)
|
|
36
35
|
|
|
37
36
|
Info:
|
|
@@ -44,8 +43,8 @@ class Ligand(BiobbObject):
|
|
|
44
43
|
|
|
45
44
|
"""
|
|
46
45
|
|
|
47
|
-
def __init__(self, output_pdb_path,
|
|
48
|
-
|
|
46
|
+
def __init__(self, output_pdb_path,
|
|
47
|
+
properties=None, **kwargs) -> None:
|
|
49
48
|
properties = properties or {}
|
|
50
49
|
|
|
51
50
|
# Call parent class constructor
|
|
@@ -53,19 +52,19 @@ class Ligand(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_pdb_path": output_pdb_path}
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
# Properties specific for BB
|
|
61
|
-
self.api_id = properties.get('api_id', '
|
|
60
|
+
self.api_id = properties.get('api_id', 'mmb')
|
|
62
61
|
self.ligand_code = properties.get('ligand_code', None)
|
|
63
62
|
self.properties = properties
|
|
64
63
|
|
|
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_pdb_path = check_output_path(self.io_dict["out"]["output_pdb_path"], "output_pdb_path", False, out_log, self.__class__.__name__)
|
|
@@ -78,14 +77,14 @@ class Ligand(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.ligand_code, 'ligand_code', self.out_log, self.__class__.__name__)
|
|
85
84
|
|
|
86
85
|
self.ligand_code = self.ligand_code.strip().lower()
|
|
87
86
|
|
|
88
|
-
#Downloading PDB file
|
|
87
|
+
# Downloading PDB file
|
|
89
88
|
pdb_string = download_ligand(self.ligand_code, self.api_id, self.out_log, self.global_log)
|
|
90
89
|
write_pdb(pdb_string, self.output_pdb_path, None, self.out_log, self.global_log)
|
|
91
90
|
|
|
@@ -93,19 +92,21 @@ class Ligand(BiobbObject):
|
|
|
93
92
|
|
|
94
93
|
return 0
|
|
95
94
|
|
|
95
|
+
|
|
96
96
|
def ligand(output_pdb_path: str, properties: dict = None, **kwargs) -> int:
|
|
97
97
|
"""Execute the :class:`Ligand <api.ligand.Ligand>` class and
|
|
98
98
|
execute the :meth:`launch() <api.ligand.Ligand.launch>` method."""
|
|
99
99
|
|
|
100
100
|
return Ligand(output_pdb_path=output_pdb_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="Wrapper for the Protein Data Bank in Europe (https://www.ebi.ac.uk/pdbe/) and the MMB PDB mirror (http://mmb.irbbarcelona.org/api/) for downloading a single PDB ligand.", 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_pdb_path', required=True, help="Path to the output PDB ligand file. Accepted formats: pdb.")
|
|
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
|
-
ligand(output_pdb_path=args.output_pdb_path,
|
|
118
|
-
|
|
117
|
+
# Specific call of each building block
|
|
118
|
+
ligand(output_pdb_path=args.output_pdb_path,
|
|
119
|
+
properties=properties)
|
|
120
|
+
|
|
119
121
|
|
|
120
122
|
if __name__ == '__main__':
|
|
121
123
|
main()
|
biobb_io/api/memprotmd_sim.py
CHANGED
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
"""Module containing the MemProtMDSim 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, get_memprotmd_sim
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
class MemProtMDSim(BiobbObject):
|
|
@@ -26,10 +25,10 @@ class MemProtMDSim(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.memprotmd_sim import memprotmd_sim
|
|
29
|
-
prop = {
|
|
30
|
-
'pdb_code': '2VGB'
|
|
28
|
+
prop = {
|
|
29
|
+
'pdb_code': '2VGB'
|
|
31
30
|
}
|
|
32
|
-
memprotmd_sim(output_simulation='/path/to/newSimulation.zip',
|
|
31
|
+
memprotmd_sim(output_simulation='/path/to/newSimulation.zip',
|
|
33
32
|
properties=prop)
|
|
34
33
|
|
|
35
34
|
Info:
|
|
@@ -42,8 +41,8 @@ class MemProtMDSim(BiobbObject):
|
|
|
42
41
|
|
|
43
42
|
"""
|
|
44
43
|
|
|
45
|
-
def __init__(self, output_simulation,
|
|
46
|
-
|
|
44
|
+
def __init__(self, output_simulation,
|
|
45
|
+
properties=None, **kwargs) -> None:
|
|
47
46
|
properties = properties or {}
|
|
48
47
|
|
|
49
48
|
# Call parent class constructor
|
|
@@ -51,8 +50,8 @@ class MemProtMDSim(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_simulation": output_simulation}
|
|
56
55
|
}
|
|
57
56
|
|
|
58
57
|
# Properties specific for BB
|
|
@@ -70,29 +69,31 @@ class MemProtMDSim(BiobbObject):
|
|
|
70
69
|
@launchlogger
|
|
71
70
|
def launch(self) -> int:
|
|
72
71
|
"""Execute the :class:`MemProtMDSim <api.memprotmd_sim.MemProtMDSim>` api.memprotmd_sim.MemProtMDSim 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.pdb_code, 'pdb_code', self.out_log, self.__class__.__name__)
|
|
82
81
|
|
|
83
82
|
# get simulation files and save to output
|
|
84
|
-
|
|
83
|
+
get_memprotmd_sim(self.pdb_code, self.output_simulation, self.out_log, self.global_log)
|
|
85
84
|
|
|
86
85
|
self.check_arguments(output_files_created=True, raise_exception=False)
|
|
87
86
|
|
|
88
87
|
return 0
|
|
89
88
|
|
|
89
|
+
|
|
90
90
|
def memprotmd_sim(output_simulation: str, properties: dict = None, **kwargs) -> int:
|
|
91
91
|
"""Execute the :class:`MemProtMDSim <api.memprotmd_sim.MemProtMDSim>` class and
|
|
92
92
|
execute the :meth:`launch() <api.memprotmd_sim.MemProtMDSim.launch>` method."""
|
|
93
93
|
|
|
94
94
|
return MemProtMDSim(output_simulation=output_simulation,
|
|
95
|
-
|
|
95
|
+
properties=properties, **kwargs).launch()
|
|
96
|
+
|
|
96
97
|
|
|
97
98
|
def main():
|
|
98
99
|
"""Command line execution of this building block. Please check the command line documentation."""
|
|
@@ -108,8 +109,9 @@ def main():
|
|
|
108
109
|
properties = settings.ConfReader(config=config).get_prop_dic()
|
|
109
110
|
|
|
110
111
|
# Specific call of each building block
|
|
111
|
-
memprotmd_sim(output_simulation=args.output_simulation,
|
|
112
|
-
|
|
112
|
+
memprotmd_sim(output_simulation=args.output_simulation,
|
|
113
|
+
properties=properties)
|
|
114
|
+
|
|
113
115
|
|
|
114
116
|
if __name__ == '__main__':
|
|
115
117
|
main()
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
"""Module containing the MemProtMDSimList 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, get_memprotmd_sim_list, write_json
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
class MemProtMDSimList(BiobbObject):
|
|
@@ -26,7 +25,7 @@ class MemProtMDSimList(BiobbObject):
|
|
|
26
25
|
|
|
27
26
|
from biobb_io.api.memprotmd_sim_list import memprotmd_sim_list
|
|
28
27
|
prop = { }
|
|
29
|
-
memprotmd_sim_list(output_simulations='/path/to/newSimulationList.json',
|
|
28
|
+
memprotmd_sim_list(output_simulations='/path/to/newSimulationList.json',
|
|
30
29
|
properties=prop)
|
|
31
30
|
|
|
32
31
|
Info:
|
|
@@ -39,8 +38,8 @@ class MemProtMDSimList(BiobbObject):
|
|
|
39
38
|
|
|
40
39
|
"""
|
|
41
40
|
|
|
42
|
-
def __init__(self, output_simulations,
|
|
43
|
-
|
|
41
|
+
def __init__(self, output_simulations,
|
|
42
|
+
properties=None, **kwargs) -> None:
|
|
44
43
|
properties = properties or {}
|
|
45
44
|
|
|
46
45
|
# Call parent class constructor
|
|
@@ -48,8 +47,8 @@ class MemProtMDSimList(BiobbObject):
|
|
|
48
47
|
self.locals_var_dict = locals().copy()
|
|
49
48
|
|
|
50
49
|
# Input/Output files
|
|
51
|
-
self.io_dict = {
|
|
52
|
-
"out": {
|
|
50
|
+
self.io_dict = {
|
|
51
|
+
"out": {"output_simulations": output_simulations}
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
# Properties specific for BB
|
|
@@ -66,13 +65,13 @@ class MemProtMDSimList(BiobbObject):
|
|
|
66
65
|
@launchlogger
|
|
67
66
|
def launch(self) -> int:
|
|
68
67
|
"""Execute the :class:`MemProtMDSimList <api.memprotmd_sim_list.MemProtMDSimList>` api.memprotmd_sim_list.MemProtMDSimList object."""
|
|
69
|
-
|
|
68
|
+
|
|
70
69
|
# check input/output paths and parameters
|
|
71
70
|
self.check_data_params(self.out_log, self.err_log)
|
|
72
71
|
|
|
73
72
|
# Setup Biobb
|
|
74
|
-
if self.check_restart():
|
|
75
|
-
|
|
73
|
+
if self.check_restart():
|
|
74
|
+
return 0
|
|
76
75
|
|
|
77
76
|
# get JSON object
|
|
78
77
|
json_string = get_memprotmd_sim_list(self.out_log, self.global_log)
|
|
@@ -84,12 +83,14 @@ class MemProtMDSimList(BiobbObject):
|
|
|
84
83
|
|
|
85
84
|
return 0
|
|
86
85
|
|
|
86
|
+
|
|
87
87
|
def memprotmd_sim_list(output_simulations: str, properties: dict = None, **kwargs) -> int:
|
|
88
88
|
"""Execute the :class:`MemProtMDSimList <api.memprotmd_sim_list.MemProtMDSimList>` class and
|
|
89
89
|
execute the :meth:`launch() <api.memprotmd_sim_list.MemProtMDSimList.launch>` method."""
|
|
90
90
|
|
|
91
91
|
return MemProtMDSimList(output_simulations=output_simulations,
|
|
92
|
-
|
|
92
|
+
properties=properties, **kwargs).launch()
|
|
93
|
+
|
|
93
94
|
|
|
94
95
|
def main():
|
|
95
96
|
"""Command line execution of this building block. Please check the command line documentation."""
|
|
@@ -107,5 +108,6 @@ def main():
|
|
|
107
108
|
# Specific call of each building block
|
|
108
109
|
memprotmd_sim_list(output_simulations=args.output_simulations, properties=properties)
|
|
109
110
|
|
|
111
|
+
|
|
110
112
|
if __name__ == '__main__':
|
|
111
113
|
main()
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
"""Module containing the MemProtMDSimSearch 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, get_memprotmd_sim_search, write_json
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
class MemProtMDSimSearch(BiobbObject):
|
|
@@ -27,11 +26,11 @@ class MemProtMDSimSearch(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.memprotmd_sim_search import memprotmd_sim_search
|
|
30
|
-
prop = {
|
|
31
|
-
'collection_name': 'refs',
|
|
32
|
-
'keyword': 'porin'
|
|
29
|
+
prop = {
|
|
30
|
+
'collection_name': 'refs',
|
|
31
|
+
'keyword': 'porin'
|
|
33
32
|
}
|
|
34
|
-
memprotmd_sim_search(output_simulations='/path/to/newSimulationSearch.json',
|
|
33
|
+
memprotmd_sim_search(output_simulations='/path/to/newSimulationSearch.json',
|
|
35
34
|
properties=prop).launch()
|
|
36
35
|
|
|
37
36
|
Info:
|
|
@@ -44,8 +43,8 @@ class MemProtMDSimSearch(BiobbObject):
|
|
|
44
43
|
|
|
45
44
|
"""
|
|
46
45
|
|
|
47
|
-
def __init__(self, output_simulations,
|
|
48
|
-
|
|
46
|
+
def __init__(self, output_simulations,
|
|
47
|
+
properties=None, **kwargs) -> None:
|
|
49
48
|
properties = properties or {}
|
|
50
49
|
|
|
51
50
|
# Call parent class constructor
|
|
@@ -53,8 +52,8 @@ class MemProtMDSimSearch(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_simulations": output_simulations}
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
# Properties specific for BB
|
|
@@ -73,13 +72,13 @@ class MemProtMDSimSearch(BiobbObject):
|
|
|
73
72
|
@launchlogger
|
|
74
73
|
def launch(self) -> int:
|
|
75
74
|
"""Execute the :class:`MemProtMDSimSearch <api.memprotmd_sim_search.MemProtMDSimSearch>` api.memprotmd_sim_search.MemProtMDSimSearch object."""
|
|
76
|
-
|
|
75
|
+
|
|
77
76
|
# check input/output paths and parameters
|
|
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
|
self.keyword = self.keyword.strip().lower()
|
|
85
84
|
|
|
@@ -93,12 +92,14 @@ class MemProtMDSimSearch(BiobbObject):
|
|
|
93
92
|
|
|
94
93
|
return 0
|
|
95
94
|
|
|
95
|
+
|
|
96
96
|
def memprotmd_sim_search(output_simulations: str, properties: dict = None, **kwargs) -> int:
|
|
97
97
|
"""Execute the :class:`MemProtMDSimSearch <api.memprotmd_sim_search.MemProtMDSimSearch>` class and
|
|
98
98
|
execute the :meth:`launch() <api.memprotmd_sim_search.MemProtMDSimSearch.launch>` method."""
|
|
99
99
|
|
|
100
100
|
return MemProtMDSimSearch(output_simulations=output_simulations,
|
|
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."""
|
|
@@ -114,8 +115,9 @@ def main():
|
|
|
114
115
|
properties = settings.ConfReader(config=config).get_prop_dic()
|
|
115
116
|
|
|
116
117
|
# Specific call of each building block
|
|
117
|
-
memprotmd_sim_search(output_simulations=args.output_simulations,
|
|
118
|
-
|
|
118
|
+
memprotmd_sim_search(output_simulations=args.output_simulations,
|
|
119
|
+
properties=properties)
|
|
120
|
+
|
|
119
121
|
|
|
120
122
|
if __name__ == '__main__':
|
|
121
123
|
main()
|