Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/test_data/md5sum.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
3c9b3ecd5a242f6601521e0b619fde01 bam_kmers_out/bam_1/fastqc_data.txt
f59cf622d7d36b9d2f1170e6d63438ab bam_mult_out/bam_1/fastqc_data.txt
6318172912a6b7f9d348ce7b0b0618ed bam_mult_out/bam_2/fastqc_data.txt
f59cf622d7d36b9d2f1170e6d63438ab bam_orig_dups_out/bam_1/fastqc_data.txt
Expand All @@ -13,3 +12,4 @@ be637ed4a4ebf2f1a64edf30ef1f8bb8 fastq_plain_out/fastq_1/fastqc_data.txt
bc8fd6e40a0ca55cb00634bc306a896c groups_out/bam_1/fastqc_data.txt
a1952ae366bd7c7207f40db833b1d16b sam_out/sam_1/fastqc_data.txt
3fe18e2ee85e3912ede8c57559bf9f88 preseq_out/bam_1/preseq_hist.txt
045639456fbe4a81b5de2789ceb95ddd bam_kmers_out/bam_1/fastqc_data.txt
11 changes: 3 additions & 8 deletions src/kmer_counter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@
#include <utility> // IWYU pragma: keep
#include <vector>

[[nodiscard]] auto
kmer_result::operator<=>(const kmer_result &rhs) const {
return obs_exp < rhs.obs_exp ? std::strong_ordering::less
: obs_exp > rhs.obs_exp ? std::strong_ordering::greater
: std::strong_ordering::equal;
}

[[nodiscard]] auto
kmer_result::decode() const -> std::string {
return kmer_counter::decode_kmer(kmer, kmer_counter::kmer_size);
Expand Down Expand Up @@ -162,7 +155,9 @@ kmer_counter::get_kmer_results() const -> std::vector<kmer_result> {
return x.obs_exp < min_obs_exp_to_report || x.pval > max_pval_to_report;
});
results.erase(std::cbegin(to_erase), std::cend(to_erase));
std::ranges::sort(results, std::greater{});
std::ranges::sort(results, [](const auto &a, const auto &b) {
return a.obs_exp > b.obs_exp || (a.obs_exp == b.obs_exp && a.kmer < b.kmer);
});
if (std::size(results) > n_kmers_to_report)
results.resize(n_kmers_to_report);
return results;
Expand Down
2 changes: 0 additions & 2 deletions src/kmer_counter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ struct kmer_result {
double obs_exp{};
std::uint64_t pos{};
[[nodiscard]] auto
operator<=>(const kmer_result &rhs) const;
[[nodiscard]] auto
string() const -> std::string;
[[nodiscard]] auto
decode() const -> std::string;
Expand Down