A library for working with phylogenetic and population genetic data.
v0.32.0
BaseFstPoolCalculator Class Referenceabstract

#include <genesis/population/function/fst_pool_calculator.hpp>

Inherited by FstPoolCalculatorKarlsson, FstPoolCalculatorKofler, and FstPoolCalculatorUnbiased.

Detailed Description

Base class to compute FST between two pooled samples, given two instances of SampleCounts.

The class is to be derived from for the actual computation, such as in FstPoolCalculatorKarlsson, FstPoolCalculatorKofler, or FstPoolCalculatorUnbiased, with three virtual methods to override. Then, an instance of such a calculator can be provided to FstPoolProcessor, which processes Variants along a genome, computing FST along the way.

The idea of using classes here instead of simple iterators over Variants, such as VariantInputStream, is that we want to be able to compute FST for many pairs of samples in some input. With input iterators that just read the input files once however, we cannot iterate multiple times over the same input. Hence we would have to keep all Variants in memory to be able to compute FST for multiple pairs - which is not desirable when, e.g., computing FST for the whole genome at once... So instead, we use these classes, which accumulate all needed data along the way, and yield the FST value at the very end when calling get_result().

Definition at line 65 of file fst_pool_calculator.hpp.

Public Member Functions

 BaseFstPoolCalculator ()=default
 
 BaseFstPoolCalculator (BaseFstPoolCalculator &&)=default
 
 BaseFstPoolCalculator (BaseFstPoolCalculator const &)=default
 
virtual ~BaseFstPoolCalculator ()=default
 
SampleCountsFilterStats get_filter_stats () const
 Get the sum of filter statistics of all sample pairs processed here. More...
 
double get_result () const
 
BaseFstPoolCalculatoroperator= (BaseFstPoolCalculator &&)=default
 
BaseFstPoolCalculatoroperator= (BaseFstPoolCalculator const &)=default
 
void process (SampleCounts const &p1, SampleCounts const &p2)
 
void reset ()
 

Protected Member Functions

virtual double get_result_ () const =0
 
virtual void process_ (SampleCounts const &p1, SampleCounts const &p2)=0
 
virtual void reset_ ()=0
 

Constructor & Destructor Documentation

◆ BaseFstPoolCalculator() [1/3]

BaseFstPoolCalculator ( )
default

◆ ~BaseFstPoolCalculator()

virtual ~BaseFstPoolCalculator ( )
virtualdefault

◆ BaseFstPoolCalculator() [2/3]

◆ BaseFstPoolCalculator() [3/3]

Member Function Documentation

◆ get_filter_stats()

SampleCountsFilterStats get_filter_stats ( ) const
inline

Get the sum of filter statistics of all sample pairs processed here.

With each call to process(), the filter stats are increased according to the filter status of both provided samples. Hence, the counts returned here always have an even sum.

Definition at line 129 of file fst_pool_calculator.hpp.

◆ get_result()

double get_result ( ) const
inline

Definition at line 118 of file fst_pool_calculator.hpp.

◆ get_result_()

virtual double get_result_ ( ) const
protectedpure virtual

◆ operator=() [1/2]

BaseFstPoolCalculator& operator= ( BaseFstPoolCalculator &&  )
default

◆ operator=() [2/2]

BaseFstPoolCalculator& operator= ( BaseFstPoolCalculator const &  )
default

◆ process()

void process ( SampleCounts const &  p1,
SampleCounts const &  p2 
)
inline

Definition at line 92 of file fst_pool_calculator.hpp.

◆ process_()

virtual void process_ ( SampleCounts const &  p1,
SampleCounts const &  p2 
)
protectedpure virtual

◆ reset()

void reset ( )
inline

Definition at line 86 of file fst_pool_calculator.hpp.

◆ reset_()

virtual void reset_ ( )
protectedpure virtual

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