Skip to content

Commit 9b3d693

Browse files
committed
biobb_common ==5.1.1
1 parent 60ff03f commit 9b3d693

File tree

17 files changed

+51
-553
lines changed

17 files changed

+51
-553
lines changed

.github/env.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ channels:
44
- bioconda
55
- anaconda
66
dependencies:
7-
- biobb_common ==5.1.0
7+
- biobb_common ==5.1.1

biobb_io/api/alphafold.py

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
"""Module containing the AlphaFold class and the command line interface."""
44

5-
import argparse
65
from typing import Optional
7-
8-
from biobb_common.configuration import settings
96
from biobb_common.generic.biobb_object import BiobbObject
107
from biobb_common.tools.file_utils import launchlogger
118

@@ -113,43 +110,11 @@ def launch(self) -> int:
113110
def alphafold(output_pdb_path: str, properties: Optional[dict] = None, **kwargs) -> int:
114111
"""Execute the :class:`AlphaFold <api.alphafold.AlphaFold>` class and
115112
execute the :meth:`launch() <api.alphafold.AlphaFold.launch>` method."""
113+
return AlphaFold(**dict(locals())).launch()
116114

117-
return AlphaFold(
118-
output_pdb_path=output_pdb_path, properties=properties, **kwargs
119-
).launch()
120-
121-
alphafold.__doc__ = AlphaFold.__doc__
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 PDB 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_pdb_path",
142-
required=True,
143-
help="Path to the output PDB file. Accepted formats: pdb.",
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-
alphafold(output_pdb_path=args.output_pdb_path, properties=properties)
152115

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.")
153118

154119
if __name__ == "__main__":
155120
main()

biobb_io/api/api_binding_site.py

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22

33
"""Module containing the ApiBindingSite class and the command line interface."""
44

5-
import argparse
65
import json
76
from typing import Optional
8-
9-
from biobb_common.configuration import settings
107
from biobb_common.generic.biobb_object import BiobbObject
118
from biobb_common.tools import file_utils as fu
129
from biobb_common.tools.file_utils import launchlogger
@@ -125,43 +122,11 @@ def api_binding_site(
125122
) -> int:
126123
"""Execute the :class:`ApiBindingSite <api.api_binding_site.ApiBindingSite>` class and
127124
execute the :meth:`launch() <api.api_binding_site.ApiBindingSite.launch>` method."""
125+
return ApiBindingSite(**dict(locals())).launch()
128126

129-
return ApiBindingSite(
130-
output_json_path=output_json_path, properties=properties, **kwargs
131-
).launch()
132-
133-
api_binding_site.__doc__ = ApiBindingSite.__doc__
134-
135-
136-
def main():
137-
"""Command line execution of this building block. Please check the command line documentation."""
138-
parser = argparse.ArgumentParser(
139-
description="This class is a wrapper for the PDBe REST API Binding Sites endpoint",
140-
formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999),
141-
)
142-
parser.add_argument(
143-
"-c",
144-
"--config",
145-
required=False,
146-
help="This file can be a YAML file, JSON file or JSON string",
147-
)
148-
149-
# Specific args of each building block
150-
required_args = parser.add_argument_group("required arguments")
151-
required_args.add_argument(
152-
"-o",
153-
"--output_json_path",
154-
required=True,
155-
help="Path to the JSON file with the binding sites for the requested structure. Accepted formats: json.",
156-
)
157-
158-
args = parser.parse_args()
159-
config = args.config if args.config else None
160-
properties = settings.ConfReader(config=config).get_prop_dic()
161-
162-
# Specific call of each building block
163-
api_binding_site(output_json_path=args.output_json_path, properties=properties)
164127

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")
165130

166131
if __name__ == "__main__":
167132
main()

biobb_io/api/canonical_fasta.py

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
"""Module containing the CanonicalFasta class and the command line interface."""
44

5-
import argparse
65
from typing import Optional
7-
8-
from biobb_common.configuration import settings
96
from biobb_common.generic.biobb_object import BiobbObject
107
from biobb_common.tools.file_utils import launchlogger
118

@@ -115,43 +112,11 @@ def canonical_fasta(
115112
) -> int:
116113
"""Execute the :class:`CanonicalFasta <api.canonical_fasta.CanonicalFasta>` class and
117114
execute the :meth:`launch() <api.canonical_fasta.CanonicalFasta.launch>` method."""
115+
return CanonicalFasta(**dict(locals())).launch()
118116

119-
return CanonicalFasta(
120-
output_fasta_path=output_fasta_path, properties=properties, **kwargs
121-
).launch()
122-
123-
canonical_fasta.__doc__ = CanonicalFasta.__doc__
124-
125-
126-
def main():
127-
"""Command line execution of this building block. Please check the command line documentation."""
128-
parser = argparse.ArgumentParser(
129-
description="This class is a wrapper for downloading a FASTA structure from the Protein Data Bank.",
130-
formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999),
131-
)
132-
parser.add_argument(
133-
"-c",
134-
"--config",
135-
required=False,
136-
help="This file can be a YAML file, JSON file or JSON string",
137-
)
138-
139-
# Specific args of each building block
140-
required_args = parser.add_argument_group("required arguments")
141-
required_args.add_argument(
142-
"-o",
143-
"--output_fasta_path",
144-
required=True,
145-
help="Path to the canonical FASTA file. Accepted formats: fasta.",
146-
)
147-
148-
args = parser.parse_args()
149-
config = args.config if args.config else None
150-
properties = settings.ConfReader(config=config).get_prop_dic()
151-
152-
# Specific call of each building block
153-
canonical_fasta(output_fasta_path=args.output_fasta_path, properties=properties)
154117

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.")
155120

