36 #ifndef _GENOTYPER_HPP_
37 #define _GENOTYPER_HPP_
41 #include "Population.hpp"
42 #include "Configurable.hpp"
43 #include "MSFormat.hpp"
44 #include "shared_ptr.hpp"
50 class VariantIndicator;
61 inline char genotype_make_pair(
char allele_0,
char allele_1)
63 return (allele_0<<4) | allele_1;
67 inline char genotype_sum(
char genotype)
69 return (genotype>>4) + (genotype & 0x0F);
73 inline char genotype_first(
char genotype)
79 inline char genotype_second(
char genotype)
81 return (genotype & 0x0F);
90 GenotypeData(
const char* begin,
const char* end) : std::vector<char>(begin, end) {}
92 double allele_frequency()
const;
100 typedef shared_ptr<GenotypeData> GenotypeDataPtr;
101 typedef std::map<Locus, GenotypeDataPtr> GenotypeMap;
102 typedef shared_ptr<GenotypeMap> GenotypeMapPtr;
115 char genotype(
const Locus& locus,
116 const Organism& organism,
117 const VariantIndicator& indicator)
const;
120 char genotype(
const Locus& locus,
121 const ChromosomePairRange& range,
122 const VariantIndicator& indicator)
const;
125 GenotypeMapPtr genotype(
const Loci& loci,
126 const Population& population,
127 const VariantIndicator& indicator)
const;
131 #endif // _GENOTYPER_HPP_