libsequence  1.9.5

Calculate shortest path between 2 codons. More...

#include <Sequence/shortestPath.hpp>

Public Types

enum  pathType : std::int8_t {
  S, N, SS, SN,
  NN, SSS, SSN, SNN,
  NNN, NONE, AMBIG
}
 
typedef std::vector< std::string >::const_iterator const_iterator
 

Public Member Functions

 shortestPath (const std::string &codon1, const std::string &codon2, const Sequence::GeneticCodes &code=GeneticCodes::UNIVERSAL)
 
pathType type () const
 
double path_distance () const
 
const_iterator begin () const
 
const_iterator end () const
 

Detailed Description

Calculate shortest path between 2 codons.

A class which calculates the shortest path between two codons. The length of a path is in terms of the sum of the Grantham's distances along it's branches.

Note
It is often the case (esp. when codons differ at all three sites) that the various paths are of equal length. What this means is that the order in which the changes occur don't matter. In such cases, one of the paths is returned arbitrarily.

Definition at line 55 of file shortestPath.hpp.

Member Enumeration Documentation

◆ pathType

enum Sequence::shortestPath::pathType : std::int8_t
strong

An enum type to describe the shortest path between 2 codons. An S refers to a synonymous change, N nonsynonymous. For example, SSN means that the shortest path b/w 2 codons requires 2 synonymous and 1 nonsynonymous change. If the 2 codons don't differ, the value is NONE. If the path cannot be determined, the value is AMBIG

Definition at line 69 of file shortestPath.hpp.

Constructor & Destructor Documentation

◆ shortestPath()

Sequence::shortestPath::shortestPath ( const std::string &  codon1,
const std::string &  codon2,
const Sequence::GeneticCodes code = GeneticCodes::UNIVERSAL 
)
explicit
Parameters
codon1a std::string of length 3
codon2a std::string of length 3
codewhich genetic code to use
Precondition
(codon1.length() == 3 && codon2.length() ==3)
Note
If either codon1 or codon2 contain characters other than {A,G,C,T}, the pathway type will be assigned shortestPath::AMBIG

Definition at line 249 of file shortestPath.cc.

Member Function Documentation

◆ begin()

shortestPath::const_iterator Sequence::shortestPath::begin ( ) const
Returns
an iterator to the beginning of the shortest path between the 2 codons. The value type if the iterator is std::string

Definition at line 294 of file shortestPath.cc.

◆ end()

shortestPath::const_iterator Sequence::shortestPath::end ( ) const
Returns
an iterator to the end of the shortest path between the 2 codons. The value type if the iterator is std::string

Definition at line 304 of file shortestPath.cc.

◆ path_distance()

double Sequence::shortestPath::path_distance ( ) const
Returns
the total Grantham's distance of the shortest path

Definition at line 314 of file shortestPath.cc.

◆ type()

shortestPath::pathType Sequence::shortestPath::type ( ) const
Returns
a value from the enum type shortestPath::pathType representing the type of the shortest path.

Definition at line 285 of file shortestPath.cc.


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