A library for working with phylogenetic data.
v0.25.0
diversity.hpp File Reference
#include "genesis/population/functions/base_counts.hpp"
#include "genesis/population/functions/variant.hpp"
#include "genesis/population/variant.hpp"
#include "genesis/utils/containers/filter_iterator.hpp"
#include "genesis/utils/containers/matrix.hpp"
#include "genesis/utils/containers/transform_iterator.hpp"
#include <cassert>
#include <cmath>
#include <cstdint>
#include <iterator>
#include <string>
#include <type_traits>
#include <vector>

Go to the source code of this file.

Classes

struct  PoolDiversityResults
 Data struct to collect all diversity statistics computed by pool_diversity_measures(). More...
 
struct  PoolDiversitySettings
 Settings used by different pool-sequencing corrected diversity statistics. More...
 

Namespaces

 genesis
 Container namespace for all symbols of genesis in order to keep them separate when used as a library.
 
 genesis::population
 

Functions

double a_n (size_t n)
 Compute a_n, the sum of reciprocals. More...
 
double alpha_star (double n)
 Compute alpha* according to Achaz 2008 and Kofler et al. 2011. More...
 
double b_n (size_t n)
 Compute b_n, the sum of squared reciprocals. More...
 
double beta_star (double n)
 Compute beta* according to Achaz 2008 and Kofler et al. 2011. More...
 
double f_star (double a_n, double n)
 Compute f* according to Achaz 2008 and Kofler et al. 2011. More...
 
double heterozygosity (BaseCounts const &sample)
 Compute classic heterozygosity. More...
 
double n_base (size_t coverage, size_t poolsize)
 Compute the n_base term used for Tajima's D in Kofler et al. 2011, using a faster closed form expression. More...
 
double n_base_matrix (size_t coverage, size_t poolsize)
 Compute the n_base term used for Tajima's D in Kofler et al. 2011, following their approach. More...
 
template<class ForwardIterator >
PoolDiversityResults pool_diversity_measures (PoolDiversitySettings const &settings, ForwardIterator begin, ForwardIterator end)
 Compute Theta Pi, Theta Watterson, and Tajia's D in their pool-sequencing corrected versions according to Kofler et al. More...
 
template<class ForwardIterator >
double tajima_d_pool (PoolDiversitySettings const &settings, ForwardIterator begin, ForwardIterator end)
 Compute the pool-sequencing corrected version of Tajima's D according to Kofler et al. More...
 
template<class ForwardIterator >
double tajima_d_pool (PoolDiversitySettings const &settings, ForwardIterator begin, ForwardIterator end, double theta_pi, double theta_watterson)
 Compute the pool-sequencing corrected version of Tajima's D according to Kofler et al. More...
 
double tajima_d_pool_denominator (PoolDiversitySettings const &settings, size_t snp_count, double theta)
 Compute the denominator for the pool-sequencing correction of Tajima's D according to Kofler et al. More...
 
template<class ForwardIterator >
double theta_pi (ForwardIterator begin, ForwardIterator end)
 Compute classic theta pi, that is, the sum of heterozygosities. More...
 
double theta_pi_pool (PoolDiversitySettings const &settings, BaseCounts const &sample)
 Compute theta pi with pool-sequencing correction according to Kofler et al, for a single BaseCounts, that is, its heterozygosity() divided by the correction denominator. More...
 
template<class ForwardIterator >
double theta_pi_pool (PoolDiversitySettings const &settings, ForwardIterator begin, ForwardIterator end)
 Compute theta pi with pool-sequencing correction according to Kofler et al, that is, the sum of heterozygosities divided by the correction denominator. More...
 
double theta_pi_pool_denominator (PoolDiversitySettings const &settings, size_t nucleotide_count)
 Compute the denominator for the pool-sequencing correction of theta pi according to Kofler et al. More...
 
template<class ForwardIterator >
double theta_watterson_pool (PoolDiversitySettings const &settings, ForwardIterator begin, ForwardIterator end)
 Compute theta watterson with pool-sequencing correction according to Kofler et al. More...
 
double theta_watterson_pool_denominator (PoolDiversitySettings const &settings, size_t nucleotide_count)
 Compute the denominator for the pool-sequencing correction of theta watterson according to Kofler et al. More...