Skip to content

Commit

Permalink
Resolve dollar signs to gaps in refine_translation
Browse files Browse the repository at this point in the history
  • Loading branch information
tmaklin committed Jan 8, 2025
1 parent b6e4d25 commit ac4bfed
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/translate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,13 @@ pub fn refine_translation(
for i in 1..(refined.len() - threshold) {
if refined[i - 1] == 'X' {
let midpoint = if i + k - 2 < n_elements && noisy_ms[i + k - 2].0 == k - 1 { k/2 } else { (threshold + 1)/2 };
refined[i - 1] = sbwt.access_kmer(noisy_ms[i + k - 2 - midpoint].1.start)[midpoint] as char;
let nucleotide = sbwt.access_kmer(noisy_ms[i + k - 2 - midpoint].1.start)[midpoint] as char;
refined[i - 1] = if nucleotide == '$' {
// SBWT does not contain this position
'-'
} else {
nucleotide
};
}
}
},
Expand Down

0 comments on commit ac4bfed

Please sign in to comment.