1 // ***************************************************************************
2 // SamSequence.h (c) 2010 Derek Barnett
3 // Marth Lab, Department of Biology, Boston College
4 // All rights reserved.
5 // ---------------------------------------------------------------------------
6 // Last modified: 23 December 2010 (DB)
7 // ---------------------------------------------------------------------------
8 // Provides functionality for querying/manipulating sequence data
9 // **************************************************************************
11 #ifndef SAM_SEQUENCE_H
12 #define SAM_SEQUENCE_H
14 #include <api/api_global.h>
19 class API_EXPORT SamSequence {
23 SamSequence(const std::string& name = "");
24 SamSequence(const SamSequence& other);
33 // convenience methods to check if SamSequence contains these values:
34 bool HasName(void) const;
35 bool HasLength(void) const;
36 bool HasAssemblyID(void) const;
37 bool HasChecksum(void) const;
38 bool HasURI(void) const;
39 bool HasSpecies(void) const;
43 std::string Name; // SN:<Name>
44 std::string Length; // LN:<Length>
45 std::string AssemblyID; // AS:<AssemblyID>
46 std::string Checksum; // M5:<Checksum>
47 std::string URI; // UR:<URI>
48 std::string Species; // SP:<Species>
51 // ---------------------------------------------------
52 // comparison operators
54 // for equality: compare Name, Length, & Checksum (if it exists for both)
55 inline bool operator==(const SamSequence& lhs, const SamSequence& rhs) {
56 if ( lhs.Name != rhs.Name ) return false;
57 if ( lhs.Length != rhs.Length ) return false;
58 if ( lhs.HasChecksum() && rhs.HasChecksum() )
59 return (lhs.Checksum == rhs.Checksum);
63 } // namespace BamTools
65 #endif // SAM_SEQUENCE_H