// BamAlignment.h (c) 2009 Derek Barnett
// Marth Lab, Department of Biology, Boston College
// ---------------------------------------------------------------------------
-// Last modified: 10 October 2011 (DB)
+// Last modified: 4 December 2012 (DB)
// ---------------------------------------------------------------------------
// Provides the BamAlignment data structure
// ***************************************************************************
#ifndef BAMALIGNMENT_H
#define BAMALIGNMENT_H
-#include <api/api_global.h>
-#include <api/BamAux.h>
-#include <api/BamConstants.h>
+#include "api/api_global.h"
+#include "api/BamAux.h"
+#include "api/BamConstants.h"
#include <cstdlib>
#include <cstring>
#include <string>
template<typename T> bool GetTag(const std::string& tag, T& destination) const;
template<typename T> bool GetTag(const std::string& tag, std::vector<T>& destination) const;
+ // retrieves all current tag names
+ std::vector<std::string> GetTagNames(void) const;
+
// retrieves the SAM/BAM type-code for requested tag name
bool GetTagType(const std::string& tag, char& type) const;
+ // retrieves the SAM/BAM type-code for the data elements in an array tag
+ bool GetArrayTagType(const std::string& tag, char& type) const;
+
// returns true if alignment has a record for this tag name
bool HasTag(const std::string& tag) const;
// returns a description of the last error that occurred
std::string GetErrorString(void) const;
+ // retrieves the size, read locations and reference locations of soft-clip operations
+ bool GetSoftClips(std::vector<int>& clipSizes,
+ std::vector<int>& readPositions,
+ std::vector<int>& genomePositions,
+ bool usePadded = false) const;
+
// public data fields
public:
std::string Name; // read name
unsigned int numBytesParsed = 0;
// return failure if tag not found
- if ( FindTag(tag, pTagData, tagDataLength, numBytesParsed) ) {
+ if ( !FindTag(tag, pTagData, tagDataLength, numBytesParsed) ) {
// TODO: set error string?
return false;
}
unsigned int numBytesParsed = 0;
// return failure if tag not found
- if ( FindTag(tag, pTagData, tagDataLength, numBytesParsed) ) {
+ if ( !FindTag(tag, pTagData, tagDataLength, numBytesParsed) ) {
// TODO: set error string?
return false;
}