1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
#ifndef _BLASR_REGION_UTILS_IMPL_HPP
#define _BLASR_REGION_UTILS_IMPL_HPP
//FIXME: move all functions to class SMRTSequence
template <typename T_Sequence>
bool MaskRead(T_Sequence &fastaRead, ZMWGroupEntry &zmwData, RegionTable ®ionTable)
{
if (not regionTable.HasHoleNumber(zmwData.holeNumber)) {
return false;
} else {
RegionAnnotations regions = regionTable[zmwData.holeNumber];
// Mask off the low quality portion of this read.
DNALength readPos;
for (readPos = 0; readPos < std::min(regions.HQStart(), fastaRead.length); readPos++) {
fastaRead.seq[readPos] = 'N';
}
for (readPos = regions.HQEnd(); readPos < fastaRead.length; readPos++) {
fastaRead.seq[readPos] = 'N';
}
return regions.HasHQRegion();
}
}
/// \params[in] - fastaRead, zmwData, regionTable
/// \params[out] - readStart
/// \params[out] - readEnd
/// \params[out] - score
/// \returns Whether or not read coordinate trimmed according to HQRegion
template <typename T_Sequence>
bool GetReadTrimCoordinates(T_Sequence &fastaRead, ZMWGroupEntry &zmwData, RegionTable ®ionTable,
DNALength &readStart, DNALength &readEnd, int &score)
{
if (regionTable.HasHoleNumber(zmwData.holeNumber)) {
RegionAnnotations regions = regionTable[zmwData.holeNumber];
if (regions.HasHQRegion()) {
readStart = regions.HQStart();
readEnd = regions.HQEnd();
score = regions.HQScore();
return true;
}
}
readStart = 0;
readEnd = fastaRead.length;
score = 0;
return false;
}
#endif
|