-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpeakal.py
65 lines (47 loc) · 1.42 KB
/
peakal.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
57
58
59
60
61
62
63
64
65
""" peakal.py
Align peaks of samples in specified input file in delimited text format
Aug 7, 2015
"""
import DDFA as ddfa
import sys
printtofile=False
plotfig = True
verb = True
# Set up inputs
#basepath='./Ryan/'
#ext = '.txt'
#fname = basepath + 'B_peak_height'
#fnamea = basepath + 'A_peak_height'
#fname1 = basepath + 'set1'
#fname2 = basepath + 'set2'
#fname3 = basepath + 'set3'
#fnameh = basepath + 'hnsdata'
#fnamebug = basepath + 'hns_c_03_test'
#delimiter='\t'
#fin = fname+ext
#fout = fname + '_out' + ext
#sizelims=100,200
# initialize
delimiter = '\t'
# Command line args:
if len(sys.argv)>1:
fin = sys.argv[1]
sizelims = sys.argv[2]
if len(sys.argv)==4:
fout = sys.argv[3]
else:
fout = None
else:
# @@@@ check for python 3, then the func is just input()
fin = raw_input('Enter input filename (must be in current dir, or provide full path): ')
delimiter = raw_input('Input filename delimiter (default ''\t''): ' )
sizelims = raw_input('Enter size range (end point inclusive). E.g. 100,200: ')
fout = raw_input('Enter output filename. Press enter for default: ')
if fout=='': fout = None
if delimiter=='': delimiter = '\t'
ddfa.test_main(fin, sizelims, outfile=fout, plotfig=plotfig, verb=verb, printtofile=printtofile)
# in HNS file:
# check C_C03.fsa
# sizes ~ 150-156
# for some reason, duplicates found is incorrect:
# Duplicates found: [122 156 200 150 197 200]