1 #include <Sequence/summstats/ld.hpp> 2 #include <Sequence/VariantMatrix.hpp> 9 double i, j, rsq, D, Dprime;
14 pairwise_ld_details(
const VariantMatrix& m,
const std::size_t i,
15 const std::size_t j,
const std::int8_t refstate)
17 auto counts = two_locus_haplotype_counts(m, i, j,
false);
21 int ref_i = 0, ref_j = 0, nonref_i = 0, nonref_j = 0, num_nonref_i = 0,
23 int num_nonref_nonref = 0;
24 for (
auto& c : counts)
47 std::vector<PairwiseLDStats>
50 std::vector<PairwiseLDStats> rv;
56 for (std::size_t i = 0; i < m.
nsites - 1; ++i)
58 for (std::size_t j = i + 1; j < m.
nsites; ++j)
The namespace in which this library resides.
std::size_t nsites
Number of sites in data set.
std::vector< double > positions
Position of sites.
Matrix representation of variation data.
std::size_t nsam
Sample size of data set.
std::vector< std::int8_t > data
Data stored in matrix form with rows as sites.