zjshi / gt-pro

MIT License
23 stars 7 forks source link

make sure to output the last SNP for each input file #13

Closed boris-dimitrov closed 3 years ago

boris-dimitrov commented 5 years ago

Just making sure we don't forget to fix this simple bug, after the huge refactor is merged.

        // FIXME.  The loop below doesn't output the last SNP.
        // Also the counts may be off by 1.
        uint64_t cur_count = 0;
        uint64_t cur_snp = kmer_matches[0];
        for (auto it : kmer_matches) {
            if (it != cur_snp) {
                fh << cur_snp << '\t' << cur_count << '\n';
                cur_snp = it;
                cur_count = 1;
            } else {
                ++cur_count;
            }
        }
boris-dimitrov commented 5 years ago

https://github.com/zjshi/gt-pro2.0/pull/18

zjshi commented 3 years ago

Thanks!