template<class D>
class genesis::population::WindowView< D >
Proxy view over window-like regions of a genome.
As opposed to the Window class, this WindowView merely is a proxy for iterating some underlying data, but without copying the entries into the window. It serves as an abstraction for algorithms that need to stream through a file in a window-like manner in a single pass.
It expexts the get_element
function to be set, returning a pointer to the current underlying data entry, or a nullptr
to signal the end of the iteration. The provided function needs to distinguish the inital call (get the first element of the underlying input iterator), from later calls, in which case the underlying iterator needs to be advanced first.
That is, this provided get_element
function is also responsible for advancing the underlying stream. This abstraction allows the class to be used as an iterator pointing to some other data, without using the being() and end() functions of that data (which might not even need to have those). For example, when iteraing individual whole chromosomes as windows (see ChromosomeIterator for this), we want to stop the iteration of each window after a chromosome is done, which might be before the end of the data itself (if there are multiple chromosomes in the input). The get_element
function of this WindowView class allows to define such conditions, and stops the iteration.
Because of its streaming approach, its memory footprint is smaller than that of a Window, and hence allows to iterator whole chromosomes or genomes. On the flipside, its a single pass iterator with no random access to the data in the window.
Definition at line 76 of file window_view.hpp.
|
| WindowView ()=default |
|
| WindowView (Window< Data > &window) |
| Constructor that takes a Window window and creates a view into it. More...
|
|
| WindowView (Window< Data > const &window) |
| Constructor that takes a Window window and creates a view into it. More...
|
|
| WindowView (WindowView &&)=default |
|
| WindowView (WindowView const &)=default |
|
virtual | ~WindowView () override=default |
|
Iterator | begin () const |
|
Iterator | end () const |
|
WindowView & | operator= (WindowView &&)=default |
|
WindowView & | operator= (WindowView const &)=default |
|
| BaseWindow ()=default |
|
| BaseWindow (BaseWindow &&)=default |
|
| BaseWindow (BaseWindow const &)=default |
|
virtual | ~BaseWindow ()=default |
|
std::string const & | chromosome () const |
| Get the chromosome name that this Window belongs to. More...
|
|
void | chromosome (std::string const &value) |
| Set the chromosome name that this Window belongs to. More...
|
|
std::unordered_map< std::string, size_t > & | chromosomes () |
| Get the list of all chromosomes along the genome, with their length. More...
|
|
std::unordered_map< std::string, size_t > const & | chromosomes () const |
| Get the list of all chromosomes along the genome, with their length. More...
|
|
void | clear () |
| Clear all data from the Window. More...
|
|
size_t | first_position () const |
| Get the first position in the chromosome of the Window, that is, where the Window starts. More...
|
|
void | first_position (size_t value) |
| Set the first position in the chromosome of the Window, that is, where the Window starts. More...
|
|
GenomeRegion | genome_region () const |
| Return the genome region that this Windows is defined over. More...
|
|
bool | is_whole_genome () const |
| Return if this instance is intended to be used for a whole genome stream. More...
|
|
void | is_whole_genome (bool value) |
| Set whether this instance is intended to be used for a whole genome stream. More...
|
|
size_t | last_position () const |
| Get the last position in the chromosome of the Window, that is, where the Window ends. More...
|
|
void | last_position (size_t value) |
| Set the last position in the chromosome of the Window, that is, where the Window ends. More...
|
|
BaseWindow & | operator= (BaseWindow &&)=default |
|
BaseWindow & | operator= (BaseWindow const &)=default |
|
size_t | width () const |
| Get the width of the Window. More...
|
|