|
2 | 2 |
|
3 | 3 | """Module containing the GOdMDRun class and the command line interface.""" |
4 | 4 |
|
5 | | -import argparse |
6 | 5 | import shutil |
7 | 6 | from pathlib import Path, PurePath |
8 | 7 | from typing import Optional |
9 | 8 |
|
10 | | -from biobb_common.configuration import settings |
11 | 9 | from biobb_common.generic.biobb_object import BiobbObject |
12 | 10 | from biobb_common.tools.file_utils import launchlogger |
13 | 11 |
|
@@ -312,99 +310,11 @@ def godmd_run( |
312 | 310 | ) -> int: |
313 | 311 | """Create :class:`GOdMDRun <godmd.godmd_run.GOdMDRun>`godmd.godmd_run.GOdMDRun class and |
314 | 312 | 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() |
328 | 314 |
|
329 | 315 |
|
330 | 316 | 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.") |
408 | 318 |
|
409 | 319 | if __name__ == "__main__": |
410 | 320 | main() |
0 commit comments