Skip to content

Commit

Permalink
Fix bug in prime-editing scaffold-incorporation plotting
Browse files Browse the repository at this point in the history
If read is too short, scaffold incorporation detection will fail because it will check beyond the length of the read.
  • Loading branch information
kclem committed Aug 10, 2023
1 parent 4127dda commit e93d341
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CRISPResso2/CRISPRessoCORE.py
Original file line number Diff line number Diff line change
Expand Up @@ -4519,7 +4519,7 @@ def get_scaffold_len(row, scaffold_start_loc, scaffold_seq):
matches_scaffold_to_this_point = True
has_gaps_to_this_point = True
aln_seq_to_test = row['Aligned_Sequence'][pe_read_possible_scaffold_loc:].replace("-", "")
while i < len(scaffold_seq) and (matches_scaffold_to_this_point or has_gaps_to_this_point):
while i < len(scaffold_seq) and i < len(aln_seq_to_test) and (matches_scaffold_to_this_point or has_gaps_to_this_point):
if matches_scaffold_to_this_point and aln_seq_to_test[i] == scaffold_seq[i] :
num_match_scaffold += 1
else:
Expand Down

0 comments on commit e93d341

Please sign in to comment.