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 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 26 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 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.

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

Definition at line 22 of file BaseUtilities.cpp.

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

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


The documentation for this class was generated from the following files:
Generated on Tue Sep 6 17:52:01 2011 for libStatGen Software by  doxygen 1.6.3