forked from snayfach/IGGsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_iggsearch.py
executable file
·39 lines (35 loc) · 1.29 KB
/
run_iggsearch.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
#!/usr/bin/env python
import os, sys, subprocess as sp, numpy as np, time, shutil
def get_program():
""" Get program specified by user (species, genes, or snps) """
if len(sys.argv) == 1 or sys.argv[1] in ['-h', '--help']:
print('Description: Metagenomic species profiling with enhanced coverage of the human gut microbiome')
print('')
print('Usage: iggsearch.py <command> [options]')
print('')
print('Commands:')
print(' download download reference database of marker genes')
print(' search estimate species abundance from a single metagenome')
print(' merge generate matrix files from multiple runs')
print(' reformat change the file format of from a single run')
print('')
print('Note: use iggsearch.py <command> -h to view usage for a specific command')
quit()
else:
return sys.argv[1]
if __name__ == "__main__":
program = get_program()
if program == 'search':
from iggsearch import search
search.main()
elif program == 'download':
from iggsearch import download
download.main()
elif program == 'merge':
from iggsearch import merge
merge.main()
elif program == 'reformat':
from iggsearch import reformat
reformat.main()
elif program not in ['download', 'search', 'merge', 'reformat']:
sys.exit("\nError: Unrecognized command: '%s'\n" % program)