Skip to content

Commit

Permalink
Bugfix: Correct position offset
Browse files Browse the repository at this point in the history
  • Loading branch information
enormandeau committed May 12, 2023
1 parent 5741159 commit 9ff671e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions 01_scripts/04_extract_features_from_alignments.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ def parse_cigar_string(cigar):
sequence = l[9]
complexity = round(len(gzip.compress("".join(sequence[:]).encode())) / len(sequence), 3)

# Correct position at start of contig
if query_pos <= window_length:
target_offset = (len(sequence) // 2) - query_pos
else:
target_offset = len(sequence) // 2
## Correct position at start of contig
#if query_pos <= window_length:
# target_offset = (len(sequence) // 2) - query_pos
#else:
# target_offset = len(sequence) // 2

target_pos += target_offset
target_pos += window_length

num_Ns = sequence.count("N")
num_diff = int(l[11].split(":")[2])
Expand Down

0 comments on commit 9ff671e

Please sign in to comment.