libsequence  1.9.5
Sequence::Kimura80 Class Reference

Kimura's 2-parameter distance. More...

#include <Sequence/Kimura80.hpp>

Public Member Functions

 Kimura80 (const Sequence::Seq *seqa, const Sequence::Seq *seqb)
 
double K () const
 
size_t sites (void) const
 

Detailed Description

Kimura's 2-parameter distance.

Calculate a measure of sequence divergence using Kimura's 1980 method.
The reference is: Kimura, M (1980) J. Mol. Evol 16: 111-120.
The calculation only depends on 3 numbers:
1.) the number of sites in the sequence
2.) the number of transitions between the two sequences
3.) the number of transversions between the two sequences

The implementation of this class does the following:
1.) compare each position in both sequences, counting transitions and transversions
2.) calculate distance using Kimura's formula

Exceptions
Sequence::SeqExceptionif the two sequences are of unequal length.

Definition at line 51 of file Kimura80.hpp.

Constructor & Destructor Documentation

◆ Kimura80()

Sequence::Kimura80::Kimura80 ( const Sequence::Seq seqa,
const Sequence::Seq seqb 
)
explicit
Parameters
seqaan object of type Sequence::Seq
seqban object of type Sequence::Seq
Exceptions
std::runtime_errorif sequences are of different lengths

Definition at line 41 of file Kimura80.cc.

Member Function Documentation

◆ K()

double Sequence::Kimura80::K ( void  ) const
Returns
the distance between the two sequences.
Note
non-signaling nan is returned as a warning value. This can be necessary if sites are saturated, which implies that divergence cannot be calculated

Definition at line 109 of file Kimura80.cc.

◆ sites()

size_t Sequence::Kimura80::sites ( void  ) const
Returns
the number of sites compared, excluding gaps, missing data, etc.

Definition at line 123 of file Kimura80.cc.


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