-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebugCMDs.txt
155 lines (120 loc) · 3.21 KB
/
debugCMDs.txt
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
set confirm off
#break alnSeq.c:256
#break alnSeq.c:798
#break memWater/memWater.h:252
#break needleman/needleman.h:107
#break general/alnStruct.h:561
define runcmd
run -query-ref-scan -use-water -two-bit -min-score 5 -ref test-ref.fa -query test-qry.fa
end
runcmd
#print alignment array from Hirschberg
define phirschaln
set $arry = $arg0
set $gapCnt = 0
set $snpCnt = 0
while(*$arry > 0)
set $gapCnt = $gapCnt + (*$arry == 1)
set $snpCnt = $snpCnt + (*$arry == 2)
set $arry = $arry + 1
end
printf "Gaps: %i\n", $gapCnt
printf "Snps: %i\n", $snpCnt
end
# Print alterntative alignments
define pAltAln
set $scores = $arg0->scoreAryL
set $start = $arg0->startIndexAryUL
set $end = $arg0->endIndexAryUL
set $lenAry = $arg0->lenArraysUL
set $indexOn = 0
while($indexOn < $lenAry)
printf "%i", *$scores
printf "\t%i", *$start
printf "\t%i\n", *$end
set $scores = ++$scores
set $start = ++$start
set $end = ++$end
set $indexOn = ++$indexOn
end
end
# Print number of gaps/snps/matches in alignment
define sumaln
set $alnStr = $arg0
set $noBaseI = 0
set $softMaskI = 0
set $gapsI = 0
set $snpsI = 0
set $matchesI = 0
# Get of leading zeros
while(*$alnStr == 0)
set $alnStr = $alnStr + 1
end
# Count till end of alignment
while(*$alnStr != 0)
if *$alnStr == 0
set $noBaseI = $noBaseI + 1
end
if *$alnStr == 1
set $softMaskI = $softMaskI + 1
end
if *$alnStr == 2
set $gapsI = $gapsI + 1
end
if *$alnStr == 3
set $snpsI = $snpsI + 1
end
if *$alnStr == 4
set $matchesI = $matchesI + 1
end
set $alnStr = $alnStr + 1
end
printf "noBase: %i\n", $noBaseI
printf "sMasks: %i\n", $softMaskI
printf "gaps: %i\n", $gapsI
printf "snps: %i\n", $snpsI
printf "matches: %i\n", $matchesI
set $totalI = $noBaseI + $softMaskI + $gapsI
set $totalI = $totalI + $snpsI + $matchesI
printf "total: %i\n", $totalI
end
# Print out the hirschberg reverse and forward score rows
define pscores
printf "%3li", forwardIndelColL
set $iIndex = 0
while($iIndex < refLenUL)
printf " %3li", *(forwardScoreRowL +refStartUL+$iIndex)
set $iIndex = $iIndex + 1
end
printf "\n"
set $iIndex = 0
while($iIndex < refLenUL)
printf "%3li ", *(reverseScoreRowL +refStartUL+$iIndex)
set $iIndex = $iIndex + 1
end
printf "%3li\n", reverseIndelColL
set $iIndex = 0
set $sumI = *(reverseScoreRowL + refStartUL)
set $sumI = $sumI + forwardIndelColL
printf "%3li ", $sumI
while($iIndex < refLenUL - 1)
set $sumI = *(forwardScoreRowL + refStartUL +$iIndex)
set $iIndex = $iIndex + 1
set $sumI=$sumI+*(reverseScoreRowL+refStartUL+$iIndex)
printf "%3li ", $sumI
end
set $sumI = *(forwardScoreRowL + refLenUL - 1)
set $sumI = $sumI + reverseIndelColL
printf "%3li\n", $sumI
end
# Quick function to get length of a string
define lenstr
set $tmpStr = $arg0
set $lenI = 0
while(*$tmpStr != '\0')
set $tmpStr = $tmpStr + 1
set $lenI = $lenI + 1
end
p $lenI
end
#break hirschberg.c:464 if midPointUI - 1 + refOffsetUI < refOffsetUI