libsequence
1.9.5
|
unit tests for pop gen summary statistics More...
#include <cmath>
#include <algorithm>
#include <set>
#include <string>
#include <vector>
#include <iostream>
#include <Sequence/VariantMatrix.hpp>
#include <Sequence/VariantMatrixViews.hpp>
#include <Sequence/summstats/classics.hpp>
#include "VariantMatrixFixture.hpp"
#include <boost/test/unit_test.hpp>
Go to the source code of this file.
Functions | |
static double | manual_pi (const Sequence::VariantMatrix &m) |
static double | manual_thetah (const Sequence::VariantMatrix &m, const std::int8_t refstate) |
BOOST_AUTO_TEST_CASE (test_thetapi) | |
BOOST_CHECK_CLOSE (pi, manual, 1e-6) | |
BOOST_AUTO_TEST_CASE (test_num_poly_sites) | |
BOOST_AUTO_TEST_CASE (test_total_num_mutations) | |
BOOST_AUTO_TEST_CASE (test_nbiallelic_sites) | |
BOOST_AUTO_TEST_CASE (test_count_alleles) | |
for (int i=1;i< m.nsam;++i) | |
BOOST_CHECK_CLOSE (w, manual, 1e-6) | |
BOOST_CHECK_CLOSE (h0, m0, 1e-6) | |
BOOST_CHECK_CLOSE (h1, m1, 1e-6) | |
BOOST_CHECK_EQUAL (fwh+h, pi) | |
BOOST_REQUIRE_EQUAL (pi - h, fwh) | |
BOOST_AUTO_TEST_CASE (test_thetah_multiple_derived_states) | |
BOOST_AUTO_TEST_CASE (test_num_haplotypes) | |
BOOST_AUTO_TEST_CASE (test_unique_hap_at_any_index) | |
BOOST_AUTO_TEST_CASE (test_haplotype_diversity) | |
BOOST_AUTO_TEST_CASE (test_rmin) | |
Variables | |
auto | manual = manual_pi(m) |
double | S = m.nsites |
double | d = 0.0 |
auto | h1 = Sequence::thetah(c, 1) |
auto | m0 = manual_thetah(m, 0) |
auto | m1 = manual_thetah(m, 1) |
auto | pi = Sequence::thetapi(c) |
auto | fwh = Sequence::faywuh(c, 0) |
unit tests for pop gen summary statistics
Definition in file testClassicSummstats.cc.