|
ʻOhana
Population structure, admixture history, and selection using learning methods.
|
7 #ifndef JADE_GENOTYPE_MATRIX_FACTORY_HPP__
8 #define JADE_GENOTYPE_MATRIX_FACTORY_HPP__
10 #include "jade.discrete_genotype_matrix.hpp"
11 #include "jade.likelihood_genotype_matrix.hpp"
19 template <
typename TValue>
49 const std::string & path)
51 const auto period = path.find_last_of(
'.');
52 if (period == std::string::npos)
53 throw error() <<
"missing file extension for G matrix '"
56 const auto extension = path.substr(period);
57 if (extension ==
".dgm")
60 if (extension ==
".lgm")
63 throw error() <<
"unsupported file extension for G matrix '"
78 char const *
const path)
80 assert(path !=
nullptr);
81 return create(std::string(path));
86 #endif // JADE_GENOTYPE_MATRIX_FACTORY_HPP__
TValue value_type
The value type.
static genotype_matrix_type * create(const std::string &path)
Creates a genotype matrix based on values from a file. This function determines what kind of genotype...
basic_genotype_matrix< value_type > genotype_matrix_type
The genotype matrix type.
basic_discrete_genotype_matrix< value_type > discrete_genotype_matrix_type
The discrete genotype matrix type.
static genotype_matrix_type * create(char const *const path)
Creates a genotype matrix based on values from a file. This function determines what kind of genotype...
A template class implementing operations for a likelihood genotype matrix type.
A template for an abstract class implementing operations for a genotype matrix.
A template for a class implementing operations for a discrete genotype matrix.
basic_likelihood_genotype_matrix< value_type > likelihood_genotype_matrix_type
The likelihood genotype matrix type.
A template for a class that creates genotype matrices based on files and their file extensions.
A template for a class representing an exception thrown from this namespace.