A library for working with phylogenetic and population genetic data.
v0.27.0
Window< D, A >::Entry Struct Reference

#include <genesis/population/window/window.hpp>

Detailed Description

template<class D, class A = EmptyAccumulator>
struct genesis::population::Window< D, A >::Entry

Data that is stored per entry that was enqueued in a window.

This is the data that the per-window computation is based on. We store the actual user-provided D/Data type, as well as its position in the genome (as for example given by the POS column in a VCF file), and the index within the current chromosome - that is, the how many'th Entry this data point is in the list of enqueued data (starting from zero for each chromosome).

Definition at line 124 of file window.hpp.

Public Member Functions

 Entry (size_t index, size_t position, Data &&data)
 Contructor that takes data by r-value reference (i.e., moved data); preferred if possible to use, for speed. More...
 
 Entry (size_t index, size_t position, Data const &data)
 Contructor that takes data by reference. More...
 
 operator Data & ()
 Implicit conversion to Data& type. More...
 
 operator Data const & () const
 Implicit conversion to Data const& type. More...
 

Public Attributes

Data data
 Data stored in the Window for this entry. More...
 
size_t index
 Index of the entry, that is, how many other entries have there been in total in the underlying data for the current chromosome. More...
 
size_t position
 Genomic position (1-based) of the entry along a chromosome. More...
 

Constructor & Destructor Documentation

◆ Entry() [1/2]

Entry ( size_t  index,
size_t  position,
Data const &  data 
)
inline

Contructor that takes data by reference.

Definition at line 129 of file window.hpp.

◆ Entry() [2/2]

Entry ( size_t  index,
size_t  position,
Data &&  data 
)
inline

Contructor that takes data by r-value reference (i.e., moved data); preferred if possible to use, for speed.

Definition at line 139 of file window.hpp.

Member Function Documentation

◆ operator Data &()

operator Data & ( )
inline

Implicit conversion to Data& type.

Useful to plug in a Window into some function expecting a range of Data objects.

Definition at line 150 of file window.hpp.

◆ operator Data const &()

operator Data const & ( ) const
inline

Implicit conversion to Data const& type.

Useful to plug in a Window into some function expecting a range of Data objects.

Definition at line 160 of file window.hpp.

Member Data Documentation

◆ data

Data data

Data stored in the Window for this entry.

Definition at line 186 of file window.hpp.

◆ index

size_t index

Index of the entry, that is, how many other entries have there been in total in the underlying data for the current chromosome.

This is useful for example when working with SlidingWindowType::kVariants, to know the how many-th variant in the chromosome the entry is. Gets reset to 0 for each chromosome.

Definition at line 172 of file window.hpp.

◆ position

size_t position

Genomic position (1-based) of the entry along a chromosome.

We here only store the position; for the name of the chromosome, call Window::chromosome(), because for storage and speed reasons, we do not copy and store the chromosome name with every entry.

Definition at line 181 of file window.hpp.


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