// Marth Lab, Department of Biology, Boston College
// All rights reserved.
// ---------------------------------------------------------------------------
-// Last modified: 19 November 2010 (DB)
+// Last modified: 13 December 2010 (DB)
// ---------------------------------------------------------------------------
// Provides the BamAlignment data structure
// ***************************************************************************
void BamAlignment::SetIsDuplicate(bool ok) { if (ok) AlignmentFlag |= DUPLICATE; else AlignmentFlag &= ~DUPLICATE; }
void BamAlignment::SetIsFailedQC(bool ok) { if (ok) AlignmentFlag |= QC_FAILED; else AlignmentFlag &= ~QC_FAILED; }
void BamAlignment::SetIsFirstMate(bool ok) { if (ok) AlignmentFlag |= READ_1; else AlignmentFlag &= ~READ_1; }
+void BamAlignment::SetIsMapped(bool ok) { SetIsUnmapped(!ok); }
+void BamAlignment::SetIsMateMapped(bool ok) { SetIsMateUnmapped(!ok); }
void BamAlignment::SetIsMateUnmapped(bool ok) { if (ok) AlignmentFlag |= MATE_UNMAPPED; else AlignmentFlag &= ~MATE_UNMAPPED; }
void BamAlignment::SetIsMateReverseStrand(bool ok) { if (ok) AlignmentFlag |= MATE_REVERSE; else AlignmentFlag &= ~MATE_REVERSE; }
void BamAlignment::SetIsPaired(bool ok) { if (ok) AlignmentFlag |= PAIRED; else AlignmentFlag &= ~PAIRED; }
+void BamAlignment::SetIsPrimaryAlignment(bool ok) { SetIsSecondaryAlignment(!ok); }
void BamAlignment::SetIsProperPair(bool ok) { if (ok) AlignmentFlag |= PROPER_PAIR; else AlignmentFlag &= ~PROPER_PAIR; }
void BamAlignment::SetIsReverseStrand(bool ok) { if (ok) AlignmentFlag |= REVERSE; else AlignmentFlag &= ~REVERSE; }
void BamAlignment::SetIsSecondaryAlignment(bool ok) { if (ok) AlignmentFlag |= SECONDARY; else AlignmentFlag &= ~SECONDARY; }
const char type = *(pTagData - 1);
int destinationLength = 0;
switch (type) {
+
// 1 byte data
case 'A':
case 'c':
return false;
}
-bool BamAlignment::FindTag(const string& tag, char* &pTagData, const unsigned int& tagDataLength, unsigned int& numBytesParsed) {
+bool BamAlignment::FindTag(const string& tag,
+ char* &pTagData,
+ const unsigned int& tagDataLength,
+ unsigned int& numBytesParsed)
+{
while ( numBytesParsed < tagDataLength ) {
// Marth Lab, Department of Biology, Boston College
// All rights reserved.
// ---------------------------------------------------------------------------
-// Last modified: 19 November 2010 (DB)
+// Last modified: 13 December 2010 (DB)
// ---------------------------------------------------------------------------
// Provides the BamAlignment data structure
// ***************************************************************************
public:
void SetIsDuplicate(bool ok); // Sets "PCR duplicate" flag
void SetIsFailedQC(bool ok); // Sets "failed quality control" flag
- void SetIsFirstMate(bool ok); // Sets "alignment is first mate" flag
- void SetIsMateUnmapped(bool ok); // Sets "alignment's mate is mapped" flag
+ void SetIsFirstMate(bool ok); // Sets "alignment is first mate" flag
+ void SetIsMapped(bool ok); // Sets "alignment is mapped" flag
+ void SetIsMateMapped(bool ok); // Sets "alignment's mate is mapped" flag
void SetIsMateReverseStrand(bool ok); // Sets "alignment's mate mapped to reverse strand" flag
- void SetIsPaired(bool ok); // Sets "alignment part of paired-end read" flag
+ void SetIsPaired(bool ok); // Sets "alignment part of paired-end read" flag
+ void SetIsPrimaryAlignment(bool ok); // Sets "position is primary alignment" flag
void SetIsProperPair(bool ok); // Sets "alignment is part of read that satisfied paired-end resolution" flag
void SetIsReverseStrand(bool ok); // Sets "alignment mapped to reverse strand" flag
- void SetIsSecondaryAlignment(bool ok); // Sets "position is primary alignment" flag
- void SetIsSecondMate(bool ok); // Sets "alignment is second mate on read" flag
- void SetIsUnmapped(bool ok); // Sets "alignment is mapped" flag
+ void SetIsSecondMate(bool ok); // Sets "alignment is second mate on read" flag
+
+ // legacy methods (deprecated, but available)
+ void SetIsMateUnmapped(bool ok); // Complement of IsMateMapped() flag
+ void SetIsSecondaryAlignment(bool ok); // Complement of IsPrimaryAlignment() flag
+ void SetIsUnmapped(bool ok); // Complement of IsMapped() flag
// Tag data access methods
public: