libStatGen Software 1
|
Iterates through the query and compare with reference. More...
#include <SamQuerySeqWithRefHelper.h>
Public Member Functions | |
SamQuerySeqWithRefIter (SamRecord &record, GenomeSequence &refSequence, bool forward=true) | |
bool | reset (bool forward=true) |
Reset to start at the beginning of the record. | |
bool | getNextMatchMismatch (SamSingleBaseMatchInfo &matchMismatchInfo) |
Returns information for the next position where the query and the reference match or mismatch. | |
Iterates through the query and compare with reference.
NOTE: References to the GenomeSequence and SamRecord are stored, the objects are not copied, so they must remain valid as long as this class is used.
Definition at line 58 of file SamQuerySeqWithRefHelper.h.
SamQuerySeqWithRefIter::SamQuerySeqWithRefIter | ( | SamRecord & | record, |
GenomeSequence & | refSequence, | ||
bool | forward = true |
||
) |
Definition at line 24 of file SamQuerySeqWithRefHelper.cpp.
|
virtual |
Definition at line 52 of file SamQuerySeqWithRefHelper.cpp.
bool SamQuerySeqWithRefIter::getNextMatchMismatch | ( | SamSingleBaseMatchInfo & | matchMismatchInfo | ) |
Returns information for the next position where the query and the reference match or mismatch.
To be a match or mismatch, both the query and reference must have a base that is not 'N'. This means: insertions and deletions are not mismatches or matches. 'N' bases are not matches or mismatches
matchMismatchInfo | return parameter with the information about the matching/mismatching base. |
Definition at line 102 of file SamQuerySeqWithRefHelper.cpp.
References BaseUtilities::areEqual(), SamRecord::getFlag(), SamRecord::getReadLength(), Cigar::getRefOffset(), SamRecord::getSequence(), Cigar::INDEX_NA, BaseUtilities::isAmbiguous(), SamRecord::NONE, SamSingleBaseMatchInfo::setQueryIndex(), and SamSingleBaseMatchInfo::setType().
Referenced by SamFilter::clipOnMismatchThreshold(), and SamFilter::sumMismatchQuality().
bool SamQuerySeqWithRefIter::reset | ( | bool | forward = true | ) |
Reset to start at the beginning of the record.
This will re-read values from SamRecord, so can be used if it has changed to contain information for a new record.
forward | true means to start from the beginning and go to the end; false means to start from the end and go to the beginning. |
Definition at line 58 of file SamQuerySeqWithRefHelper.cpp.
References SamRecord::get0BasedPosition(), SamRecord::getCigarInfo(), GenomeSequence::getGenomePosition(), SamRecord::getReadLength(), and SamRecord::getReferenceName().