ʻOhana
Population structure, admixture history, and selection using learning methods.
|
A template for a class that reads an AGI (Admixture Graph Input) file. The file provides the following information: A set of branch length variable names, a set of admixture proportion parameter names, a component size (K), and K*(K-1)/2 number of expressions representing C matrix entries. More...
#include <jade.agi_reader.hpp>
Public Types | |
typedef TValue | value_type |
The value type. More... | |
typedef jade::basic_shunting_yard< value_type > | shunting_yard_type |
The shunting yard algorithm used to parse and evaluate expressions. More... | |
typedef shunting_yard_type::args_type | args_type |
The arguments used to evaluate the shunting yard algorithm. More... | |
Public Member Functions | |
basic_agi_reader (std::istream &in) | |
Initializes a new instance of the class by reading and parsing the specified input stream. More... | |
basic_agi_reader (const std::string &path) | |
Initializes a new instance of the class by reading and parsing the file with the specified path. More... | |
const args_type & | get_args () const |
Returns a table of arguments that maps variables to values. The table reference returned has all values set to zero. The table can be used to evaluate all expression entries. More... | |
const std::vector< std::string > & | get_branch_names () const |
Returns the vector of branch names. More... | |
const std::vector< std::string > & | get_proportion_names () const |
Returns the vector of proportion names. More... | |
std::size_t | get_k () const |
Returns the number of components. More... | |
const std::vector< shunting_yard_type > & | get_entries () const |
Returns the vector of expressions for the C matrix entries. More... | |
A template for a class that reads an AGI (Admixture Graph Input) file. The file provides the following information: A set of branch length variable names, a set of admixture proportion parameter names, a component size (K), and K*(K-1)/2 number of expressions representing C matrix entries.
An example of the file format is as follows:
# Branch length parameters, range: [0, inf) a b c d e f g
# Admixture proportion parameters, range: [0, 1] p
# K value 3
# Matrix entries, total number should be: K*(K-1)/2 # They map to a C matrix, e.g. K=3 maps to: # 0 1 # 1 2 (1 - p) * (b + e + g + f + a) + p * (b + d + a) p * a + (1 - p) * (g + f + a) c + g + f + a
Definition at line 42 of file jade.agi_reader.hpp.
typedef shunting_yard_type::args_type jade::basic_agi_reader< TValue >::args_type |
The arguments used to evaluate the shunting yard algorithm.
Definition at line 58 of file jade.agi_reader.hpp.
typedef jade::basic_shunting_yard<value_type> jade::basic_agi_reader< TValue >::shunting_yard_type |
The shunting yard algorithm used to parse and evaluate expressions.
Definition at line 53 of file jade.agi_reader.hpp.
typedef TValue jade::basic_agi_reader< TValue >::value_type |
The value type.
Definition at line 48 of file jade.agi_reader.hpp.
|
inlineexplicit |
Initializes a new instance of the class by reading and parsing the specified input stream.
in | The input stream. |
Definition at line 65 of file jade.agi_reader.hpp.
|
inlineexplicit |
Initializes a new instance of the class by reading and parsing the file with the specified path.
path | The path to the file to read and parse. |
Definition at line 143 of file jade.agi_reader.hpp.
|
inline |
Returns a table of arguments that maps variables to values. The table reference returned has all values set to zero. The table can be used to evaluate all expression entries.
Definition at line 171 of file jade.agi_reader.hpp.
|
inline |
Returns the vector of branch names.
Definition at line 180 of file jade.agi_reader.hpp.
|
inline |
Returns the vector of expressions for the C matrix entries.
Definition at line 207 of file jade.agi_reader.hpp.
|
inline |
Returns the number of components.
Definition at line 198 of file jade.agi_reader.hpp.
|
inline |
Returns the vector of proportion names.
Definition at line 189 of file jade.agi_reader.hpp.