| 39 | |
| 40 | |
| 41 | def get_args(args=None): |
| 42 | |
| 43 | parser = argparse.ArgumentParser( |
| 44 | description="A Nextflow pipeline generator") |
| 45 | |
| 46 | subparsers = parser.add_subparsers(help="Select which mode to run", |
| 47 | dest="main_op") |
| 48 | |
| 49 | # BUILD MODE |
| 50 | build_parser = subparsers.add_parser("build", |
| 51 | help="Build a nextflow pipeline") |
| 52 | |
| 53 | group_lists = build_parser.add_mutually_exclusive_group() |
| 54 | |
| 55 | build_parser.add_argument( |
| 56 | "-t", "--tasks", type=str, dest="tasks", |
| 57 | help="Space separated tasks of the pipeline") |
| 58 | build_parser.add_argument( |
| 59 | "-r", "--recipe", dest="recipe", |
| 60 | help="Use one of the available recipes") |
| 61 | build_parser.add_argument( |
| 62 | "-o", dest="output_nf", help="Name of the pipeline file") |
| 63 | build_parser.add_argument( |
| 64 | "-n", dest="pipeline_name", default="flowcraft", |
| 65 | help="Provide a name for your pipeline.") |
| 66 | build_parser.add_argument( |
| 67 | "--merge-params", dest="merge_params", action="store_true", |
| 68 | help="Merges identical parameters from multiple components into the " |
| 69 | "same one. Otherwise, the parameters will be separated and unique" |
| 70 | " to each component.") |
| 71 | build_parser.add_argument( |
| 72 | "--pipeline-only", dest="pipeline_only", action="store_true", |
| 73 | help="Write only the pipeline files and not the templates, bin, and" |
| 74 | " lib folders.") |
| 75 | build_parser.add_argument( |
| 76 | "-nd", "--no-dependecy", dest="no_dep", action="store_false", |
| 77 | help="Do not automatically add dependencies to the pipeline.") |
| 78 | build_parser.add_argument( |
| 79 | "-c", "--check-pipeline", dest="check_only", action="store_const", |
| 80 | const=True, help="Check only the validity of the pipeline " |
| 81 | "string and exit.") |
| 82 | group_lists.add_argument( |
| 83 | "-L", "--component-list", action="store_const", dest="detailed_list", |
| 84 | const=True, help="Print a detailed description for all the " |
| 85 | "currently available processes.") |
| 86 | group_lists.add_argument( |
| 87 | "-l", "--component-list-short", action="store_const", dest="short_list", |
| 88 | const=True, help="Print a short list of the currently " |
| 89 | "available processes.") |
| 90 | group_lists.add_argument( |
| 91 | "--recipe-list", dest="recipe_list", action="store_const", const=True, |
| 92 | help="Print a short list of the currently available recipes." |
| 93 | ) |
| 94 | group_lists.add_argument( |
| 95 | "--recipe-list-short", dest="recipe_list_short", action="store_const", |
| 96 | const=True, help="Print a condensed list of the currently available " |
| 97 | "recipes" |
| 98 | ) |