Skip to content

Commit 7d5d684

Browse files
Merge pull request #205 from smithlabcode/pmd-coverage-and-binsize
pmd guarantee coverage
2 parents a5c618d + d100541 commit 7d5d684

4 files changed

Lines changed: 9 additions & 11 deletions

File tree

src/analysis/pmd.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,8 +1064,7 @@ binsize_selection(const size_t resolution, const size_t min_bin_sz,
10641064
if (frac_passed < min_frac_passed)
10651065
bin_size += resolution;
10661066
}
1067-
return frac_passed <= num_lim<double>::min() ?
1068-
num_lim<size_t>::max() : bin_size;
1067+
return frac_passed < min_frac_passed ? num_lim<size_t>::max() : bin_size;
10691068
}
10701069

10711070

src/common/counts_header.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ using std::to_string;
3838
using bamxx::bgzf_file;
3939

4040
void
41-
write_counts_header_from_chom_sizes(const vector<string> &chrom_names,
42-
const vector<uint64_t> &chrom_sizes,
43-
bgzf_file &out) {
41+
write_counts_header_from_chrom_sizes(const vector<string> &chrom_names,
42+
const vector<uint64_t> &chrom_sizes,
43+
bgzf_file &out) {
4444
const auto version = "#DNMTOOLS " + string(VERSION) + "\n";
4545
out.write(version.c_str());
4646
for (auto i = 0u; i < size(chrom_sizes); ++i) {

src/common/counts_header.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
#include "bamxx.hpp"
2727

2828
void
29-
write_counts_header_from_chom_sizes(const std::vector<std::string> &chrom_names,
30-
const std::vector<uint64_t> &chrom_sizes,
31-
bamxx::bgzf_file &out);
29+
write_counts_header_from_chrom_sizes(const std::vector<std::string> &chrom_names,
30+
const std::vector<uint64_t> &chrom_sizes,
31+
bamxx::bgzf_file &out);
3232

3333
// returns -1 on failure, 0 on success
3434
int

src/utils/xcounts.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* xcounts: reformat counts so they only give the m and u counts in a
2-
* wig format
2+
* dynamic step wig format
33
*
44
* Copyright (C) 2023 Andrew D. Smith
55
*
@@ -145,14 +145,13 @@ main_xcounts(int argc, const char **argv) {
145145
if (!out) throw dnmt_error("error opening output file: " + outfile);
146146

147147
if (n_threads > 1) {
148-
// ADS: something breaks when we use the thread for the input
149148
if (in.is_bgzf())
150149
tpool.set_io(in);
151150
tpool.set_io(out);
152151
}
153152

154153
if (!genome_file.empty())
155-
write_counts_header_from_chom_sizes(chrom_names, chrom_sizes, out);
154+
write_counts_header_from_chrom_sizes(chrom_names, chrom_sizes, out);
156155

157156
// use the kstring_t type to more directly use the BGZF file
158157
kstring_t line{0, 0, nullptr};

0 commit comments

Comments
 (0)