Skip to content

Commit

Permalink
fix kmer count
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkLoc committed Jun 14, 2024
1 parent c73d90a commit d7f8d98
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cli/kmer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ pub fn kmer_count(

let mut writer = file_writer(output, compression_level)?;
let mut kmers = HashMap::new();
let (mut sidx, mut eidx) = (0, kmer_len);

for rec in reader.records().flatten() {
let (mut sidx, mut eidx) = (0, kmer_len);
let khash = nthash(rec.seq(), kmer_len);

while eidx <= rec.seq().len() {
let len = rec.seq().len();

while eidx <= len {
let kseq = &rec.seq()[sidx..eidx];
let khash_this = nthash(kseq, kmer_len)[0];
if khash.contains(&khash_this) {
Expand Down

0 comments on commit d7f8d98

Please sign in to comment.