]> git.donarmstrong.com Git - bamtools.git/blob - src/api/SamReadGroup.h
Added SAM header-handling classes for read/write/validate.
[bamtools.git] / src / api / SamReadGroup.h
1 // ***************************************************************************
2 // SamReadGroup.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 read group data
9 // **************************************************************************
10
11 #ifndef SAM_READGROUP_H
12 #define SAM_READGROUP_H
13
14 #include "api/api_global.h"
15 #include <string>
16
17 namespace BamTools {
18
19 class API_EXPORT SamReadGroup {
20
21     // ctor & dtor
22     public:
23         SamReadGroup(void);
24         SamReadGroup(const std::string& id);
25         ~SamReadGroup(void);
26
27     // public methods
28     public:
29
30         // clear all contents
31         void Clear(void);
32
33         // convenience methods to check if SamReadGroup contains these values:
34         bool HasID(void) const;
35         bool HasSample(void) const;
36         bool HasLibrary(void) const;
37         bool HasDescription(void) const;
38         bool HasPlatformUnit(void) const;
39         bool HasPredictedInsertSize(void) const;
40         bool HasSequencingCenter(void) const;
41         bool HasProductionDate(void) const;
42         bool HasSequencingTechnology(void) const;
43
44     // data members
45     public:
46         std::string ID;                   // ID:<ID>
47         std::string Sample;               // SM:<Sample>
48         std::string Library;              // LB:<Library>
49         std::string Description;          // DS:<Description>
50         std::string PlatformUnit;         // PU:<PlatformUnit>
51         std::string PredictedInsertSize;  // PI:<PredictedInsertSize>
52         std::string SequencingCenter;     // CN:<SequencingCenter>
53         std::string ProductionDate;       // DT:<ProductionDate>
54         std::string SequencingTechnology; // PL:<SequencingTechnology>
55 };
56
57 // ---------------------------------------------------
58 // comparison operators
59
60 // for equality: compare IDs
61 inline bool operator==(const SamReadGroup& lhs, const SamReadGroup& rhs) {
62     return lhs.ID == rhs.ID;
63 }
64
65 } // namespace BamTools
66
67 #endif // SAM_READGROUP_H