We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f89ad08 commit 77ab18bCopy full SHA for 77ab18b
templates/covdist.py
@@ -172,20 +172,16 @@
172
arr.forEach(function (sample_obj) {
173
let sample = sample_obj.sample
174
175
- let x_idx = data[chr][sample_obj.sample]["x"].indexOf(cutoff) || -1
+ let x_idx = -1
176
let i = 0
177
// occasionally x proportions have to be shifted slightly
178
while (x_idx == -1 && i < 10) {
179
+ // .indexOf returns -1 when index not found
180
x_idx = data[chr][sample_obj.sample]["x"].indexOf(cutoff + i)
181
i += 1
182
}
183
- let v;
184
- try {
185
- v = data[chr][sample_obj.sample]["y"][x_idx]
186
- } catch (err) {
187
- v = 0
188
- }
+ let v = data[chr][sample_obj.sample]["y"][x_idx] || 0
189
190
a.push({
191
sample: sample_obj.sample,
0 commit comments