mapgd  0.4
A program for the Maximum-likelihood analysis of population genomic data.
 All Data Structures Functions Variables Friends Groups Pages
pooled_data.h
1 #ifndef _POOLED_DATA_H_
2 #define _POOLED_DATA_H_
3 
4 #include <iostream>
5 #include <cfloat>
6 #include <iomanip>
7 #include <vector>
8 #include <math.h>
9 
10 #include "typedef.h"
11 #include "base.h"
12 #include "data.h"
13 #include "allele.h"
14 
16 
18 class Pooled_data : public Indexed_data {
19 private:
20  static const Registration registered;
21  static Data * create(const std::vector <std::string> & Columns){
22  return new Pooled_data(Columns);
23  }
24 public:
25  char delim;
26  Base major, minor, ref;
27  count_t coverage;
28  float_t error;
29 
30  std::vector <std::string> names_;
31  std::vector <float_t> p;
32  std::vector <float_t> cov;
33  std::vector <float_t> polyll;
34  std::vector <float_t> fixedll;
35 
36  Pooled_data();
37  Pooled_data(const std::vector <std::string> &);
38 
39  Allele to_allele(const size_t &);
40 
41  void set_sample_names(const std::vector <std::string> &);
42  Pooled_data & operator=(const Pooled_data &);
43 
44  std::string header(void) const;
45  size_t size(void) const;
46 
47  const std::string get_file_name() const {return Pooled_data::file_name;};
48  const std::string get_table_name() const {return Pooled_data::table_name;};
49 
51  void write (std::ostream&) const;
53  void read (std::istream&);
54  static const std::string file_name;
55  static const std::string table_name;
56  static const bool binary;
57  const bool get_binary() const;
58 };
59 
60 #endif
A class converts human readable bases to bit flags.
Definition: base.h:16
size_t size(void) const
The size of the class in bytes.
Definition: pooled_data.cc:131
std::vector< std::string > names_
the sample names.
Definition: pooled_data.h:30
void read(std::istream &)
used to read Allele. Inherits >> from Data
Definition: pooled_data.cc:58
Data which has an absolute position.
Definition: data.h:144
static const std::string table_name
Destination table in Db.
Definition: pooled_data.h:55
Information genereated from pooled data.
Definition: pooled_data.h:18
void write(std::ostream &) const
used to write Allele. Inherits << from Data
Definition: pooled_data.cc:96
Pooled_data & operator=(const Pooled_data &)
use the = operator to assign Pooled_data.
Definition: pooled_data.cc:156
static const std::string file_name
The dafualt extention for files.
Definition: pooled_data.h:54
char delim
the delimiter used when reading/writing the class in text mode.
Definition: pooled_data.h:25
Allele to_allele(const size_t &)
Definition: pooled_data.cc:138
std::vector< float_t > p
a vector of allele frequencies
Definition: pooled_data.h:31
std::vector< float_t > cov
a vector of coverage
Definition: pooled_data.h:32
A class which registers a child of Data in Data::new_data_.
Definition: data.h:222
std::vector< float_t > fixedll
a vector of fixed log likelihoods
Definition: pooled_data.h:34
A class which can be written as flat text file or into an SQL database.
Definition: data.h:34
std::vector< float_t > polyll
a vector of polymorphic log likelihoods
Definition: pooled_data.h:33
Summary statistics from the allele command.
Definition: allele.h:19