libsequence  1.9.5
HKA.hpp
Go to the documentation of this file.
1 /*
3 
4 Copyright (C) 2003-2009 Kevin Thornton, krthornt[]@[]uci.edu
5 
6 Remove the brackets to email me.
7 
8 This file is part of libsequence.
9 
10 libsequence is free software: you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation, either version 3 of the License, or
13 (at your option) any later version.
14 
15 libsequence is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 long with libsequence. If not, see <http://www.gnu.org/licenses/>.
22 
23 */
24 
25 #ifndef __HKA_HPP__
26 #define __HKA_HPP__
27 
28 #include <vector>
29 #include <tuple>
30 #include <cstdint>
31 
32 namespace Sequence
33 {
39  struct HKAdata
40  {
45  const unsigned SA,SB; //# seg sites
50  const double D; // divergence
54  const unsigned nA,nB; //sample sizes
55  HKAdata();
56  HKAdata(const HKAdata & d);
57  HKAdata(unsigned sa,unsigned sb,double d,
58  unsigned na,unsigned nb);
59  };
60 
69  struct HKAresults
70  {
76  const std::vector< double > thetas;
81  typedef std::tuple<double,double,double,double> chisq_tuple;
86  enum class chisq_tuple_element : std::int8_t {POLY,DIV,POLYA,POLYB};
100  std::vector< chisq_tuple > chisquareds;
105  const double fhat;
110  const double That;
114  const double xsq;
119  const double xsqA;
124  const double xsqB;
125  explicit HKAresults (const std::vector<double> & _thetas,
126  const std::vector< chisq_tuple > & _chisquareds,
127  const double & _fhat, const double & _That,
128  const double & _xsq,
129  const double & _xsqA, const double & _xsqB);
130  };
131 
132  HKAresults calcHKA ( const std::vector< HKAdata > & data );
133 } //namespace Sequence
134 
135 #endif
const double That
Definition: HKA.hpp:110
const double fhat
Definition: HKA.hpp:105
The namespace in which this library resides.
results of calculations of the HKA test
Definition: HKA.hpp:69
Data from a single locus for an HKA test.
Definition: HKA.hpp:39
const double xsqA
Definition: HKA.hpp:119
std::vector< chisq_tuple > chisquareds
Definition: HKA.hpp:100
const unsigned SA
Definition: HKA.hpp:45
const unsigned nA
Definition: HKA.hpp:54
std::tuple< double, double, double, double > chisq_tuple
Definition: HKA.hpp:81
const double D
Definition: HKA.hpp:50
const double xsq
Definition: HKA.hpp:114
HKAresults calcHKA(const std::vector< HKAdata > &data)
Definition: HKA.cc:100
const std::vector< double > thetas
Definition: HKA.hpp:76
const double xsqB
Definition: HKA.hpp:124