-
Notifications
You must be signed in to change notification settings - Fork 1
/
configBuilder
executable file
·47 lines (42 loc) · 1.6 KB
/
configBuilder
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python3
from modules import create_infrastructure, create_pipeline
from colorama import Fore, Style, init
import inquirer
# Initialise colorama
init(autoreset=True)
# Print start-up message
print(f"{Fore.CYAN} ____ __ _ ____ _ _ _ ")
print(f"{Fore.CYAN} / ___|___ _ __ / _(_) __ _| __ ) _ _(_) | __| | ___ _ __ ")
print(f"{Fore.CYAN}| | / _ \\| '_ \\| |_| |/ _` | _ \\| | | | | |/ _` |/ _ \\ '__|")
print(f"{Fore.CYAN}| |__| (_) | | | | _| | (_| | |_) | |_| | | | (_| | __/ | ")
print(
f"{Fore.CYAN} \\____\\___/|_| |_|_| |_|\\__, |____/ \\__,_|_|_|\\__,_|\\___|_| "
)
print(f"{Fore.CYAN} |___/ ")
print(
f"""
{Fore.MAGENTA}This tool helps you to build a custom Nextflow config file for your computing
infrastructure (laptop, HPC, etc.) based on your specified job scheduler and resources, or
customise resource requirements for a particular pipelines steps.
Follow the prompts to specify your settings.
"""
)
# Prompt user for desired action
config_type_question = [
inquirer.List(
"config_type",
message="What type of configuration file would you like to build?",
choices=["infrastructure", "pipeline"],
),
]
answers = inquirer.prompt(config_type_question)
config_type = answers["config_type"]
if config_type == "infrastructure":
create_infrastructure()
elif config_type == "pipeline":
create_pipeline()
else:
print(
f"{Fore.RED}Invalid selection. Please run the script again and enter either custom or nf-core.\n"
+ Style.RESET_ALL
)