1 // ***************************************************************************
2 // SamReadGroup.h (c) 2010 Derek Barnett
3 // Marth Lab, Department of Biology, Boston College
4 // ---------------------------------------------------------------------------
5 // Last modified: 10 October 2011 (DB)
6 // ---------------------------------------------------------------------------
7 // Provides direct read/write access to the SAM read group data fields.
8 // ***************************************************************************
10 #ifndef SAM_READGROUP_H
11 #define SAM_READGROUP_H
13 #include "api/api_global.h"
18 struct API_EXPORT SamReadGroup {
22 SamReadGroup(const std::string& id);
23 SamReadGroup(const SamReadGroup& other);
26 // query/modify entire read group
27 void Clear(void); // clears all data fields
29 // convenience query methods
30 bool HasDescription(void) const; // returns true if read group has a description
31 bool HasFlowOrder(void) const; // returns true if read group has a flow order entry
32 bool HasID(void) const; // returns true if read group has a group ID
33 bool HasKeySequence(void) const; // returns true if read group has a key sequence
34 bool HasLibrary(void) const; // returns true if read group has a library name
35 bool HasPlatformUnit(void) const; // returns true if read group has a platform unit ID
36 bool HasPredictedInsertSize(void) const; // returns true if read group has a predicted insert size
37 bool HasProductionDate(void) const; // returns true if read group has a production date
38 bool HasProgram(void) const; // returns true if read group has a program entry
39 bool HasSample(void) const; // returns true if read group has a sample name
40 bool HasSequencingCenter(void) const; // returns true if read group has a sequencing center ID
41 bool HasSequencingTechnology(void) const; // returns true if read group has a sequencing technology ID
45 std::string Description; // DS:<Description>
46 std::string FlowOrder; // FO:<FlowOrder>
47 std::string ID; // ID:<ID> *Required for valid SAM header*
48 std::string KeySequence; // KS:<KeySequence>
49 std::string Library; // LB:<Library>
50 std::string PlatformUnit; // PU:<PlatformUnit>
51 std::string PredictedInsertSize; // PI:<PredictedInsertSize>
52 std::string ProductionDate; // DT:<ProductionDate>
53 std::string Program; // PG:<Program>
54 std::string Sample; // SM:<Sample>
55 std::string SequencingCenter; // CN:<SequencingCenter>
56 std::string SequencingTechnology; // PL:<SequencingTechnology>
59 /*! \fn bool operator==(const SamReadGroup& lhs, const SamReadGroup& rhs)
60 \brief tests equality by comparing read group IDs
62 API_EXPORT inline bool operator==(const SamReadGroup& lhs, const SamReadGroup& rhs) {
63 return lhs.ID == rhs.ID;
66 } // namespace BamTools
68 #endif // SAM_READGROUP_H