forked from 865699871/gCAnno
-
Notifications
You must be signed in to change notification settings - Fork 2
/
defineCellTypePipline_svm.py
47 lines (36 loc) · 1.36 KB
/
defineCellTypePipline_svm.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
import os
import time
from pipline.mapping_svm import mapping
import argparse
def main():
parser = argparse.ArgumentParser(description='gcAnno for cell type annotation using svm')
parser.add_argument('-o', '--outdir')
parser.add_argument('-d', '--distanceFile')
parser.add_argument('-q', '--testinput')
parser.add_argument('-rd', '--refinput')
parser.add_argument('-rt', '--reftype')
parser.add_argument('-sg', '--selectGenenum', default=65, type=int)
args = parser.parse_args()
outdir = args.outdir
distanceFile = args.distanceFile
testinput = args.testinput
refinput = args.refinput
reftype = args.reftype
selectGenenum = args.selectGenenum
if not os.path.exists(outdir):
os.makedirs(outdir)
logfile = outdir + 'logmodel.txt'
logfile = open(logfile, 'w')
print('prdict....')
logfile.write('prdict....\n')
logfile.flush()
time_start = time.time()
mapping(distanceFile, testinput, refinput, reftype, outdir,selectGenenum)
time_end = time.time()
print('prdict', (time_end - time_start) / 60)
print('-------------------------------------------------------------')
logfile.write('prdict ' + str((time_end - time_start) / 60) + '\n')
logfile.write('-------------------------------------------------------------\n')
logfile.flush()
if __name__ == '__main__':
main()