Skip to content

Commit a0204bb

Browse files
authored
fix: longest homopolymer needs to be case insensitive (#181)
1 parent 3fa7a48 commit a0204bb

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

fgpyo/sequence.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def longest_homopolymer_length(bases: str) -> int:
177177
while i < bases_len - cur_length:
178178
base = bases[i].upper()
179179
j = i + 1
180-
while j < bases_len and bases[j] == base:
180+
while j < bases_len and bases[j].upper() == base:
181181
j += 1
182182
cur_length = max(cur_length, j - i)
183183
# skip over all the bases in the current homopolymer

tests/fgpyo/test_sequence.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def test_reverse_complement(bases: str, expected_rev_comp: str) -> None:
3939
("", 0),
4040
("A", 1),
4141
("AAAA", 4),
42+
("ccgTATGC", 2),
4243
("ACTACGATTTTTACGAT", 5),
4344
("ACTACGATTTTTACGAT", 5),
4445
("TTTTACTACGAACGAGTTTTT", 5),
@@ -124,6 +125,7 @@ def test_levenshtein_dynamic(string1: str, string2: str, levenshtein_distance: i
124125
("", 2, 0),
125126
("", 1, 0),
126127
("A", 1, 1),
128+
("ccgTATGC", 1, 2),
127129
("A", 2, 0),
128130
("ACGT", 2, 2),
129131
("AACCGGTT", 2, 2),

0 commit comments

Comments
 (0)