A library for working with phylogenetic data.
v0.25.0
HeatmapMatrix< T > Class Template Reference

#include <genesis/population/functions/heatmap_matrix.hpp>

Detailed Description

template<typename T>
class genesis::population::HeatmapMatrix< T >

Matrix to capture and accumulate columns of per-position or per-window values along a chromosome.

The class allows to accumulate a vector of values for each position or window along a chromosome. For example, in heatmap visualizations, a vector of values could display a histogram of the frequency spectrum of that position/window. As another example, the entries of the vector at each position/window could correspond to individuals or pools of individuals, and each value denote a property of that individual or pool.

In other words, this class models a 2D matrix of values, where the x-axis (width) goes along a chromosome, and the y-axis (height) can be used to capture/accumulate/store a vector of values for each x position.

Definition at line 62 of file heatmap_matrix.hpp.

Public Member Functions

 HeatmapMatrix (HeatmapMatrix &&)=default
 
 HeatmapMatrix (HeatmapMatrix const &)=default
 
 HeatmapMatrix (size_t height)
 
 ~HeatmapMatrix ()=default
 
std::vector< T > & add_column ()
 Add a column and return it. More...
 
std::string const & chromosome () const
 
HeatmapMatrixchromosome (std::string const &value)
 
size_t end () const
 
HeatmapMatrixend (size_t value)
 
std::vector< T > & get_column (size_t index)
 Return a specific column. More...
 
std::vector< T > const & get_column (size_t index) const
 Return a specific column, const. More...
 
size_t height () const
 
HeatmapMatrixoperator= (HeatmapMatrix &&)=default
 
HeatmapMatrixoperator= (HeatmapMatrix const &)=default
 
size_t start () const
 
HeatmapMatrixstart (size_t value)
 
size_t width () const
 

Constructor & Destructor Documentation

◆ HeatmapMatrix() [1/3]

HeatmapMatrix ( size_t  height)
inline

Definition at line 70 of file heatmap_matrix.hpp.

◆ ~HeatmapMatrix()

~HeatmapMatrix ( )
default

◆ HeatmapMatrix() [2/3]

HeatmapMatrix ( HeatmapMatrix< T > const &  )
default

◆ HeatmapMatrix() [3/3]

HeatmapMatrix ( HeatmapMatrix< T > &&  )
default

Member Function Documentation

◆ add_column()

std::vector<T>& add_column ( )
inline

Add a column and return it.

We here return a non-const reference to the column, so that it's values can be changed as needed. The size of that column (vector) must not be changed though. Unfortunately, there is no second-level const-ness in C++ for this case...

Definition at line 162 of file heatmap_matrix.hpp.

◆ chromosome() [1/2]

std::string const& chromosome ( ) const
inline

Definition at line 86 of file heatmap_matrix.hpp.

◆ chromosome() [2/2]

HeatmapMatrix& chromosome ( std::string const &  value)
inline

Definition at line 139 of file heatmap_matrix.hpp.

◆ end() [1/2]

size_t end ( ) const
inline

Definition at line 96 of file heatmap_matrix.hpp.

◆ end() [2/2]

HeatmapMatrix& end ( size_t  value)
inline

Definition at line 151 of file heatmap_matrix.hpp.

◆ get_column() [1/2]

std::vector<T>& get_column ( size_t  index)
inline

Return a specific column.

We here return a non-const reference to the column, so that it's values can be changed as needed. The size of that column (vector) must not be changed though. Unfortunately, there is no second-level const-ness in C++ for this case...

Definition at line 118 of file heatmap_matrix.hpp.

◆ get_column() [2/2]

std::vector<T> const& get_column ( size_t  index) const
inline

Return a specific column, const.

Definition at line 128 of file heatmap_matrix.hpp.

◆ height()

size_t height ( ) const
inline

Definition at line 101 of file heatmap_matrix.hpp.

◆ operator=() [1/2]

HeatmapMatrix& operator= ( HeatmapMatrix< T > &&  )
default

◆ operator=() [2/2]

HeatmapMatrix& operator= ( HeatmapMatrix< T > const &  )
default

◆ start() [1/2]

size_t start ( ) const
inline

Definition at line 91 of file heatmap_matrix.hpp.

◆ start() [2/2]

HeatmapMatrix& start ( size_t  value)
inline

Definition at line 145 of file heatmap_matrix.hpp.

◆ width()

size_t width ( ) const
inline

Definition at line 106 of file heatmap_matrix.hpp.


The documentation for this class was generated from the following file: