]> git.donarmstrong.com Git - bamtools.git/blob - src/api/SamReadGroup.h
Added explicit copy ctors to SamHeader data structures
[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         explicit SamReadGroup(const SamReadGroup& other);
26         ~SamReadGroup(void);
27
28     // public methods
29     public:
30
31         // clear all contents
32         void Clear(void);
33
34         // convenience methods to check if SamReadGroup contains these values:
35         bool HasID(void) const;
36         bool HasSample(void) const;
37         bool HasLibrary(void) const;
38         bool HasDescription(void) const;
39         bool HasPlatformUnit(void) const;
40         bool HasPredictedInsertSize(void) const;
41         bool HasSequencingCenter(void) const;
42         bool HasProductionDate(void) const;
43         bool HasSequencingTechnology(void) const;
44
45     // data members
46     public:
47         std::string ID;                   // ID:<ID>
48         std::string Sample;               // SM:<Sample>
49         std::string Library;              // LB:<Library>
50         std::string Description;          // DS:<Description>
51         std::string PlatformUnit;         // PU:<PlatformUnit>
52         std::string PredictedInsertSize;  // PI:<PredictedInsertSize>
53         std::string SequencingCenter;     // CN:<SequencingCenter>
54         std::string ProductionDate;       // DT:<ProductionDate>
55         std::string SequencingTechnology; // PL:<SequencingTechnology>
56 };
57
58 // ---------------------------------------------------
59 // comparison operators
60
61 // for equality: compare IDs
62 inline bool operator==(const SamReadGroup& lhs, const SamReadGroup& rhs) {
63     return lhs.ID == rhs.ID;
64 }
65
66 } // namespace BamTools
67
68 #endif // SAM_READGROUP_H