Skip to content

Commit 7049425

Browse files
committed
Update common
1 parent b5cdf3a commit 7049425

File tree

6 files changed

+25
-143
lines changed

6 files changed

+25
-143
lines changed

.github/env.yaml

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

biobb_godmd/docs/source/command_line.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ Command:
1313
```python
1414
godmd_prep -h
1515
```
16-
usage: godmd_prep [-h] [--config CONFIG] --input_pdb_orig_path INPUT_PDB_ORIG_PATH --input_pdb_target_path INPUT_PDB_TARGET_PATH --output_aln_orig_path OUTPUT_ALN_ORIG_PATH --output_aln_target_path OUTPUT_ALN_TARGET_PATH
16+
usage: godmd_prep [-h] [-c CONFIG] --input_pdb_orig_path INPUT_PDB_ORIG_PATH --input_pdb_target_path INPUT_PDB_TARGET_PATH --output_aln_orig_path OUTPUT_ALN_ORIG_PATH --output_aln_target_path OUTPUT_ALN_TARGET_PATH
1717

1818
Prepares input files for the GOdMD tool.
1919

2020
options:
2121
-h, --help show this help message and exit
22-
--config CONFIG Configuration file
22+
-c CONFIG, --config CONFIG
23+
This file can be a YAML file, JSON file or JSON string
2324

2425
required arguments:
2526
--input_pdb_orig_path INPUT_PDB_ORIG_PATH
@@ -50,7 +51,7 @@ Config parameters for this building block:
5051
* **restart** (*boolean*): (False) Do not execute if output files exist..
5152
* **sandbox_path** (*string*): (./) Parent path to the sandbox directory..
5253
### YAML
53-
#### [Common config file](https://github.com/bioexcel/biobb_godmd/blob/main/biobb_godmd/test/data/config/config_godmd_prep.yml)
54+
#### [Common config file](https://github.com/bioexcel/biobb_godmd/blob/master/biobb_godmd/test/data/config/config_godmd_prep.yml)
5455
```python
5556
properties:
5657
gapextend: '2'
@@ -62,7 +63,7 @@ properties:
6263
godmd_prep --config config_godmd_prep.yml --input_pdb_orig_path 1ake_A.pdb --input_pdb_target_path 4ake_A.pdb --output_aln_orig_path 1ake_A.aln --output_aln_target_path 4ake_A.aln
6364
```
6465
### JSON
65-
#### [Common config file](https://github.com/bioexcel/biobb_godmd/blob/main/biobb_godmd/test/data/config/config_godmd_prep.json)
66+
#### [Common config file](https://github.com/bioexcel/biobb_godmd/blob/master/biobb_godmd/test/data/config/config_godmd_prep.json)
6667
```python
6768
{
6869
"properties": {
@@ -83,13 +84,14 @@ Command:
8384
```python
8485
godmd_run -h
8586
```
86-
usage: godmd_run [-h] [--config CONFIG] --input_pdb_orig_path INPUT_PDB_ORIG_PATH --input_pdb_target_path INPUT_PDB_TARGET_PATH --input_aln_orig_path INPUT_ALN_ORIG_PATH --input_aln_target_path INPUT_ALN_TARGET_PATH [--input_config_path INPUT_CONFIG_PATH] --output_log_path OUTPUT_LOG_PATH --output_ene_path OUTPUT_ENE_PATH --output_trj_path OUTPUT_TRJ_PATH --output_pdb_path OUTPUT_PDB_PATH
87+
usage: godmd_run [-h] [-c CONFIG] --input_pdb_orig_path INPUT_PDB_ORIG_PATH --input_pdb_target_path INPUT_PDB_TARGET_PATH --input_aln_orig_path INPUT_ALN_ORIG_PATH --input_aln_target_path INPUT_ALN_TARGET_PATH [--input_config_path INPUT_CONFIG_PATH] --output_log_path OUTPUT_LOG_PATH --output_ene_path OUTPUT_ENE_PATH --output_trj_path OUTPUT_TRJ_PATH --output_pdb_path OUTPUT_PDB_PATH
8788

8889
Computing conformational transition trajectories for proteins using GOdMD tool.
8990

9091
options:
9192
-h, --help show this help message and exit
92-
--config CONFIG Configuration file
93+
-c CONFIG, --config CONFIG
94+
This file can be a YAML file, JSON file or JSON string
9395

9496
required arguments:
9597
--input_pdb_orig_path INPUT_PDB_ORIG_PATH
@@ -100,16 +102,18 @@ godmd_run -h
100102
Input GOdMD alignment file corresponding to the origin structure of the conformational transition. Accepted formats: aln, txt.
101103
--input_aln_target_path INPUT_ALN_TARGET_PATH
102104
Input GOdMD alignment file corresponding to the target structure of the conformational transition. Accepted formats: aln, txt.
103-
--input_config_path INPUT_CONFIG_PATH
104-
Input configuration file (GOdMD run options). Accepted formats: in, txt.
105105
--output_log_path OUTPUT_LOG_PATH
106-
Output log file. Accepted formats: log, out, txt.
106+
Output log file. Accepted formats: log, out, txt, o.
107107
--output_ene_path OUTPUT_ENE_PATH
108-
Output energy file. Accepted formats: log, out, txt.
108+
Output energy file. Accepted formats: log, out, txt, o.
109109
--output_trj_path OUTPUT_TRJ_PATH
110-
Output trajectory file. Accepted formats: mdcrd.
110+
Output trajectory file. Accepted formats: trj, crd, mdcrd, x.
111111
--output_pdb_path OUTPUT_PDB_PATH
112112
Output structure file. Accepted formats: pdb.
113+
114+
optional arguments:
115+
--input_config_path INPUT_CONFIG_PATH
116+
Input GOdMD configuration file. Accepted formats: in, txt.
113117
### I / O Arguments
114118
Syntax: input_argument (datatype) : Definition
115119

@@ -133,7 +137,7 @@ Config parameters for this building block:
133137
* **restart** (*boolean*): (False) Do not execute if output files exist..
134138
* **sandbox_path** (*string*): (./) Parent path to the sandbox directory..
135139
### YAML
136-
#### [Common config file](https://github.com/bioexcel/biobb_godmd/blob/main/biobb_godmd/test/data/config/config_godmd_run.yml)
140+
#### [Common config file](https://github.com/bioexcel/biobb_godmd/blob/master/biobb_godmd/test/data/config/config_godmd_run.yml)
137141
```python
138142
properties:
139143
remove_tmp: true
@@ -144,7 +148,7 @@ properties:
144148
godmd_run --config config_godmd_run.yml --input_pdb_orig_path 1ake_A.pdb --input_pdb_target_path 4ake_A.pdb --input_aln_orig_path 1ake_A.aln --input_aln_target_path 4ake_A.aln --input_config_path params.in --output_log_path godmd.log --output_ene_path godmd_ene.out --output_trj_path godmd_trj.mdcrd --output_pdb_path godmd_pdb.pdb
145149
```
146150
### JSON
147-
#### [Common config file](https://github.com/bioexcel/biobb_godmd/blob/main/biobb_godmd/test/data/config/config_godmd_run.json)
151+
#### [Common config file](https://github.com/bioexcel/biobb_godmd/blob/master/biobb_godmd/test/data/config/config_godmd_run.json)
148152
```python
149153
{
150154
"properties": {

biobb_godmd/godmd/godmd_prep.py

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#!/usr/bin/env python3
22

33
"""Module containing the GOdMDPrep class and the command line interface."""
4-
import argparse
54
from typing import Optional
65
from pathlib import Path
76
from biobb_common.generic.biobb_object import BiobbObject
8-
from biobb_common.configuration import settings
97
from biobb_common.tools import file_utils as fu
108
from biobb_common.tools.file_utils import launchlogger
119
from biobb_godmd.godmd.common import check_input_path, check_output_path
@@ -326,41 +324,11 @@ def godmd_prep(input_pdb_orig_path: str, input_pdb_target_path: str,
326324
properties: Optional[dict] = None, **kwargs) -> int:
327325
"""Create :class:`GOdMDPrep <godmd.godmd_prep.GOdMDPrep>`godmd.godmd_prep.GOdMDPrep class and
328326
execute :meth:`launch() <godmd.godmd_prep.GOdMDPrep.launch>` method"""
329-
330-
return GOdMDPrep(input_pdb_orig_path=input_pdb_orig_path,
331-
input_pdb_target_path=input_pdb_target_path,
332-
output_aln_orig_path=output_aln_orig_path,
333-
output_aln_target_path=output_aln_target_path,
334-
properties=properties).launch()
327+
return GOdMDPrep(**dict(locals())).launch()
335328

336329

337330
godmd_prep.__doc__ = GOdMDPrep.__doc__
338-
339-
340-
def main():
341-
parser = argparse.ArgumentParser(description='Prepares input files for the GOdMD tool.', formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999))
342-
parser.add_argument('--config', required=False, help='Configuration file')
343-
344-
# Specific args
345-
required_args = parser.add_argument_group('required arguments')
346-
required_args.add_argument('--input_pdb_orig_path', required=True, help='Input PDB file to be used as origin in the conformational transition. Accepted formats: pdb.')
347-
required_args.add_argument('--input_pdb_target_path', required=True, help='Input PDB file to be used as target in the conformational transition. Accepted formats: pdb.')
348-
required_args.add_argument('--output_aln_orig_path', required=True, help='Output GOdMD alignment file corresponding to the origin structure of the conformational transition. Accepted formats: aln, txt.')
349-
required_args.add_argument('--output_aln_target_path', required=True, help='Output GOdMD alignment file corresponding to the target structure of the conformational transition. Accepted formats: aln, txt.')
350-
351-
args = parser.parse_args()
352-
# config = args.config if args.config else None
353-
args.config = args.config or "{}"
354-
# properties = settings.ConfReader(config=config).get_prop_dic()
355-
properties = settings.ConfReader(config=args.config).get_prop_dic()
356-
357-
# Specific call
358-
godmd_prep(input_pdb_orig_path=args.input_pdb_orig_path,
359-
input_pdb_target_path=args.input_pdb_target_path,
360-
output_aln_orig_path=args.output_aln_orig_path,
361-
output_aln_target_path=args.output_aln_target_path,
362-
properties=properties)
363-
331+
main = GOdMDPrep.get_main(godmd_prep, "Prepares input files for the GOdMD tool.")
364332

365333
if __name__ == '__main__':
366334
main()

biobb_godmd/godmd/godmd_run.py

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

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

5-
import argparse
65
import shutil
76
from pathlib import Path, PurePath
87
from typing import Optional
98

10-
from biobb_common.configuration import settings
119
from biobb_common.generic.biobb_object import BiobbObject
1210
from biobb_common.tools.file_utils import launchlogger
1311

@@ -312,99 +310,11 @@ def godmd_run(
312310
) -> int:
313311
"""Create :class:`GOdMDRun <godmd.godmd_run.GOdMDRun>`godmd.godmd_run.GOdMDRun class and
314312
execute :meth:`launch() <godmd.godmd_run.GOdMDRun.launch>` method"""
315-
316-
return GOdMDRun(
317-
input_pdb_orig_path=input_pdb_orig_path,
318-
input_pdb_target_path=input_pdb_target_path,
319-
input_aln_orig_path=input_aln_orig_path,
320-
input_aln_target_path=input_aln_target_path,
321-
input_config_path=input_config_path,
322-
output_log_path=output_log_path,
323-
output_ene_path=output_ene_path,
324-
output_trj_path=output_trj_path,
325-
output_pdb_path=output_pdb_path,
326-
properties=properties,
327-
).launch()
313+
return GOdMDRun(**dict(locals())).launch()
328314

329315

330316
godmd_run.__doc__ = GOdMDRun.__doc__
331-
332-
333-
def main():
334-
parser = argparse.ArgumentParser(
335-
description="Computing conformational transition trajectories for proteins using GOdMD tool.",
336-
formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999),
337-
)
338-
parser.add_argument("--config", required=False, help="Configuration file")
339-
340-
# Specific args
341-
required_args = parser.add_argument_group("required arguments")
342-
required_args.add_argument(
343-
"--input_pdb_orig_path",
344-
required=True,
345-
help="Input PDB file to be used as origin in the conformational transition. Accepted formats: pdb.",
346-
)
347-
required_args.add_argument(
348-
"--input_pdb_target_path",
349-
required=True,
350-
help="Input PDB file to be used as target in the conformational transition. Accepted formats: pdb.",
351-
)
352-
required_args.add_argument(
353-
"--input_aln_orig_path",
354-
required=True,
355-
help="Input GOdMD alignment file corresponding to the origin structure of the conformational transition. Accepted formats: aln, txt.",
356-
)
357-
required_args.add_argument(
358-
"--input_aln_target_path",
359-
required=True,
360-
help="Input GOdMD alignment file corresponding to the target structure of the conformational transition. Accepted formats: aln, txt.",
361-
)
362-
required_args.add_argument(
363-
"--input_config_path",
364-
required=False,
365-
help="Input configuration file (GOdMD run options). Accepted formats: in, txt.",
366-
)
367-
required_args.add_argument(
368-
"--output_log_path",
369-
required=True,
370-
help="Output log file. Accepted formats: log, out, txt.",
371-
)
372-
required_args.add_argument(
373-
"--output_ene_path",
374-
required=True,
375-
help="Output energy file. Accepted formats: log, out, txt.",
376-
)
377-
required_args.add_argument(
378-
"--output_trj_path",
379-
required=True,
380-
help="Output trajectory file. Accepted formats: mdcrd.",
381-
)
382-
required_args.add_argument(
383-
"--output_pdb_path",
384-
required=True,
385-
help="Output structure file. Accepted formats: pdb.",
386-
)
387-
388-
args = parser.parse_args()
389-
# config = args.config if args.config else None
390-
args.config = args.config or "{}"
391-
# properties = settings.ConfReader(config=config).get_prop_dic()
392-
properties = settings.ConfReader(config=args.config).get_prop_dic()
393-
394-
# Specific call
395-
godmd_run(
396-
input_pdb_orig_path=args.input_pdb_orig_path,
397-
input_pdb_target_path=args.input_pdb_target_path,
398-
input_aln_orig_path=args.input_aln_orig_path,
399-
input_aln_target_path=args.input_aln_target_path,
400-
input_config_path=args.input_config_path,
401-
output_log_path=args.output_log_path,
402-
output_ene_path=args.output_ene_path,
403-
output_trj_path=args.output_trj_path,
404-
output_pdb_path=args.output_pdb_path,
405-
properties=properties,
406-
)
407-
317+
main = GOdMDRun.get_main(godmd_run, "Computing conformational transition trajectories for proteins using GOdMD tool.")
408318

409319
if __name__ == "__main__":
410320
main()

biobb_godmd/json_schemas/biobb_godmd.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
}
2828
],
2929
"dep_pypi": [
30-
"install_requires=['biobb_common==5.1.0']",
30+
"install_requires=['biobb_common==5.1.1']",
3131
"python_requires='>=3.9'"
3232
],
3333
"dep_conda": [
3434
"python >=3.9",
35-
"biobb_common ==5.1.0",
35+
"biobb_common ==5.1.1",
3636
"godmd ==1.7",
3737
"emboss"
3838
],

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
packages=setuptools.find_packages(exclude=["docs", "test"]),
2121
package_data={"biobb_godmd": ["py.typed"]},
22-
install_requires=["biobb_common==5.1.0"],
22+
install_requires=["biobb_common==5.1.1"],
2323
python_requires=">=3.9",
2424
entry_points={
2525
"console_scripts": [

0 commit comments

Comments
 (0)