SamQuerySeqWithRefHelper.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __SAM_QUERY_SEQ_WITH_REF_HELPER_H__
00019 #define __SAM_QUERY_SEQ_WITH_REF_HELPER_H__
00020
00021 #include <stdint.h>
00022
00023 #include "SamRecord.h"
00024 #include "GenomeSequence.h"
00025
00026
00027
00028 class SamSingleBaseMatchInfo
00029 {
00030 public:
00031
00032 enum Type {UNKNOWN, MATCH, MISMATCH};
00033
00034 SamSingleBaseMatchInfo();
00035 ~SamSingleBaseMatchInfo();
00036
00037
00038
00039 Type getType();
00040 int32_t getQueryIndex();
00041
00042
00043 void setType(Type newType);
00044 void setQueryIndex(int32_t queryIndex);
00045
00046 private:
00047 Type myType;
00048 int32_t myQueryIndex;
00049 };
00050
00051
00052
00053
00054 class SamQuerySeqWithRefIter
00055 {
00056 public:
00057 SamQuerySeqWithRefIter(SamRecord& record, GenomeSequence& refSequence,
00058 bool forward = true);
00059 virtual ~SamQuerySeqWithRefIter();
00060
00061
00062
00063
00064
00065
00066 bool reset(bool forward = true);
00067
00068 bool getNextMatchMismatch(SamSingleBaseMatchInfo& matchMismatchInfo);
00069
00070 private:
00071
00072 SamQuerySeqWithRefIter();
00073
00074 void nextIndex();
00075
00076
00077 bool areEqual(char base1, char base2);
00078
00079 SamRecord& myRecord;
00080 GenomeSequence& myRefSequence;
00081 Cigar* myCigar;
00082 uint32_t myStartOfReadOnRefIndex;
00083 int32_t myQueryIndex;
00084 bool myForward;
00085 };
00086
00087 #endif