A library for working with phylogenetic and population genetic data.
v0.32.0
FilterStatus Class Reference

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

Detailed Description

Tag class to assign a filter status to a Variant or SampleCounts.

This class provides a 32bit uint as a status tag or indicator to keep track of whether a sample or a position passed all filters, or, if not, which filter failed. It is initialized to 0, meant to indicate that the data is good and to be used. Any value other than 0 shall be interpreted to mean that this data does not meet certain criteria (it did not pass a filter), and is hence to be ignored in any downstream computations and analyses. This is used in some of the filters and processing.

The status can be set() once, but has to be reset() afterwards if a different value is needed. This is meant as a protection to accidentally overwrite the filter status when a filter has already been considered to not pass. Hence, when testing and applying a filter, the status needs to be checked before, so that new filters are only applied to data that are yet still passing.

We currently offer the value to be general as far as the data is concerned, meaning that the interpretation of any value other than 0 is left up to the user. However, for the filter functions that offered here, we use the VariantFilterTag and SampleFilterTag enums, and recommend to stick to this as well, unless extra filter types are needed.

Definition at line 65 of file filter_status.hpp.

Public Member Functions

IntType get () const
 
template<typename FilterTag >
bool is (FilterTag value) const
 
bool is (IntType value) const
 
bool passing () const
 
void reset ()
 
template<typename FilterTag >
void reset (FilterTag value)
 
void reset (IntType value)
 
template<typename FilterTag >
void set (FilterTag value)
 
void set (IntType value)
 

Public Types

using IntType = uint32_t
 

Member Function Documentation

◆ get()

IntType get ( ) const
inline

Definition at line 91 of file filter_status.hpp.

◆ is() [1/2]

bool is ( FilterTag  value) const
inline

Definition at line 86 of file filter_status.hpp.

◆ is() [2/2]

bool is ( IntType  value) const
inline

Definition at line 80 of file filter_status.hpp.

◆ passing()

bool passing ( ) const
inline

Definition at line 75 of file filter_status.hpp.

◆ reset() [1/3]

void reset ( )
inline

Definition at line 117 of file filter_status.hpp.

◆ reset() [2/3]

void reset ( FilterTag  value)
inline

Definition at line 128 of file filter_status.hpp.

◆ reset() [3/3]

void reset ( IntType  value)
inline

Definition at line 122 of file filter_status.hpp.

◆ set() [1/2]

void set ( FilterTag  value)
inline

Definition at line 112 of file filter_status.hpp.

◆ set() [2/2]

void set ( IntType  value)
inline

Definition at line 100 of file filter_status.hpp.

Member Typedef Documentation

◆ IntType

using IntType = uint32_t

Definition at line 69 of file filter_status.hpp.


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