-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
62 lines (47 loc) · 1.52 KB
/
main.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
import sys
from collections import defaultdict
from ReadFile import ReadFile
from Match import Match
from WriteFile import WriteFile
from Slope import Slope
def main():
print('Start reading links ...')
readlink = ReadFile('Partition6467LinkData.csv')
mp = readlink.readLinks()
print('Links reading complete ...')
# print('Unit ready ...')
print('Start reading probe points ...')
readprobe = ReadFile('Partition6467ProbePoints.csv')
if (len(sys.argv) > 1):
print('Start reading %d probes ...' % int(sys.argv[1]))
prbs = readprobe.readProbes(int(sys.argv[1]))
else:
print('Start reading %d probes ...' % 5000)
prbs = readprobe.readProbes()
sampleIds = prbs.keys()
# print(prbs.items())
mtsq = list()
print('Probes reading complete ...')
for sid in sampleIds:
print('Analyzing probes from sample No.%d ...' % sid)
# __init__(self, plist, mp):
mc = Match(prbs[sid], mp)
print('\tStart calculating candidate points ...')
pcps = mc.probeCandidates()
print('\tCandidate points calculating complete ...')
print('\tStart matching sequence ...')
mtsq.extend(mc.findMatchedSequence(pcps))
print('\tSequence matching complete ...')
print('Start writing matched sequence ...')
wf = WriteFile()
wf.writeMP(mtsq)
print('Sequence writing complete ... ')
print('Start calculating slopes ...')
slope = Slope(mtsq, mp)
slp = slope.calSlope()
print('Slopes calculating complete ...')
print('Start writing slopes ...')
wf.writeS(slp)
print('Slopes writing complete ...')
if __name__ == '__main__':
main()