BaseUtilities Class Reference

This class contains static utilities for performing basic operations on bases. More...

#include <BaseUtilities.h>

List of all members.

Static Public Member Functions

static bool isAmbiguous (char base)
 Returns whether or not the specified bases is an indicator for ambiguity.
static bool areEqual (char base1, char base2)
 Returns whether or not two bases are equal (case insensitive), if one of the bases is '=', the bases are consided to be equal.
static uint8_t getPhredBaseQuality (char charQuality)
 Get phred base quality from the specified ascii quality.
static char getAsciiQuality (uint8_t phredQuality)
 Get ascii quality from the specified phred quality.
static void reverseComplement (std::string &sequence)

Static Public Attributes

static const char UNKNOWN_QUALITY_CHAR = ' '
 Character used when the quality is unknown.
static const uint8_t UNKNOWN_QUALITY_INT = 0xFF
 Int value used when the quality is unknown.

Detailed Description

This class contains static utilities for performing basic operations on bases.

Definition at line 27 of file BaseUtilities.h.


Member Function Documentation

bool BaseUtilities::areEqual ( char  base1,
char  base2 
) [static]

Returns whether or not two bases are equal (case insensitive), if one of the bases is '=', the bases are consided to be equal.

Definition at line 40 of file BaseUtilities.cpp.

Referenced by SamTags::createMDTag(), SamQuerySeqWithRefIter::getNextMatchMismatch(), SamQuerySeqWithRef::seqWithEquals(), and SamQuerySeqWithRef::seqWithoutEquals().

00041 {
00042     // If they are the same, return true.
00043     if(base1 == base2)
00044     {
00045         return(true);
00046     }
00047     // If one of the bases is '=', return true.
00048     if((base1 == '=') || (base2 == '='))
00049     {
00050         return(true);
00051     }
00052 
00053     // Check both in upercase.
00054     if(toupper(base1) == toupper(base2))
00055     {
00056         // same in upper case.
00057         return(true);
00058     }
00059 
00060     // The bases are different.
00061     return(false);
00062 }

bool BaseUtilities::isAmbiguous ( char  base  )  [static]

Returns whether or not the specified bases is an indicator for ambiguity.

Returns:
true if base = 'n' or 'N' or '.'

Definition at line 23 of file BaseUtilities.cpp.

Referenced by SamTags::createMDTag(), SamQuerySeqWithRefIter::getNextMatchMismatch(), and SamQuerySeqWithRef::seqWithEquals().

00024 {
00025     switch(base)
00026     {
00027         case 'N':
00028         case 'n':
00029         case '.':
00030             return(true);
00031             break;
00032         default:
00033             break;
00034     };
00035 
00036     // Not 'N', 'n', or '.', so return false.
00037     return(false);
00038 }


The documentation for this class was generated from the following files:
Generated on Mon Feb 11 13:45:21 2013 for libStatGen Software by  doxygen 1.6.3