]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/BamAlignment.h
Regression fixed: error in BamAlignment tag access methods
[bamtools.git] / src / api / BamAlignment.h
index 9a8e7be0a7351a405317d6c0c281ad01c384a3c0..a2349ea9ce9b254066450dc953b99925a8f03b56 100644 (file)
@@ -2,7 +2,7 @@
 // BamAlignment.h (c) 2009 Derek Barnett
 // Marth Lab, Department of Biology, Boston College
 // ---------------------------------------------------------------------------
-// Last modified: 10 October 2011 (DB)
+// Last modified: 16 October 2011 (DB)
 // ---------------------------------------------------------------------------
 // Provides the BamAlignment data structure
 // ***************************************************************************
@@ -100,6 +100,12 @@ struct API_EXPORT BamAlignment {
         // 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
@@ -421,7 +427,7 @@ inline bool BamAlignment::GetTag(const std::string& tag, T& destination) const {
     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;
     }
@@ -502,7 +508,7 @@ inline bool BamAlignment::GetTag<std::string>(const std::string& tag,
     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;
     }