|
libStatGen Software
1
|
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 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. | |
This class contains static utilities for performing basic operations on bases.
Definition at line 27 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().
{
// If they are the same, return true.
if(base1 == base2)
{
return(true);
}
// If one of the bases is '=', return true.
if((base1 == '=') || (base2 == '='))
{
return(true);
}
// Check both in upercase.
if(toupper(base1) == toupper(base2))
{
// same in upper case.
return(true);
}
// The bases are different.
return(false);
}
| bool BaseUtilities::isAmbiguous | ( | char | base | ) | [static] |
Returns whether or not the specified bases is an indicator for ambiguity.
Definition at line 23 of file BaseUtilities.cpp.
Referenced by SamTags::createMDTag(), SamQuerySeqWithRefIter::getNextMatchMismatch(), and SamQuerySeqWithRef::seqWithEquals().
{
switch(base)
{
case 'N':
case 'n':
case '.':
return(true);
default:
break;
};
// Not 'N', 'n', or '.', so return false.
return(false);
}