libsequence  1.9.5
Classes and functions to aid in the calculations of the pathways between two codons

Classes

class  Sequence::shortestPath
 Calculate shortest path between 2 codons. More...
 

Functions

Inter2_t Sequence::Intermediates2 (const std::string &codon1, const std::string &codon2)
 Calculate the intermediate codons between a pair of codons diverged at 2 positions. More...
 
Inter3_t Sequence::Intermediates3 (const std::string &codon1, const std::string &codon2)
 Calculate the intermediate codons between a pair of codons diverged at 3 positions. More...
 
std::pair< unsigned, unsigned > Sequence::mutsShortestPath (const std::string &codon1, const std::string &codon2, const Sequence::GeneticCodes &code=GeneticCodes::UNIVERSAL)
 

Detailed Description

This group of classes and functions deals with determining either the counts of silent and replacement differences between codons or the intermedate codons that occurs between two different codons

Function Documentation

◆ Intermediates2()

Inter2_t Sequence::Intermediates2 ( const std::string &  codon1,
const std::string &  codon2 
)

Calculate the intermediate codons between a pair of codons diverged at 2 positions.

Parameters
intermediatesa string[2] in which we will place the intermediate codons
codon1a codon
codon2a codon

Definition at line 33 of file PathwayHelper.cc.

◆ Intermediates3()

Inter3_t Sequence::Intermediates3 ( const std::string &  codon1,
const std::string &  codon2 
)

Calculate the intermediate codons between a pair of codons diverged at 3 positions.

Parameters
intermediatesa string[9] in which we will place the intermediate codons
codon1a codon
codon2a codon
Note
the storage of the intermediate codons follows the illustration in the documentation of Sequence::ThreeSubs

Definition at line 91 of file PathwayHelper.cc.

◆ mutsShortestPath()

std::pair< unsigned, unsigned > Sequence::mutsShortestPath ( const std::string &  codon1,
const std::string &  codon2,
const Sequence::GeneticCodes code 
)
Returns
a std::pair<unsigned,unsigned> representing the number of silent and replacement changes b/w 2 codons, as calculated by Sequence::shortestPath. The first member of the pair is the number of silent changes in the shortest path, and the second the number of replacement changes. If the pathway type is shortestPath::AMBIG, both members of the return value will be equal to Sequence::SEQMAXUNSIGNED, which is declared in <Sequence/SeqConstants.hpp>

For example:

#include <Sequence/shortestPath.hpp>
#include <iostream>
int main(int argc, char **argv)
{
//the shortest path between AAA and GGG, using the universal code,
//requires 1 silent and 2 replacement changes.
std::pair<unsigned,unsigned> muts = Sequence::mutsShortestPath("AAA","GGG");
std::cout << muts.first
<< ' '
<< muts.second
<< std::endl;
}

Definition at line 322 of file shortestPath.cc.