A library for working with phylogenetic and population genetic data.
v0.32.0
subsample.hpp
Go to the documentation of this file.
1 #ifndef GENESIS_POPULATION_FUNCTION_SUBSAMPLE_H_
2 #define GENESIS_POPULATION_FUNCTION_SUBSAMPLE_H_
3 
4 /*
5  Genesis - A toolkit for working with phylogenetic data.
6  Copyright (C) 2014-2024 Lucas Czech
7 
8  This program is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>.
20 
21  Contact:
22  Lucas Czech <lucas.czech@sund.ku.dk>
23  University of Copenhagen, Globe Institute, Section for GeoGenetics
24  Oster Voldgade 5-7, 1350 Copenhagen K, Denmark
25 */
26 
36 
37 namespace genesis {
38 namespace population {
39 
40 // =================================================================================================
41 // Subscaling and rescaling
42 // =================================================================================================
43 
62 void subscale_counts(
63  SampleCounts& sample,
64  size_t max_depth
65 );
66 
72 void subscale_counts(
73  Variant& variant,
74  size_t max_depth
75 );
76 
87 void rescale_counts(
88  SampleCounts& sample,
89  size_t target_depth
90 );
91 
97 void rescale_counts(
98  Variant& variant,
99  size_t target_depth
100 );
101 
102 // =================================================================================================
103 // Subsampling and resampling with replacement
104 // =================================================================================================
105 
123  SampleCounts& sample,
124  size_t max_depth
125 );
126 
133  Variant& variant,
134  size_t max_depth
135 );
136 
150 void resample_counts(
151  SampleCounts& sample,
152  size_t target_depth
153 );
154 
160 void resample_counts(
161  Variant& variant,
162  size_t target_depth
163 );
164 
165 // =================================================================================================
166 // Subsampling without replacement
167 // =================================================================================================
168 
185  SampleCounts& sample,
186  size_t max_depth
187 );
188 
195  Variant& variant,
196  size_t max_depth
197 );
198 
199 } // namespace population
200 } // namespace genesis
201 
202 #endif // include guard
genesis::population::resample_counts
void resample_counts(SampleCounts &sample, size_t target_depth)
Resample all counts in a SampleCounts sample to a new target_depth.
Definition: subsample.cpp:248
sample_counts.hpp
genesis
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
Definition: placement/formats/edge_color.cpp:42
genesis::population::subsample_counts_with_replacement
void subsample_counts_with_replacement(SampleCounts &sample, size_t max_depth)
Transform a SampleCounts sample by subsampling the nucleotide counts (A, C, G, T, as well as N and D)...
Definition: subsample.cpp:228
genesis::population::subsample_counts_without_replacement
void subsample_counts_without_replacement(SampleCounts &sample, size_t max_depth)
Transform a SampleCounts sample by subsampling the nucleotide counts (A, C, G, T, as well as N and D)...
Definition: subsample.cpp:268
variant.hpp
genesis::population::subscale_counts
void subscale_counts(SampleCounts &sample, size_t max_depth)
Transform a SampleCounts sample by sub-scaling the base counts (A, C, G, T, as well as N and D) to su...
Definition: subsample.cpp:149
genesis::population::rescale_counts
void rescale_counts(SampleCounts &sample, size_t target_depth)
Transform a SampleCounts sample by re-scaling the base counts (A, C, G, T, as well as N and D) to sum...
Definition: subsample.cpp:166