libsequence  1.9.5
Sequence::HKAresults Struct Reference

results of calculations of the HKA test More...

#include <Sequence/HKA.hpp>

Public Types

enum  chisq_tuple_element : std::int8_t { POLY, DIV, POLYA, POLYB }
 
typedef std::tuple< double, double, double, double > chisq_tuple
 

Public Member Functions

 HKAresults (const std::vector< double > &_thetas, const std::vector< chisq_tuple > &_chisquareds, const double &_fhat, const double &_That, const double &_xsq, const double &_xsqA, const double &_xsqB)
 

Public Attributes

const std::vector< double > thetas
 
std::vector< chisq_tuplechisquareds
 
const double fhat
 
const double That
 
const double xsq
 
const double xsqA
 
const double xsqB
 

Detailed Description

results of calculations of the HKA test

Store the list of estimates of theta for each locus, as well as f (ratio of Ne of spp B relative to sppA), and T, the divergence time between species (on the scale of the Ne of spp A).

Definition at line 69 of file HKA.hpp.

Member Typedef Documentation

◆ chisq_tuple

typedef std::tuple<double,double,double,double> Sequence::HKAresults::chisq_tuple

The tuple represents the contribution of a locus to the total value of the HKA chi-squared statistic

Definition at line 81 of file HKA.hpp.

Member Enumeration Documentation

◆ chisq_tuple_element

enum Sequence::HKAresults::chisq_tuple_element : std::int8_t
strong

The enum documents the order in which the deviations are stored in chisq_tuple

Definition at line 86 of file HKA.hpp.

Constructor & Destructor Documentation

◆ HKAresults()

Sequence::HKAresults::HKAresults ( const std::vector< double > &  _thetas,
const std::vector< chisq_tuple > &  _chisquareds,
const double &  _fhat,
const double &  _That,
const double &  _xsq,
const double &  _xsqA,
const double &  _xsqB 
)
explicit
Parameters
_thetasa vector containing the estimats of theta for each locus
_chisquaredsa vector of the per-locus contributions to the test statistic
_fhatan estimate of the relative Ne of species b to species a
_Thatan estimate of the divergence time, on the scale of Ne in species a.
_xsqthe Chi-squared statistic for the HKA test
_xsqAThe HKA chi-squared statistic, only considering species A
_xsqBThe HKA chi-squared statistic, only considering species B

Definition at line 80 of file HKA.cc.

Member Data Documentation

◆ chisquareds

std::vector< chisq_tuple > Sequence::HKAresults::chisquareds

The order of elements is the same as the loci that were placed in the std::vector< HKAdata > passed to calcHKA. Members of the tuple are accessed via the std::get<int> template function. For example, if you have an HKAresults object called hkares, and you want to retrieve the deviation in divergence of the first locus:

std::get< DIV >(hkares.chisquareds[0]);

The template argument to std::get can be taken from chisq_tuple_elements so that it's readable.

Definition at line 100 of file HKA.hpp.

◆ fhat

const double Sequence::HKAresults::fhat

The relative Ne of species B relative to species A

Definition at line 105 of file HKA.hpp.

◆ That

const double Sequence::HKAresults::That

The estimate of the species divergence time, on the scale (1+fhat)*4Ne generations

Definition at line 110 of file HKA.hpp.

◆ thetas

const std::vector< double > Sequence::HKAresults::thetas

Vector of theta estimates from the HKA test. They are in the same order as the loci that were placed in the std::vector< HKAdata > passed to calcHKA

Definition at line 76 of file HKA.hpp.

◆ xsq

const double Sequence::HKAresults::xsq

The HKA chi-squared statistic

Definition at line 114 of file HKA.hpp.

◆ xsqA

const double Sequence::HKAresults::xsqA

The HKA chi-squared statistic, only considering species A

Definition at line 119 of file HKA.hpp.

◆ xsqB

const double Sequence::HKAresults::xsqB

The HKA chi-squared statistic, only considering species B

Definition at line 124 of file HKA.hpp.


The documentation for this struct was generated from the following files: