mapgd  0.4
A program for the Maximum-likelihood analysis of population genomic data.
 All Data Structures Functions Variables Friends Groups Pages
allele.h
1 /* synonym for population? */
2 
3 #ifndef ALLELE_STAT_H
4 #define ALLELE_STAT_H
5 
6 #include <iostream>
7 #include <iomanip>
8 #include <cfloat>
9 #include <sstream>
10 #include <vector>
11 
12 #include "typedef.h"
13 #include "base.h"
14 #include "data.h"
15 
17 
19 class Allele : public Indexed_data {
20 private:
21  void read(std::istream& str);
23  void write(std::ostream& str) const;
24  static const Registration registered;
25  static Data * create(const std::vector <std::string> & Columns){
26  return new Allele();
27  };
28 public:
29 // void write_binary (std::ostream& out) const;
30 // void read_binary (std::istream& in);
31 
32  char delim;
33 
34  count_t excluded;
35  bool pooled;
36 
37  Allele(); //
38 
39  float_t freq;
40 
41  gt_t ref;
42  gt_t minor;
43  gt_t major;
44  gt_t e1;
45  gt_t e2;
46 
47  float_t error;
48 
49  float_t null_error;
50  float_t null_error2;
51  count_t coverage;
52  float_t efc;
53 
54  float_t ll, monoll, hwell;
55 
56  float_t MM;
57  float_t Mm;
58  float_t mm;
59 
60  count_t N;
61  float_t f;
62  float_t h;
63 
64  float_t gof;
65 
66  Allele & operator=(const Allele &);
67 
68 
70  Allele(std::vector<std::string>) : Allele() {};
71 
72  /*(0){}
73  {
74  std::cerr << "done!\n";
75  };*/
76  std::string header(void) const;
77  static const std::string table_name;
78  static const std::string file_name;
79  static const bool binary;
80  size_t size(void) const;
81 
82  const std::string get_file_name(void) const;
83  const std::string get_table_name(void) const;
84  const bool get_binary(void) const;
85 
86  const std::string sql_header(void) const;
87  const std::string sql_column_names(void) const;
88  const std::string sql_values(void) const;
89 };
90 
91 #endif
float_t null_error2
error rate assuming Minor allele monomorphism.
Definition: allele.h:50
gt_t e2
identity of error2.
Definition: allele.h:45
static const bool binary
Default file extension.
Definition: allele.h:79
const std::string sql_column_names(void) const
Returns the column names in the SQL table.
Definition: allele.cc:205
count_t excluded
A count of the number of samples that were excluded due to filtering criteria.
Definition: allele.h:34
static const std::string table_name
The destination table in the database.
Definition: allele.h:77
std::string header(void) const
returns first two lines of a file.
Definition: allele.cc:193
float_t efc
number of 'effective' chromosomes in the sample.
Definition: allele.h:52
float_t f
HW statistic.
Definition: allele.h:61
void write(std::ostream &str) const
! the write function must be ? by the child class.
Definition: allele.cc:93
bool pooled
Inferred from pooled or labeled sequencing?
Definition: allele.h:35
size_t size(void) const
The size of the class in bytes.
Definition: allele.cc:197
gt_t minor
identity of minor allele.
Definition: allele.h:42
float_t error
ml error rate.
Definition: allele.h:47
Data which has an absolute position.
Definition: data.h:144
gt_t e1
identity of error1
Definition: allele.h:44
float_t null_error
error rate assuming Major allele monomorphism.
Definition: allele.h:49
count_t coverage
population coverage.
Definition: allele.h:51
count_t N
number of individual at the site.
Definition: allele.h:60
float_t h
heterozygosity.
Definition: allele.h:62
const bool get_binary(void) const
Returns the destination table name.
Definition: allele.cc:273
float_t gof
gof statistic.
Definition: allele.h:64
const std::string sql_values(void) const
Returns a string to insert values in an SQL table.
Definition: allele.cc:209
const std::string get_table_name(void) const
Returns the destination table name.
Definition: allele.cc:268
const std::string sql_header(void) const
Returns a string to create an SQL table.
Definition: allele.cc:201
float_t freq
frequency of major allele.
Definition: allele.h:39
float_t Mm
frequency of genotype Mm in the population.
Definition: allele.h:57
float_t hwell
log likelihoods.
Definition: allele.h:54
static const std::string file_name
Default file extension.
Definition: allele.h:78
float_t MM
frequency of genotype MM in the population.
Definition: allele.h:56
Allele & operator=(const Allele &)
use the = operator to assign Allele.
Definition: allele.cc:164
const std::string get_file_name(void) const
Returns the default file extension.
Definition: allele.cc:263
A class which registers a child of Data in Data::new_data_.
Definition: data.h:222
A class which can be written as flat text file or into an SQL database.
Definition: data.h:34
void read(std::istream &str)
The read function must be defined in the child class.
Definition: allele.cc:36
gt_t major
identity major allele.
Definition: allele.h:43
gt_t ref
identity of ref allele.
Definition: allele.h:41
char delim
the delimiter used when reading/writing the class in text mode.
Definition: allele.h:27
Summary statistics from the allele command.
Definition: allele.h:19
float_t mm
frequency of genotype mm in the population.
Definition: allele.h:58
Allele(std::vector< std::string >)
Instance of constructor required by Data, but Allele doesn't actually need the vector to initialize...
Definition: allele.h:70