libStatGen Software
1
|
00001 /* 00002 * Copyright (C) 2010-2011 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 __SAM_TAGS_H__ 00019 #define __SAM_TAGS_H__ 00020 00021 #include <stdint.h> 00022 #include <stdexcept> 00023 #include "SamRecord.h" 00024 00025 /// Class for parsing/creating/operating on SAM/BAM record tags. 00026 class SamTags 00027 { 00028 public: 00029 /////////////////////// 00030 /// @name Constants for parsing tags. 00031 //@{ 00032 static const char* BQ_TAG; 00033 static const char BQ_TAG_TYPE; 00034 static const char* MD_TAG; 00035 static const char MD_TAG_TYPE; 00036 static const char* ORIG_POS_TAG; 00037 static const char ORIG_POS_TAG_TYPE; 00038 static const char* ORIG_CIGAR_TAG; 00039 static const char ORIG_CIGAR_TAG_TYPE; 00040 static const char* ORIG_QUAL_TAG; 00041 static const char ORIG_QUAL_TAG_TYPE; 00042 //@} 00043 00044 /// Create the MD tag for the specified input record and the genome. 00045 /// \return returns true if an MD tag was created, false if one could not 00046 /// be created. 00047 static bool createMDTag(String& outputMDtag, SamRecord& inputRec, GenomeSequence& genome); 00048 /// Check to see if the MD tag in the record is accurate. 00049 static bool isMDTagCorrect(SamRecord& inputRec, GenomeSequence& genome); 00050 // Update/Add the MD tag in the inputRec. 00051 static bool updateMDTag(SamRecord& inputRec, GenomeSequence& genome); 00052 00053 private: 00054 SamTags(); 00055 }; 00056 00057 00058 #endif