forked from xiezhq/ISEScan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
isescan.py
56 lines (40 loc) · 1.72 KB
/
isescan.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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ISEScan version
version = '1.4'
import argparse
import os
import isPredict
def isPredictSingle(args):
seqfile = args['seqfile'].strip()
path2proteome = args['path2proteome']
path2hmm = args['path2hmm']
seqfilename = os.path.basename(seqfile)
filelist = os.path.join('/tmp', seqfilename+'.list')
with open(filelist, 'w') as fp:
fp.write(seqfile+'\n')
isPredict.isPredict(filelist, path2proteome, path2hmm)
os.remove(filelist)
if __name__ == "__main__":
import textwrap
# Parse command line arguments
descriptStr = '''\
Search IS Profile HMMs against gene database. A typical invocation would be:
python3 isescan.py seqfile proteome hmm
- If you want isescan to report both complete and incomplete (partial) IS elements, you can change the output options (section "Option switch to report partial IS element") in constants.py.'''
parser = argparse.ArgumentParser(prog='isescan', description = textwrap.dedent(descriptStr),
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('--version', action='version', version='%(prog)s' + ' ' + version)
helpStr = 'sequence file in fasta format'
parser.add_argument('seqfile', help = helpStr)
helpStr = 'directory where proteome (each line corresponds to a protein sequence database translated from a genome) files will be placed'
parser.add_argument('path2proteome', help = helpStr)
helpStr = 'directory where the results of hmmsearch will be placed'
parser.add_argument('path2hmm', help = helpStr)
args = parser.parse_args()
args4isPredictSingle = {
'seqfile': args.seqfile,
'path2proteome': args.path2proteome,
'path2hmm': args.path2hmm,
}
isPredictSingle(args4isPredictSingle)