Skip to content

Commit

Permalink
updates user target select logic
Browse files Browse the repository at this point in the history
  • Loading branch information
brwnj committed Mar 2, 2022
1 parent f89ad08 commit 77ab18b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions templates/covdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,20 +172,16 @@
arr.forEach(function (sample_obj) {
let sample = sample_obj.sample
let x_idx = data[chr][sample_obj.sample]["x"].indexOf(cutoff) || -1
let x_idx = -1
let i = 0
// occasionally x proportions have to be shifted slightly
while (x_idx == -1 && i < 10) {
// .indexOf returns -1 when index not found
x_idx = data[chr][sample_obj.sample]["x"].indexOf(cutoff + i)
i += 1
}
let v;
try {
v = data[chr][sample_obj.sample]["y"][x_idx]
} catch (err) {
v = 0
}
let v = data[chr][sample_obj.sample]["y"][x_idx] || 0
a.push({
sample: sample_obj.sample,
Expand Down

0 comments on commit 77ab18b

Please sign in to comment.