-
Notifications
You must be signed in to change notification settings - Fork 5
/
pipedm.py
executable file
·67 lines (58 loc) · 2.41 KB
/
pipedm.py
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env python3
from MetaSanity.Accessories.arg_parse import ArgParse
from MetaSanity.Accessories.program_caller import ProgramCaller
from MetaSanity.Pipeline.metagenome_evaluation import metagenome_evaluation
from MetaSanity.Pipeline.metagenome_annotation import metagenome_annotation
if __name__ == "__main__":
args_list = (
(("program",),
{"help": "Program to run"}),
(("-d", "--directory"),
{"help": "Directory containing genomes", "required": True}),
(("-c", "--config_file"),
{"help": "Config file", "required": True}),
(("-a", "--cancel_autocommit"),
{"help": "Cancel commit to database", "action": "store_true", "default": False}),
(("-o", "--output_directory"),
{"help": "Output directory prefix, default out", "default": "out"}),
(("-b", "--biometadb_project"),
{"help": "/path/to/BioMetaDB_project (updates values of existing database)", "default": "None"}),
(("-t", "--type_file"),
{"help": "/path/to/type_file formatted as 'file_name.fna\\t[Archaea/Bacteria]\\t[gram+/gram-]\\n'",
"default": "None"}),
(("-y", "--is_docker"),
{"help": "For use in docker version", "default": False, "action": "store_true"}),
(("-p", "--prokka"),
{"help": "Use PROKKA gene calls instead of prodigal search", "default": False, "action": "store_true"}),
)
programs = {
"PhyloSanity": metagenome_evaluation,
"FuncSanity": metagenome_annotation,
}
flags = {
"PhyloSanity": ("directory", "config_file", "cancel_autocommit", "output_directory",
"biometadb_project", "is_docker"),
"FuncSanity": ("directory", "config_file", "cancel_autocommit", "output_directory",
"biometadb_project", "type_file", "is_docker", "prokka"),
}
errors = {
}
_help = {
"PhyloSanity": "Evaluates completion, contamination, and redundancy of MAGs",
"FuncSanity": "Runs gene callers and annotation programs on MAGs",
}
ap = ArgParse(
args_list,
description=ArgParse.description_builder(
"MetaSanity:\tRun meta/genomes evaluation and annotation pipelines",
_help,
flags
)
)
pc = ProgramCaller(
programs=programs,
flags=flags,
_help=_help,
errors=errors
)
pc.run(ap.args, debug=True)