Skip to content

Commit 6c11b87

Browse files
all subcommand headers: adding a namespace to wrap a main and to hold the about and footer messages
1 parent e9a6f20 commit 6c11b87

5 files changed

Lines changed: 84 additions & 22 deletions

File tree

src/bound_pop.hpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@
2121
#ifndef SRC_BOUND_POP_HPP_
2222
#define SRC_BOUND_POP_HPP_
2323

24-
int
25-
bound_pop_main(int argc, char *argv[]);
24+
namespace bound_pop {
25+
26+
const auto about_msg = R"(
27+
Estimate a bound on the size of the population using the initial sample.
28+
)";
29+
30+
auto
31+
main(int argc, char *argv[]) -> int;
32+
33+
}; // namespace bound_pop
2634

2735
#endif // SRC_BOUND_POP_HPP_

src/c_curve.hpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@
2121
#ifndef SRC_C_CURVE_HPP_
2222
#define SRC_C_CURVE_HPP_
2323

24-
int
25-
c_curve_main(int argc, char *argv[]);
24+
namespace c_curve {
25+
26+
static constexpr auto about_msg = R"(
27+
Generate the full complexity curve for observed data (no extrapolation).
28+
)";
29+
30+
auto
31+
main(int argc, char *argv[]) -> int;
32+
33+
}; // namespace c_curve
2634

2735
#endif // SRC_C_CURVE_HPP_

src/gc_extrap.hpp

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,42 @@
1-
/* Copyright (C) 2013-2024 University of Southern California and
1+
/* Copyright (C) 2013-2025 University of Southern California and
22
* Andrew D. Smith and Timothy Daley
33
*
44
* Authors: Timothy Daley and Andrew Smith
55
*
6-
* This program is free software: you can redistribute it and/or
7-
* modify it under the terms of the GNU General Public License as
8-
* published by the Free Software Foundation, either version 3 of the
9-
* License, or (at your option) any later version.
6+
* This program is free software: you can redistribute it and/or modify it
7+
* under the terms of the GNU General Public License as published by the Free
8+
* Software Foundation, either version 3 of the License, or (at your option)
9+
* any later version.
1010
*
11-
* This program is distributed in the hope that it will be useful, but
12-
* WITHOUT ANY WARRANTY; without even the implied warranty of
13-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14-
* General Public License for more details.
11+
* This program is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14+
* more details.
1515
*
16-
* You should have received a copy of the GNU General Public License
17-
* along with this program. If not, see
18-
* <http://www.gnu.org/licenses/>.
16+
* You should have received a copy of the GNU General Public License along
17+
* with this program. If not, see <http://www.gnu.org/licenses/>.
1918
*/
2019

2120
#ifndef SRC_GC_EXTRAP_HPP_
2221
#define SRC_GC_EXTRAP_HPP_
2322

24-
int
25-
gc_extrap_main(int argc, char *argv[]);
23+
namespace gc_extrap {
24+
25+
static constexpr auto about_msg = R"(
26+
Estimate the size of the part of the genome to be covered by mapped reads.
27+
)";
28+
29+
static constexpr auto footer_msg = R"(
30+
This approach is described in Daley & Smith (2014). The method is the same as
31+
for lc_extrap: using rational function approximation to a power-series
32+
expansion for the number of "unobserved" bases in the initial sample. The
33+
gc_extrap method is adapted to deal with individual nucleotides rather than
34+
distinct reads.
35+
)";
36+
37+
auto
38+
main(int argc, char *argv[]) -> int;
39+
40+
}; // namespace gc_extrap
2641

2742
#endif // SRC_GC_EXTRAP_HPP_

src/lc_extrap.hpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,23 @@
2121
#ifndef SRC_LC_EXTRAP_HPP_
2222
#define SRC_LC_EXTRAP_HPP_
2323

24-
int
25-
lc_extrap_main(int argc, char *argv[]);
24+
namespace lc_extrap {
25+
26+
constexpr auto about_msg = R"(
27+
Estimate a complexity curve (e.g., for a sequencing library).
28+
)";
29+
30+
constexpr auto footer_msg = R"(
31+
This is the approach described in Daley & Smith (2013). The method applies
32+
rational function approximation via continued fractions with the original goal
33+
of estimating the number of distinct reads that a sequencing library would
34+
yield upon deeper sequencing. This method has been used for many different
35+
purposes since then.
36+
)";
37+
38+
auto
39+
main(int argc, char *argv[]) -> int;
40+
41+
}; // namespace lc_extrap
2642

2743
#endif // SRC_LC_EXTRAP_HPP_

src/pop_size.hpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,22 @@
2121
#ifndef SRC_POP_SIZE_HPP_
2222
#define SRC_POP_SIZE_HPP_
2323

24-
int
25-
pop_size_main(int argc, char *argv[]);
24+
namespace pop_size {
25+
26+
static constexpr auto about_msg = R"(
27+
Estimate the population size using a small sample from the population.
28+
)";
29+
30+
static constexpr auto footer_msg = R"(
31+
Estimate the total population size using the approach described in Daley &
32+
Smith (2013), extrapolating to very long range. Default parameters assume that
33+
the initial sample represents at least 1e-9 of the population, which is
34+
sufficient for every example application we have seen.
35+
)";
36+
37+
auto
38+
main(int argc, char *argv[]) -> int;
39+
40+
}; // namespace pop_size
2641

2742
#endif // SRC_POP_SIZE_HPP_

0 commit comments

Comments
 (0)