libStatGen Software  1
SamTags.h
1 /*
2  * Copyright (C) 2010-2011 Regents of the University of Michigan
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __SAM_TAGS_H__
19 #define __SAM_TAGS_H__
20 
21 #include <stdint.h>
22 #include <stdexcept>
23 #include "SamRecord.h"
24 
25 /// Class for parsing/creating/operating on SAM/BAM record tags.
26 class SamTags
27 {
28 public:
29  ///////////////////////
30  /// @name Constants for parsing tags.
31  //@{
32  static const char* BQ_TAG;
33  static const char BQ_TAG_TYPE;
34  static const char* MD_TAG;
35  static const char MD_TAG_TYPE;
36  static const char* ORIG_POS_TAG;
37  static const char ORIG_POS_TAG_TYPE;
38  static const char* ORIG_CIGAR_TAG;
39  static const char ORIG_CIGAR_TAG_TYPE;
40  static const char* ORIG_QUAL_TAG;
41  static const char ORIG_QUAL_TAG_TYPE;
42  //@}
43 
44  /// Create the MD tag for the specified input record and the genome.
45  /// \return returns true if an MD tag was created, false if one could not
46  /// be created.
47  static bool createMDTag(String& outputMDtag, SamRecord& inputRec, GenomeSequence& genome);
48  /// Check to see if the MD tag in the record is accurate.
49  static bool isMDTagCorrect(SamRecord& inputRec, GenomeSequence& genome);
50  // Update/Add the MD tag in the inputRec.
51  static bool updateMDTag(SamRecord& inputRec, GenomeSequence& genome);
52 
53 private:
54  SamTags();
55 };
56 
57 
58 #endif
Create/Access/Modify/Load Genome Sequences stored as binary mapped files.
Class providing an easy to use interface to get/set/operate on the fields in a SAM/BAM record.
Definition: SamRecord.h:52
Class for parsing/creating/operating on SAM/BAM record tags.
Definition: SamTags.h:27
static bool isMDTagCorrect(SamRecord &inputRec, GenomeSequence &genome)
Check to see if the MD tag in the record is accurate.
Definition: SamTags.cpp:126
static bool createMDTag(String &outputMDtag, SamRecord &inputRec, GenomeSequence &genome)
Create the MD tag for the specified input record and the genome.
Definition: SamTags.cpp:34