+ \r
+ // save CIGAR ops \r
+ // need to calculate this here so that BamAlignment::GetEndPosition() performs correctly, \r
+ // even when BamReader::GetNextAlignmentCore() is called \r
+ const unsigned int cigarDataOffset = bAlignment.SupportData.QueryNameLength;\r
+ uint32_t* cigarData = (uint32_t*)(allCharData + cigarDataOffset);\r
+ CigarOp op;\r
+ bAlignment.CigarData.clear();\r
+ bAlignment.CigarData.reserve(bAlignment.SupportData.NumCigarOperations);\r
+ for (unsigned int i = 0; i < bAlignment.SupportData.NumCigarOperations; ++i) {\r
+\r
+ // swap if necessary\r
+ if ( IsBigEndian ) SwapEndian_32(cigarData[i]);\r
+ \r
+ // build CigarOp structure\r
+ op.Length = (cigarData[i] >> BAM_CIGAR_SHIFT);\r
+ op.Type = CIGAR_LOOKUP[ (cigarData[i] & BAM_CIGAR_MASK) ];\r
+\r
+ // save CigarOp\r
+ bAlignment.CigarData.push_back(op);\r
+ }\r