forked from NCBI-Hackathons/phenotypeXpression
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_phenox.py
52 lines (37 loc) · 1.2 KB
/
run_phenox.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
#!/usr/bin/env python
import argparse
from phenox.phenox import PhenoX
__version__ = '0.3.3'
def run(args):
print('Input query: %s' % args.query_str)
phenox = PhenoX(args.email, args.query_str, args.outprefix)
phenox.subtype()
# argparse function for options
def getargs():
parser = argparse.ArgumentParser(
prog='run_phenox.py',
formatter_class=argparse.RawTextHelpFormatter,
description='Subclassification of disease states based on the '
'intersection of literature and expression'
)
parser.add_argument(
'-o', metavar='prefix', dest='outprefix',
default='phenox',
help='choose an alternate prefix for outfiles'
)
parser.add_argument(
"--version", action='version',
version='\n'.join(['PhenoX v' + __version__])
)
parser.add_argument(
"query_str", help="disease query term"
)
required_named = parser.add_argument_group('required arguments')
required_named.add_argument(
'-e', dest='email', required=True,
help='NCBI requires an email for database queries'
)
return parser.parse_args()
if __name__ == '__main__':
args = getargs()
run(args)