A library for working with phylogenetic and population genetic data.
v0.32.0
FilterStats< FilterTag > Struct Template Reference

#include <genesis/population/filter/filter_stats.hpp>

Detailed Description

template<typename FilterTag>
struct genesis::population::FilterStats< FilterTag >

Counts of how many entries with a particular Filter Tag occured in some data.

This wrapper around an array is a very simple solution to keep track of the number of entries (Variants or SampleCounts) that had each filter tag in some data. By simply creating a std::array that has as many entries as we have filter tags, we have a slot for every tag. These can then be incremented while streaming through the data, and read and printed later.

This wrapper expects the template parameter to be an enum that has kPassed == 0, and has kEnd as its last value, to determine the end of the enum and indicate the full range of all values. See VariantFilterTag and SampleFilterTag for the two enums we use here.

Definition at line 61 of file filter_stats.hpp.

Public Member Functions

 FilterStats ()
 
FilterTagArray::iterator begin ()
 
FilterTagArray::const_iterator begin () const
 
void clear ()
 
FilterTagArray::iterator end ()
 
FilterTagArray::const_iterator end () const
 
size_t & operator[] (FilterTag tag)
 
size_t operator[] (FilterTag tag) const
 
size_t & operator[] (size_t index)
 
size_t operator[] (size_t index) const
 
size_t size () const
 
size_t sum () const
 
size_t sum_failing () const
 
size_t sum_non_passing () const
 

Public Types

using FilterTagArray = std::array< size_t, static_cast< size_t >(FilterTag::kEnd)>
 

Public Attributes

FilterTagArray data
 

Constructor & Destructor Documentation

◆ FilterStats()

FilterStats ( )
inline

Definition at line 74 of file filter_stats.hpp.

Member Function Documentation

◆ begin() [1/2]

FilterTagArray::iterator begin ( )
inline

Definition at line 116 of file filter_stats.hpp.

◆ begin() [2/2]

FilterTagArray::const_iterator begin ( ) const
inline

Definition at line 121 of file filter_stats.hpp.

◆ clear()

void clear ( )
inline

Definition at line 175 of file filter_stats.hpp.

◆ end() [1/2]

FilterTagArray::iterator end ( )
inline

Definition at line 126 of file filter_stats.hpp.

◆ end() [2/2]

FilterTagArray::const_iterator end ( ) const
inline

Definition at line 131 of file filter_stats.hpp.

◆ operator[]() [1/4]

size_t& operator[] ( FilterTag  tag)
inline

Definition at line 82 of file filter_stats.hpp.

◆ operator[]() [2/4]

size_t operator[] ( FilterTag  tag) const
inline

Definition at line 91 of file filter_stats.hpp.

◆ operator[]() [3/4]

size_t& operator[] ( size_t  index)
inline

Definition at line 100 of file filter_stats.hpp.

◆ operator[]() [4/4]

size_t operator[] ( size_t  index) const
inline

Definition at line 108 of file filter_stats.hpp.

◆ size()

size_t size ( ) const
inline

Definition at line 136 of file filter_stats.hpp.

◆ sum()

size_t sum ( ) const
inline

Definition at line 145 of file filter_stats.hpp.

◆ sum_failing()

size_t sum_failing ( ) const
inline

Definition at line 154 of file filter_stats.hpp.

◆ sum_non_passing()

size_t sum_non_passing ( ) const
inline

Definition at line 170 of file filter_stats.hpp.

Member Typedef Documentation

◆ FilterTagArray

using FilterTagArray = std::array<size_t, static_cast<size_t>( FilterTag::kEnd )>

Definition at line 67 of file filter_stats.hpp.

Member Data Documentation

◆ data

Definition at line 184 of file filter_stats.hpp.


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