1 // ***************************************************************************
2 // SamReadGroup.h (c) 2010 Derek Barnett
3 // Marth Lab, Department of Biology, Boston College
4 // All rights reserved.
5 // ---------------------------------------------------------------------------
6 // Last modified: 4 March 2011 (DB)
7 // ---------------------------------------------------------------------------
8 // Provides direct read/write access to the SAM read group data fields.
9 // ***************************************************************************
11 #ifndef SAM_READGROUP_H
12 #define SAM_READGROUP_H
14 #include "api/api_global.h"
19 struct API_EXPORT SamReadGroup {
23 SamReadGroup(const std::string& id);
24 SamReadGroup(const SamReadGroup& other);
27 // query/modify entire read group
28 void Clear(void); // clears all data fields
30 // convenience query methods
31 bool HasID(void) const; // returns true if read group has a group ID
32 bool HasSample(void) const; // returns true if read group has a sample name
33 bool HasLibrary(void) const; // returns true if read group has a library name
34 bool HasDescription(void) const; // returns true if read group has a description
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 HasSequencingCenter(void) const; // returns true if read group has a sequencing center ID
38 bool HasProductionDate(void) const; // returns true if read group has a production date
39 bool HasSequencingTechnology(void) const; // returns true if read group has a sequencing technology ID
42 std::string ID; // ID:<ID>
43 std::string Sample; // SM:<Sample>
44 std::string Library; // LB:<Library>
45 std::string Description; // DS:<Description>
46 std::string PlatformUnit; // PU:<PlatformUnit>
47 std::string PredictedInsertSize; // PI:<PredictedInsertSize>
48 std::string SequencingCenter; // CN:<SequencingCenter>
49 std::string ProductionDate; // DT:<ProductionDate>
50 std::string SequencingTechnology; // PL:<SequencingTechnology>
53 /*! \fn bool operator==(const SamReadGroup& lhs, const SamReadGroup& rhs)
54 \brief tests equality by comparing read group IDs
56 API_EXPORT inline bool operator==(const SamReadGroup& lhs, const SamReadGroup& rhs) {
57 return lhs.ID == rhs.ID;
60 } // namespace BamTools
62 #endif // SAM_READGROUP_H