00001 /* 00002 * Copyright (C) 2010 Regents of the University of Michigan 00003 * 00004 * This program is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation, either version 3 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #ifndef __BASE_UTILITIES_H__ 00019 #define __BASE_UTILITIES_H__ 00020 00021 #include <stdint.h> 00022 00023 00024 /// This class contains static utilities for performing 00025 /// basic operations on bases. 00026 class BaseUtilities 00027 { 00028 public: 00029 /// Returns whether or not the specified bases is 00030 /// an indicator for ambiguity. 00031 /// \return true if base = 'n' or 'N' or '.' 00032 static bool isAmbiguous(char base); 00033 00034 /// Returns whether or not two bases are equal (case insensitive), 00035 /// if one of the bases is '=', the bases are consided 00036 /// to be equal. 00037 static bool areEqual(char base1, char base2); 00038 00039 /// Get phred base quality from the specified ascii quality. 00040 static uint8_t getPhredBaseQuality(char charQuality); 00041 00042 /// Character used when the quality is unknown. 00043 static const char UNKNOWN_QUALITY_CHAR = ' '; 00044 /// Int value used when the quality is unknown. 00045 static const uint8_t UNKNOWN_QUALITY_INT = 0xFF; 00046 }; 00047 00048 00049 #endif