mapgd  0.4
A program for the Maximum-likelihood analysis of population genomic data.
 All Data Structures Functions Variables Friends Groups Pages
relatedness_data.h
1 #ifndef _RELATEDNESS_DATA_H_
2 #define _RELATEDNESS_DATA_H_
3 
4 #include <cstring>
5 
6 #include <iostream>
7 #include <cfloat>
8 #include <iomanip>
9 #include <vector>
10 #include <sstream>
11 
12 #include "typedef.h"
13 #include "data.h"
14 
15 #define E_LIM 25
16 
18 class Relatedness : public Data{
19 private:
20  void write (std::ostream&) const;
21  void read (std::istream&);
22  static const Registration registered;
23  static Data * create(const std::vector <std::string> & Columns){
24  return new Relatedness(Columns);
25  }
26  bool likelihoods_;
27 public:
28  char delim;
29 
30  std::string X_str_;
31  std::string Y_str_;
32 
33  id0_t X_, Y_;
34 
35  id1_t sites;
36 
37  float_t e_X_[E_LIM], e_X_ll;
38  float_t e_Y_[E_LIM], e_Y_ll;
39  /*
40  * See ?
41  */
42  float_t f_X_, f_X_ll;
43  float_t f_Y_, f_Y_ll;
44  float_t theta_XY_, theta_XY_ll;
45  float_t gamma_XY_, gamma_XY_ll;
46  float_t gamma_YX_, gamma_YX_ll;
47  float_t delta_XY_, delta_XY_ll;
48  float_t Delta_XY_, Delta_XY_ll;
49  float_t null_ll_, max_ll_;
50 
51  Relatedness();
53  Relatedness(const std::vector <std::string> &);
55  Relatedness(const std::string &, const std::string &);
56 
58  std::string header(void) const;
60  size_t size(void) const;
61 
63  void set_X_name(const std::string &);
64  void set_X_name(const id0_t &);
66  void set_Y_name(const std::string &);
67  void set_Y_name(const id0_t &);
68 
70  void clear(void);
72  void zero(void);
73 
74  static const std::string file_name;
75  static const std::string table_name;
76 
77  const std::string get_file_name(void) const;
78  const std::string get_table_name(void) const;
79 
80  static const bool binary;
81 
82  const bool get_binary() const;
83 
84  Relatedness& operator=(const Relatedness &rhs);
85 };
86 
87 #endif
std::string header(void) const
The header line of plain text files.
Definition: pedigree.cc:95
void read(std::istream &)
use to read Allele. Inherits >>
Definition: pedigree.cc:46
static const std::string table_name
Destination table in Db.
Definition: relatedness_data.h:75
Relatedness data.
Definition: relatedness_data.h:18
void set_Y_name(const std::string &)
Sets the name of the Y sample.
Definition: pedigree.cc:40
void set_X_name(const std::string &)
Sets the name of the X sample.
Definition: pedigree.cc:22
size_t size(void) const
Size in bytes for binary read/write.
Definition: pedigree.cc:100
char delim
the delimiter used when reading/writing the class in text mode.
Definition: relatedness_data.h:28
static const std::string file_name
The dafualt extention for files.
Definition: relatedness_data.h:74
bool likelihoods_
indicate whether likelihoods are recorded.
Definition: relatedness_data.h:26
void write(std::ostream &) const
use to write Allele. Inherits <<
Definition: pedigree.cc:72
void zero(void)
zeros statistics, but doesn't set names to empty.
Definition: pedigree.cc:114
A class which registers a child of Data in Data::new_data_.
Definition: data.h:222
id1_t sites
the number of sites analyzed.
Definition: relatedness_data.h:35
std::string X_str_
the name of the first (X) sample in the compairison.
Definition: relatedness_data.h:30
std::string Y_str_
the name of the second (Y) sample in the compairison.
Definition: relatedness_data.h:31
A class which can be written as flat text file or into an SQL database.
Definition: data.h:34
id0_t Y_
the
Definition: relatedness_data.h:33
void clear(void)
zeros statistics and sets names to empty.
Definition: pedigree.cc:106