This class contains static utilities for performing basic operations on bases. More...
#include <BaseUtilities.h>
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 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. |
This class contains static utilities for performing basic operations on bases.
Definition at line 26 of file BaseUtilities.h.
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 39 of file BaseUtilities.cpp.
Referenced by SamTags::createMDTag(), SamQuerySeqWithRefIter::getNextMatchMismatch(), SamQuerySeqWithRef::seqWithEquals(), and SamQuerySeqWithRef::seqWithoutEquals().
00040 { 00041 // If they are the same, return true. 00042 if(base1 == base2) 00043 { 00044 return(true); 00045 } 00046 // If one of the bases is '=', return true. 00047 if((base1 == '=') || (base2 == '=')) 00048 { 00049 return(true); 00050 } 00051 00052 // Check both in upercase. 00053 if(toupper(base1) == toupper(base2)) 00054 { 00055 // same in upper case. 00056 return(true); 00057 } 00058 00059 // The bases are different. 00060 return(false); 00061 }
bool BaseUtilities::isAmbiguous | ( | char | base | ) | [static] |
Returns whether or not the specified bases is an indicator for ambiguity.
Definition at line 22 of file BaseUtilities.cpp.
Referenced by SamTags::createMDTag(), SamQuerySeqWithRefIter::getNextMatchMismatch(), and SamQuerySeqWithRef::seqWithEquals().