X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fapi%2FBamAlignment.h;h=11233781b9a4995806e5a546bfb082a92a721406;hb=cdf4bbcb19025398d429035fe672661a8c8d1a80;hp=fb54b1a6d38ed1a4c5461551c46afef16747eb79;hpb=9cf50963514decd5c272f52a0a019c6289d43c63;p=bamtools.git diff --git a/src/api/BamAlignment.h b/src/api/BamAlignment.h index fb54b1a..1123378 100644 --- a/src/api/BamAlignment.h +++ b/src/api/BamAlignment.h @@ -3,7 +3,7 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 21 March 2011 (DB) +// Last modified: 19 April 2011 (DB) // --------------------------------------------------------------------------- // Provides the BamAlignment data structure // *************************************************************************** @@ -84,19 +84,42 @@ struct API_EXPORT BamAlignment { bool AddTag(const std::string& tag, const std::string& type, const uint32_t& value); bool AddTag(const std::string& tag, const std::string& type, const int32_t& value); bool AddTag(const std::string& tag, const std::string& type, const float& value); - + + // adds a "binary array" tag + bool AddTag(const std::string& tag, const std::vector& values); + bool AddTag(const std::string& tag, const std::vector& values); + bool AddTag(const std::string& tag, const std::vector& values); + bool AddTag(const std::string& tag, const std::vector& values); + bool AddTag(const std::string& tag, const std::vector& values); + bool AddTag(const std::string& tag, const std::vector& values); + bool AddTag(const std::string& tag, const std::vector& values); + // edits a tag bool EditTag(const std::string& tag, const std::string& type, const std::string& value); bool EditTag(const std::string& tag, const std::string& type, const uint32_t& value); bool EditTag(const std::string& tag, const std::string& type, const int32_t& value); bool EditTag(const std::string& tag, const std::string& type, const float& value); + // edits a "binary array" tag + bool EditTag(const std::string& tag, const std::vector& values); + bool EditTag(const std::string& tag, const std::vector& values); + bool EditTag(const std::string& tag, const std::vector& values); + bool EditTag(const std::string& tag, const std::vector& values); + bool EditTag(const std::string& tag, const std::vector& values); + bool EditTag(const std::string& tag, const std::vector& values); + bool EditTag(const std::string& tag, const std::vector& values); + // retrieves data for a tag bool GetTag(const std::string& tag, std::string& destination) const; bool GetTag(const std::string& tag, uint32_t& destination) const; bool GetTag(const std::string& tag, int32_t& destination) const; bool GetTag(const std::string& tag, float& destination) const; + // retrieves data for a "binary array" tag + bool GetTag(const std::string& tag, std::vector& destination) const; + bool GetTag(const std::string& tag, std::vector& destination) const; + bool GetTag(const std::string& tag, std::vector& destination) const; + // retrieves the BAM tag-type character for a tag bool GetTagType(const std::string& tag, char& type) const; @@ -104,6 +127,9 @@ struct API_EXPORT BamAlignment { bool GetEditDistance(uint32_t& editDistance) const; // retrieves value of "NM" tag bool GetReadGroup(std::string& readGroup) const; // retrieves value of "RG" tag + // returns true if alignment has a record for this tag name + bool HasTag(const std::string& tag) const; + // removes a tag bool RemoveTag(const std::string& tag); @@ -127,7 +153,7 @@ struct API_EXPORT BamAlignment { uint16_t Bin; // BAM (standard) index bin number for this alignment uint16_t MapQuality; // mapping quality score uint32_t AlignmentFlag; // alignment bit-flag (use provided methods to query/modify) - std::vector CigarData; // CIGAR operations for this alignment + std::vector CigarData; // CIGAR operations for this alignment int32_t MateRefID; // ID number for reference sequence where alignment's mate was aligned int32_t MatePosition; // position (0-based) where alignment's mate starts int32_t InsertSize; // mate-pair insert size