// ***************************************************************************
// SamReadGroup.h (c) 2010 Derek Barnett
// Marth Lab, Department of Biology, Boston College
-// All rights reserved.
// ---------------------------------------------------------------------------
-// Last modified: 23 December 2010 (DB)
+// Last modified: 10 October 2011 (DB)
// ---------------------------------------------------------------------------
-// Provides functionality for querying/manipulating read group data
-// **************************************************************************
+// Provides direct read/write access to the SAM read group data fields.
+// ***************************************************************************
#ifndef SAM_READGROUP_H
#define SAM_READGROUP_H
namespace BamTools {
-class API_EXPORT SamReadGroup {
+struct API_EXPORT SamReadGroup {
// ctor & dtor
- public:
- SamReadGroup(void);
- SamReadGroup(const std::string& id);
- explicit SamReadGroup(const SamReadGroup& other);
- ~SamReadGroup(void);
+ SamReadGroup(void);
+ SamReadGroup(const std::string& id);
+ SamReadGroup(const SamReadGroup& other);
+ ~SamReadGroup(void);
- // public methods
- public:
+ // query/modify entire read group
+ void Clear(void); // clears all data fields
- // clear all contents
- void Clear(void);
+ // convenience query methods
+ bool HasDescription(void) const; // returns true if read group has a description
+ bool HasFlowOrder(void) const; // returns true if read group has a flow order entry
+ bool HasID(void) const; // returns true if read group has a group ID
+ bool HasKeySequence(void) const; // returns true if read group has a key sequence
+ bool HasLibrary(void) const; // returns true if read group has a library name
+ bool HasPlatformUnit(void) const; // returns true if read group has a platform unit ID
+ bool HasPredictedInsertSize(void) const; // returns true if read group has a predicted insert size
+ bool HasProductionDate(void) const; // returns true if read group has a production date
+ bool HasProgram(void) const; // returns true if read group has a program entry
+ bool HasSample(void) const; // returns true if read group has a sample name
+ bool HasSequencingCenter(void) const; // returns true if read group has a sequencing center ID
+ bool HasSequencingTechnology(void) const; // returns true if read group has a sequencing technology ID
- // convenience methods to check if SamReadGroup contains these values:
- bool HasID(void) const;
- bool HasSample(void) const;
- bool HasLibrary(void) const;
- bool HasDescription(void) const;
- bool HasPlatformUnit(void) const;
- bool HasPredictedInsertSize(void) const;
- bool HasSequencingCenter(void) const;
- bool HasProductionDate(void) const;
- bool HasSequencingTechnology(void) const;
- // data members
- public:
- std::string ID; // ID:<ID>
- std::string Sample; // SM:<Sample>
- std::string Library; // LB:<Library>
- std::string Description; // DS:<Description>
- std::string PlatformUnit; // PU:<PlatformUnit>
- std::string PredictedInsertSize; // PI:<PredictedInsertSize>
- std::string SequencingCenter; // CN:<SequencingCenter>
- std::string ProductionDate; // DT:<ProductionDate>
- std::string SequencingTechnology; // PL:<SequencingTechnology>
+ // data fields
+ std::string Description; // DS:<Description>
+ std::string FlowOrder; // FO:<FlowOrder>
+ std::string ID; // ID:<ID> *Required for valid SAM header*
+ std::string KeySequence; // KS:<KeySequence>
+ std::string Library; // LB:<Library>
+ std::string PlatformUnit; // PU:<PlatformUnit>
+ std::string PredictedInsertSize; // PI:<PredictedInsertSize>
+ std::string ProductionDate; // DT:<ProductionDate>
+ std::string Program; // PG:<Program>
+ std::string Sample; // SM:<Sample>
+ std::string SequencingCenter; // CN:<SequencingCenter>
+ std::string SequencingTechnology; // PL:<SequencingTechnology>
};
-// ---------------------------------------------------
-// comparison operators
-
-// for equality: compare IDs
-inline bool operator==(const SamReadGroup& lhs, const SamReadGroup& rhs) {
+/*! \fn bool operator==(const SamReadGroup& lhs, const SamReadGroup& rhs)
+ \brief tests equality by comparing read group IDs
+*/
+API_EXPORT inline bool operator==(const SamReadGroup& lhs, const SamReadGroup& rhs) {
return lhs.ID == rhs.ID;
}