@@ -93,12 +93,13 @@ if __name__ == '__main__':
93
93
l .info ("quite a few sequences (%d) :( might take a while!" % len (seqInfo ))
94
94
95
95
cum_r_ok = np .array ([])
96
- cum_r_high = np .array ([])
97
- cum_r_low = np .array ([])
98
-
99
96
cum_r_ok_ends = np .array ([])
100
- cum_r_high_ends = np .array ([])
101
- cum_r_low_ends = np .array ([])
97
+
98
+ if not options .onlyok :
99
+ cum_r_high = np .array ([])
100
+ cum_r_low = np .array ([])
101
+ cum_r_high_ends = np .array ([])
102
+ cum_r_low_ends = np .array ([])
102
103
103
104
l .info ("Start parsing %d sequences" % len (seqs_to_parse ))
104
105
@@ -129,12 +130,13 @@ if __name__ == '__main__':
129
130
130
131
try :
131
132
r_ok = np_load (file_base , 'r_ok' )
132
- r_high = np_load (file_base , 'r_high' )
133
- r_low = np_load (file_base , 'r_low' )
134
-
135
133
r_ok_ends = np_load (file_base , 'r_ok_ends' )
136
- r_high_ends = np_load (file_base , 'r_high_ends' )
137
- r_low_ends = np_load (file_base , 'r_low_ends' )
134
+ if True : #not options.onlyok:
135
+ r_high = np_load (file_base , 'r_high' )
136
+ r_low = np_load (file_base , 'r_low' )
137
+ r_high_ends = np_load (file_base , 'r_high_ends' )
138
+ r_low_ends = np_load (file_base , 'r_low_ends' )
139
+
138
140
if GAP :
139
141
nons += len (np .flatnonzero (np_load (gap_base , 'nns' )))
140
142
@@ -148,11 +150,12 @@ if __name__ == '__main__':
148
150
#add to the cumulative plot
149
151
if seqLen >= options .cum_seqlen_cutoff :
150
152
cum_r_ok = np .concatenate ((cum_r_ok , r_ok ))
151
- cum_r_high = np .concatenate ((cum_r_high , r_high ))
152
- cum_r_low = np .concatenate ((cum_r_low , r_low ))
153
153
cum_r_ok_ends = np .concatenate ((cum_r_ok_ends , r_ok_ends ))
154
- cum_r_high_ends = np .concatenate ((cum_r_high_ends , r_high_ends ))
155
- cum_r_low_ends = np .concatenate ((cum_r_low_ends , r_low_ends ))
154
+ if True : #not options.onlyok:
155
+ cum_r_high = np .concatenate ((cum_r_high , r_high ))
156
+ cum_r_low = np .concatenate ((cum_r_low , r_low ))
157
+ cum_r_high_ends = np .concatenate ((cum_r_high_ends , r_high_ends ))
158
+ cum_r_low_ends = np .concatenate ((cum_r_low_ends , r_low_ends ))
156
159
157
160
seqLen = totalSeqLen
158
161
@@ -176,7 +179,11 @@ if __name__ == '__main__':
176
179
l .debug ("Calculated score: min %s, max %s" % (np .min (score ), np .max (score )))
177
180
178
181
#determine what the bins are
179
- maxx = max (max (cum_r_ok ), max (cum_r_high ), max (cum_r_low ))
182
+ if False : # True: #options.onlyok:
183
+ maxx = max (max (cum_r_ok ))
184
+ else :
185
+ maxx = max (max (cum_r_ok ), max (cum_r_high ), max (cum_r_low ))
186
+
180
187
maxx = 1500 * ( ( maxx / 1000 ) + 1 )
181
188
182
189
#bins = np.array([0,1,2,3,4] + range(5, int(maxx)))
@@ -189,24 +196,23 @@ if __name__ == '__main__':
189
196
190
197
l .debug ("Bins %s" % bins )
191
198
ok_hist , oe = np .histogram (cum_r_ok , bins = bins )
192
- high_hist , he = np .histogram (cum_r_high , bins = bins )
193
- low_hist , le = np .histogram (cum_r_low , bins = bins )
194
-
195
199
ok_hist_ends , _oee = np .histogram (cum_r_ok_ends , bins = bins )
196
- high_hist_ends , _hee = np .histogram (cum_r_high_ends , bins = bins )
197
- low_hist_ends , _lee = np .histogram (cum_r_low_ends , bins = bins )
198
-
199
- hist_edges = oe
200
-
201
200
rep_ok_hist_ends , roee = np .histogram (cum_r_ok_ends , bins = rBins )
202
- rep_high_hist_ends , rhee = np .histogram (cum_r_high_ends , bins = rBins )
203
- rep_low_hist_ends , rlee = np .histogram (cum_r_low_ends , bins = rBins )
204
-
205
201
rep_ok_hist , roe = np .histogram (cum_r_ok , bins = rBins )
206
- rep_high_hist , rhe = np .histogram (cum_r_high , bins = rBins )
207
- rep_low_hist , rle = np .histogram (cum_r_low , bins = rBins )
208
202
209
203
204
+ if True : # not options.onlyok:
205
+ high_hist , he = np .histogram (cum_r_high , bins = bins )
206
+ low_hist , le = np .histogram (cum_r_low , bins = bins )
207
+ high_hist_ends , _hee = np .histogram (cum_r_high_ends , bins = bins )
208
+ low_hist_ends , _lee = np .histogram (cum_r_low_ends , bins = bins )
209
+ rep_high_hist_ends , rhee = np .histogram (cum_r_high_ends , bins = rBins )
210
+ rep_low_hist_ends , rlee = np .histogram (cum_r_low_ends , bins = rBins )
211
+ rep_high_hist , rhe = np .histogram (cum_r_high , bins = rBins )
212
+ rep_low_hist , rle = np .histogram (cum_r_low , bins = rBins )
213
+
214
+
215
+ hist_edges = oe
210
216
rep_hist_edges = roee
211
217
212
218
#print coverage distribution plot
0 commit comments