2 #include <Sequence/AlleleCountMatrix.hpp> 10 for (std::size_t i = 0; i < ac.counts.size(); i += ac.ncol)
12 std::int32_t nsam = 0;
13 double homozygosity = 0.0;
14 for (std::size_t j = i; j < i + ac.ncol; ++j)
17 homozygosity +=
static_cast<double>(
18 ac.counts[j] * (ac.counts[j] - 1));
21 - homozygosity /
static_cast<double>(nsam * (nsam - 1));
The namespace in which this library resides.
double thetapi(const AlleleCountMatrix &ac)
Mean pairwise differences.
Matrix representation of allele counts in a VariantMatrix To be constructed.