156121
if __name__ == "__main__":
157122
main()

biobb_io/api/ideal_sdf.py

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
"""Module containing the IdealSdf class and the command line interface."""
44

5-
import argparse
65
from typing import Optional
7-
8-
from biobb_common.configuration import settings
96
from biobb_common.generic.biobb_object import BiobbObject
107
from biobb_common.tools.file_utils import launchlogger
118

@@ -113,43 +110,11 @@ def launch(self) -> int:
113110
def ideal_sdf(output_sdf_path: str, properties: Optional[dict] = None, **kwargs) -> int:
114111
"""Execute the :class:`IdealSdf <api.ideal_sdf.IdealSdf>` class and
115112
execute the :meth:`launch() <api.ideal_sdf.IdealSdf.launch>` method."""
113+
return IdealSdf(**dict(locals())).launch()
116114

117-
return IdealSdf(
118-
output_sdf_path=output_sdf_path, properties=properties, **kwargs
119-
).launch()
120-
121-
ideal_sdf.__doc__ = IdealSdf.__doc__
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 an ideal SDF ligand 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_sdf_path",
142-
required=True,
143-
help="Path to the output SDF file. Accepted formats: sdf.",
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-
ideal_sdf(output_sdf_path=args.output_sdf_path, properties=properties)
152115

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.")
153118

154119
if __name__ == "__main__":
155120
main()

biobb_io/api/ligand.py

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
"""Module containing the Ligand class and the command line interface."""
44

5-
import argparse
65
from typing import Optional
7-
8-
from biobb_common.configuration import settings
96
from biobb_common.generic.biobb_object import BiobbObject
107
from biobb_common.tools.file_utils import launchlogger
118

@@ -113,43 +110,11 @@ def launch(self) -> int:
113110
def ligand(output_pdb_path: str, properties: Optional[dict] = None, **kwargs) -> int:
114111
"""Execute the :class:`Ligand <api.ligand.Ligand>` class and
115112
execute the :meth:`launch() <api.ligand.Ligand.launch>` method."""
113+
return Ligand(**dict(locals())).launch()
116114

117-
return Ligand(
118-
output_pdb_path=output_pdb_path, properties=properties, **kwargs
119-
).launch()
120-
121-
ligand.__doc__ = Ligand.__doc__
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="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.",
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_pdb_path",
142-
required=True,
143-
help="Path to the output PDB ligand file. Accepted formats: pdb.",
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-
ligand(output_pdb_path=args.output_pdb_path, properties=properties)
152115

116+
ligand.__doc__ = Ligand.__doc__
117+
main = Ligand.get_main(ligand, "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.")
153118

154119
if __name__ == "__main__":
155120
main()

biobb_io/api/mddb.py

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
"""Module containing the MDDB class and the command line interface."""
44

5-
import argparse
65
from typing import Optional
7-
8-
from biobb_common.configuration import settings
96
from biobb_common.generic.biobb_object import BiobbObject
107
from biobb_common.tools.file_utils import launchlogger
118

@@ -165,50 +162,11 @@ def launch(self) -> int:
165162
def mddb(output_top_path: str, output_trj_path: str, properties: Optional[dict] = None, **kwargs) -> int:
166163
"""Execute the :class:`MDDB <api.mddb.MDDB>` class and
167164
execute the :meth:`launch() <api.mddb.MDDB.launch>` method."""
168-
169-
return MDDB(
170-
output_top_path=output_top_path, output_trj_path=output_trj_path, properties=properties, **kwargs
171-
).launch()
165+
return MDDB(**dict(locals())).launch()
172166

173167

174168
mddb.__doc__ = MDDB.__doc__
175-
176-
177-
def main():
178-
"""Command line execution of this building block. Please check the command line documentation."""
179-
parser = argparse.ArgumentParser(
180-
description="This class is a wrapper for downloading a trajectory / topology pair from the MDDB Database.",
181-
formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999),
182-
)
183-
parser.add_argument(
184-
"-c",
185-
"--config",
186-
required=False,
187-
help="This file can be a YAML file, JSON file or JSON string",
188-
)
189-
190-
# Specific args of each building block
191-
required_args = parser.add_argument_group("required arguments")
192-
required_args.add_argument(
193-
"-o",
194-
"--output_top_path",
195-
required=True,
196-
help="Path to the output toplogy file. Accepted formats: pdb.",
197-
)
198-
required_args.add_argument(
199-
"-t",
200-
"--output_trj_path",
201-
required=True,
202-
help="Path to the output trajectory file. Accepted formats: mdcrd, trr, xtc.",
203-
)
204-
205-
args = parser.parse_args()
206-
config = args.config if args.config else None
207-
properties = settings.ConfReader(config=config).get_prop_dic()
208-
209-
# Specific call of each building block
210-
mddb(output_top_path=args.output_top_path, output_trj_path=args.output_trj_path, properties=properties)
211-
169+
main = MDDB.get_main(mddb, "This class is a wrapper for downloading a trajectory / topology pair from the MDDB Database.")
212170

213171
if __name__ == "__main__":
214172
main()

0 commit comments

Comments
 (0)