Skip to content

Commit

Permalink
Fix calculation of total_mods from being negative
Browse files Browse the repository at this point in the history
The issue was that `all_deletion_coordinates` just tells you how many deletions
were present, but not how long the deletion is.
  • Loading branch information
Colelyman committed Mar 21, 2024
1 parent a85eb93 commit 8ccb0f5
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 @@ -282,7 +282,7 @@ def get_new_variant_object(args, fastq_seq, refs, ref_names, aln_matrix, pe_scaf
#Substitutions out of quantification window
payload['substitutions_outside_window'] = len(payload['all_substitution_positions']) - len(payload['substitution_positions'])
#Sums
payload['total_mods'] = (len(payload['all_insertion_positions'])/2) + len(payload['all_deletion_coordinates']) + len(payload['all_substitution_positions'])
payload['total_mods'] = (len(payload['all_insertion_positions'])/2) + len(payload['all_deletion_positions']) + len(payload['all_substitution_positions'])
payload['mods_in_window'] = payload['substitution_n'] + payload['deletion_n'] + payload['insertion_n']
payload['mods_outside_window'] = payload['total_mods'] - payload['mods_in_window']

Expand Down

0 comments on commit 8ccb0f5

Please sign in to comment.