-
Notifications
You must be signed in to change notification settings - Fork 1
/
crisprviva.py
55 lines (45 loc) · 1.37 KB
/
crisprviva.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
import argparse
import sys
from src import ui
prog = 'CRISPR-viva'
usage = 'python crisprviva.py <command> [options]'
p = argparse.ArgumentParser(prog=prog,usage=usage, formatter_class=argparse.RawDescriptionHelpFormatter)
sp = p.add_subparsers(title='Command',metavar='')
p_ref = sp.add_parser('ref', help='Building reference')
ui.parse_ref(p_ref)
p_expr = sp.add_parser('expr', help='RNA Expression profile analysis')
ui.parse_expr(p_expr)
p_elim = sp.add_parser('elim', help='gRNA generation for viral elimination')
ui.parse_elim(p_elim)
p_det = sp.add_parser('det', help='gRNA generation for viral detection')
ui.parse_det(p_det)
p_util = sp.add_parser('util', help='Utilities')
ui.parse_util(p_util)
opts = p.parse_args()
if len(sys.argv) == 1:
p.print_help()
sys.exit(1)
elif len(sys.argv) == 2:
if sys.argv[1] == 'ref':
p_ref.print_help()
elif sys.argv[1] == 'expr':
p_expr.print_help()
elif sys.argv[1] == 'elim':
p_elim.print_help()
elif sys.argv[1] == 'det':
p_det.print_help()
elif sys.argv[1] == 'util':
p_util.print_help()
else:
p.print_help()
sys.exit(1)
if sys.argv[1] == 'ref':
ui.run_ref(opts)
elif sys.argv[1] == 'expr':
ui.run_expr(opts)
elif sys.argv[1] == 'elim':
ui.run_elim(opts)
elif sys.argv[1] == 'det':
ui.run_det(opts)
elif sys.argv[1] == 'util':
ui.run_util(opts)