Stores full and leave-one-out (LOO) dosages for imputed variants.
More...
#include <hidden_markov_model.hpp>
|
void | resize (std::size_t n_rows, std::size_t n_loo_rows, std::size_t n_columns) |
| Resizes the dosage matrices to the specified dimensions.
|
|
void | fill_eov () |
| Fills all dosage matrices with the end-of-vector sentinel value.
|
|
std::array< std::size_t, 2 > | dimensions () const |
| Returns the dimensions of the main dosages matrix.
|
|
std::array< std::size_t, 2 > | dimensions_loo () const |
| Returns the dimensions of the leave-one-out dosages matrix.
|
|
float & | dosage (std::size_t i, std::size_t j) |
| Accesses an element of the main dosages matrix (modifiable).
|
|
const float & | dosage (std::size_t i, std::size_t j) const |
| Accesses an element of the main dosages matrix (const version).
|
|
float & | loo_dosage (std::size_t i, std::size_t j) |
| Accesses an element of the leave-one-out dosages matrix (modifiable).
|
|
const float & | loo_dosage (std::size_t i, std::size_t j) const |
| Accesses an element of the leave-one-out dosages matrix (const version).
|
|
|
std::vector< std::vector< float > > | dosages_ |
| Matrix of imputed dosages.
|
|
std::vector< std::vector< float > > | loo_dosages_ |
| Matrix of leave-one-out (LOO) dosages.
|
|
Stores full and leave-one-out (LOO) dosages for imputed variants.
This class holds the imputed genotype probabilities for all variants and haplotypes in the dataset. It provides storage for both standard dosages and leave-one-out dosages, which are used for model validation and cross-checking accuracy.
◆ dimensions()
std::array< std::size_t, 2 > full_dosages_results::dimensions |
( |
| ) |
const |
|
inline |
Returns the dimensions of the main dosages matrix.
- Returns
- A
std::array
of size 2:
- [0]: number of rows (
dosages_.size()
)
- [1]: number of columns (
dosages_[0].size()
if not empty, 0 otherwise)
◆ dimensions_loo()
std::array< std::size_t, 2 > full_dosages_results::dimensions_loo |
( |
| ) |
const |
|
inline |
Returns the dimensions of the leave-one-out dosages matrix.
- Returns
- A
std::array
of size 2:
- [0]: number of rows (
loo_dosages_.size()
)
- [1]: number of columns (
loo_dosages_[0].size()
if not empty, 0 otherwise)
◆ dosage() [1/2]
float & full_dosages_results::dosage |
( |
std::size_t | i, |
|
|
std::size_t | j ) |
|
inline |
Accesses an element of the main dosages matrix (modifiable).
- Parameters
-
i | Row index. |
j | Column index. |
- Returns
- Reference to the element at position (i, j) in
dosages_
.
◆ dosage() [2/2]
const float & full_dosages_results::dosage |
( |
std::size_t | i, |
|
|
std::size_t | j ) const |
|
inline |
Accesses an element of the main dosages matrix (const version).
- Parameters
-
i | Row index. |
j | Column index. |
- Returns
- Const reference to the element at position (i, j) in
dosages_
.
◆ fill_eov()
void full_dosages_results::fill_eov |
( |
| ) |
|
|
inline |
Fills all dosage matrices with the end-of-vector sentinel value.
This function sets every element in the dosages_
and loo_dosages_
2D vectors to a sentinel value returned by savvy::typed_value::end_of_vector_value<float>()
.
This is useful for reinitializing matrices before recalculation or ensuring that all entries are in a known "empty" state.
After calling this function:
- All elements in
dosages_
are set to the sentinel value.
- All elements in
loo_dosages_
are set to the sentinel value.
◆ loo_dosage() [1/2]
float & full_dosages_results::loo_dosage |
( |
std::size_t | i, |
|
|
std::size_t | j ) |
|
inline |
Accesses an element of the leave-one-out dosages matrix (modifiable).
- Parameters
-
i | Row index. |
j | Column index. |
- Returns
- Reference to the element at position (i, j) in
loo_dosages_
.
◆ loo_dosage() [2/2]
const float & full_dosages_results::loo_dosage |
( |
std::size_t | i, |
|
|
std::size_t | j ) const |
|
inline |
Accesses an element of the leave-one-out dosages matrix (const version).
- Parameters
-
i | Row index. |
j | Column index. |
- Returns
- Const reference to the element at position (i, j) in
loo_dosages_
.
◆ resize()
void full_dosages_results::resize |
( |
std::size_t | n_rows, |
|
|
std::size_t | n_loo_rows, |
|
|
std::size_t | n_columns ) |
|
inline |
Resizes the dosage matrices to the specified dimensions.
This function resizes two internal 2D vectors: dosages_
and loo_dosages_
. Each element is initialized to a sentinel value returned by savvy::typed_value::end_of_vector_value<float>()
.
- Parameters
-
n_rows | Number of rows for the main dosages_ matrix. |
n_loo_rows | Number of rows for the leave-one-out loo_dosages_ matrix. |
n_columns | Number of columns for both matrices. |
After calling this function:
dosages_
will have dimensions n_rows x n_columns
.
loo_dosages_
will have dimensions n_loo_rows x n_columns
.
- All elements in both matrices are initialized to a sentinel value indicating the end of a vector, typically used for safe iteration or checking uninitialized entries.
◆ dosages_
std::vector<std::vector<float> > full_dosages_results::dosages_ |
Matrix of imputed dosages.
Each row corresponds to a variant, and each column corresponds to a target haplotype or sample. Values are floating-point dosages in [0,1].
◆ loo_dosages_
std::vector<std::vector<float> > full_dosages_results::loo_dosages_ |
Matrix of leave-one-out (LOO) dosages.
These dosages are computed excluding the current target haplotype from the reference panel, useful for cross-validation of imputation.
The documentation for this class was generated from the following file: