Skip to content

Commit aac09d4

Browse files
src/gc_extrap.cpp: updating default arg values
1 parent ca11a12 commit aac09d4

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/gc_extrap.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ write_output(const std::string &outfile, const std::uint32_t bin_size,
4949

5050
out << "TOTAL_BASES\tEXPECTED_DISTINCT\n";
5151

52+
out.setf(std::ios_base::fixed, std::ios_base::floatfield);
5253
out << 0 << '\t' << 0 << '\n';
5354
for (auto i = 0u; i < std::size(coverage_estimates); ++i)
5455
out << (i + 1) * base_step_size << '\t' << coverage_estimates[i] * bin_size
@@ -102,7 +103,7 @@ gc_extrap::main(int argc, char *argv[]) -> int { // NOLINT(*-avoid-c-arrays)
102103
std::uint32_t bin_size = 10;
103104
double base_step_size = 1.0e8;
104105
std::uint32_t max_width = 10000;
105-
double max_extrap = 1.0e12;
106+
std::uint64_t max_extrap_int{1'000'000'000'000};
106107
std::uint32_t n_bootstraps = 100;
107108
std::uint32_t seed = 408;
108109
double c_level = 0.95;
@@ -124,14 +125,17 @@ gc_extrap::main(int argc, char *argv[]) -> int { // NOLINT(*-avoid-c-arrays)
124125
app.add_option("-i,--input", infile, "input file")
125126
->option_text("FILE")
126127
->required()
128+
// ->check(CLI::ReadPermission)
127129
->check(CLI::ExistingFile);
128130
app.add_option("-o,--output", outfile, "coverage yield output file")
129131
->option_text("FILE")
132+
// ->check(CLI::WritePermission)
130133
->required();
131134
app.add_option("-w,--max_width", max_width,
132135
"max fragment length, set equal to read length for single end reads");
133136
app.add_option("-b,--bin_size", bin_size, "bin size");
134-
app.add_option("-e,--extrap", max_extrap, "maximum extrapolation in base pairs");
137+
app.add_option("-e,--extrap", max_extrap_int, "maximum extrapolation (must be integer)")
138+
->check(CLI::PositiveNumber);
135139
app.add_option("-s,--step", base_step_size, "step size in bases between extrapolations");
136140
app.add_option("-n,--bootstraps", n_bootstraps, "number of bootstraps");
137141
app.add_option("-c,--cval", c_level, "level for confidence intervals");
@@ -151,6 +155,8 @@ gc_extrap::main(int argc, char *argv[]) -> int { // NOLINT(*-avoid-c-arrays)
151155
}
152156
CLI11_PARSE(app, argc, argv);
153157

158+
const double max_extrap = max_extrap_int;
159+
154160
const auto bam_format_input = is_sam_or_bam_format(infile);
155161

156162
const auto input_format = bam_format_input ? "BAM" : "BED";

0 commit comments

Comments
 (0)