Skip to content

Commit

Permalink
return to before, make ref2binary okay for Ns
Browse files Browse the repository at this point in the history
  • Loading branch information
LaraFuhrmann committed Apr 26, 2024
1 parent e429bd0 commit 1def5e8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/test_tiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_equispaced_use_full_reference_as_region():

assert actual[0][0] == 1
assert actual[0][1] == 201
assert actual[-1][0] == 2748 #2949 #2748 (old number where last windows where excluded)
assert actual[-1][0] == 2949 #2748 (old number where last windows where excluded)
#assert actual[-1][0] + 201 < 3000


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,6 @@ def reference2binary(reference_seq, alphabet):
length_seq = len(reference_seq)
reference_table = np.zeros((length_seq, len(alphabet)))
for base_position, base in enumerate(str(reference_seq)):
reference_table[base_position][alphabet.index(base.upper())] = 1
if alphabet.find(base) >= 0:
reference_table[base_position][alphabet.index(base.upper())] = 1
return reference_table
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,6 @@ def reference2binary(reference_seq, alphabet):
length_seq = len(reference_seq)
reference_table = np.zeros((length_seq, len(alphabet)))
for base_position, base in enumerate(str(reference_seq)):
reference_table[base_position][alphabet.index(base.upper())] = 1
if alphabet.find(base) >= 0:
reference_table[base_position][alphabet.index(base.upper())] = 1
return reference_table
5 changes: 2 additions & 3 deletions viloca/tiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ def get_window_tilings(self) -> List[Tuple[int, int]]:
self.end - 1,
self.incr
))
while window_positions[-1] + self.window_length >= self.end:
del window_positions[-1] # FIXME uncommented to create one single window
#window_positions.append(self.end - 1 - self.window_length)
#while window_positions[-1] + self.window_length >= self.end:
# del window_positions[-1] # FIXME uncommented to create one single window

else:
window_positions = list(range(
Expand Down

0 comments on commit 1def5e8

Please sign in to comment.