Skip to content

Commit

Permalink
fix handling of deletions where the reference is longer than one bp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoeze committed Jan 26, 2024
1 parent 5e1bc8e commit c2a0e82
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spliceai/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,19 +158,21 @@ def get_delta_scores(record, ann, dist_var, mask):
y_ref = y_ref[:, ::-1]
y_alt = y_alt[:, ::-1]

if ref_len > 1 and alt_len == 1:
# deletions
if ref_len > 1 and (alt_len < ref_len):
y_alt = np.concatenate([
y_alt[:, :cov//2+alt_len],
np.zeros((1, del_len, 3)),
y_alt[:, cov//2+alt_len:]],
axis=1)
# insertions
elif ref_len == 1 and alt_len > 1:
y_alt = np.concatenate([
y_alt[:, :cov//2],
np.max(y_alt[:, cov//2:cov//2+alt_len], axis=1)[:, None, :],
y_alt[:, cov//2+alt_len:]],
axis=1)
#MNP handling
# MNP handling
elif ref_len > 1 and alt_len > 1:
zblock = np.zeros((1,ref_len-1,3))
y_alt = np.concatenate([
Expand Down

0 comments on commit c2a0e82

Please sign in to comment.