BamTools  2.4.0
SamReadGroup.h
Go to the documentation of this file.
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 // ***************************************************************************
9 
10 #ifndef SAM_READGROUP_H
11 #define SAM_READGROUP_H
12 
13 #include "api/api_global.h"
14 #include "api/BamAux.h"
15 #include <string>
16 #include <vector>
17 
18 namespace BamTools {
19 
21 
22  // ctor & dtor
23  SamReadGroup(void);
24  SamReadGroup(const std::string& id);
25  SamReadGroup(const SamReadGroup& other);
26  ~SamReadGroup(void);
27 
28  // query/modify entire read group
29  void Clear(void); // clears all data fields
30 
31  // convenience query methods
32  bool HasDescription(void) const; // returns true if read group has a description
33  bool HasFlowOrder(void) const; // returns true if read group has a flow order entry
34  bool HasID(void) const; // returns true if read group has a group ID
35  bool HasKeySequence(void) const; // returns true if read group has a key sequence
36  bool HasLibrary(void) const; // returns true if read group has a library name
37  bool HasPlatformUnit(void) const; // returns true if read group has a platform unit ID
38  bool HasPredictedInsertSize(void) const; // returns true if read group has a predicted insert size
39  bool HasProductionDate(void) const; // returns true if read group has a production date
40  bool HasProgram(void) const; // returns true if read group has a program entry
41  bool HasSample(void) const; // returns true if read group has a sample name
42  bool HasSequencingCenter(void) const; // returns true if read group has a sequencing center ID
43  bool HasSequencingTechnology(void) const; // returns true if read group has a sequencing technology ID
44 
45 
46  // data fields
47  std::string Description; // DS:<Description>
48  std::string FlowOrder; // FO:<FlowOrder>
49  std::string ID; // ID:<ID> *Required for valid SAM header*
50  std::string KeySequence; // KS:<KeySequence>
51  std::string Library; // LB:<Library>
52  std::string PlatformUnit; // PU:<PlatformUnit>
53  std::string PredictedInsertSize; // PI:<PredictedInsertSize>
54  std::string ProductionDate; // DT:<ProductionDate>
55  std::string Program; // PG:<Program>
56  std::string Sample; // SM:<Sample>
57  std::string SequencingCenter; // CN:<SequencingCenter>
58  std::string SequencingTechnology; // PL:<SequencingTechnology>
59  std::vector<CustomHeaderTag> CustomTags; // optional custom tags
60 };
61 
65 API_EXPORT inline bool operator==(const SamReadGroup& lhs, const SamReadGroup& rhs) {
66  return lhs.ID == rhs.ID;
67 }
68 
69 } // namespace BamTools
70 
71 #endif // SAM_READGROUP_H
std::string Program
corresponds to @RG PG:
Definition: SamReadGroup.h:55
std::string FlowOrder
corresponds to @RG FO:
Definition: SamReadGroup.h:48
API_EXPORT bool operator==(const SamProgram &lhs, const SamProgram &rhs)
tests equality by comparing program IDs
Definition: SamProgram.h:57
std::string SequencingCenter
corresponds to @RG CN:
Definition: SamReadGroup.h:57
std::string ID
corresponds to @RG ID:
Definition: SamReadGroup.h:49
Represents a SAM read group entry.
Definition: SamReadGroup.h:20
std::string PredictedInsertSize
corresponds to @RG PI:
Definition: SamReadGroup.h:53
#define API_EXPORT
Definition: api_global.h:18
std::vector< CustomHeaderTag > CustomTags
Definition: SamReadGroup.h:59
std::string Sample
corresponds to @RG SM:
Definition: SamReadGroup.h:56
std::string SequencingTechnology
corresponds to @RG PL:
Definition: SamReadGroup.h:58
std::string Description
corresponds to @RG DS:
Definition: SamReadGroup.h:47
std::string Library
corresponds to @RG LB:
Definition: SamReadGroup.h:51
std::string KeySequence
corresponds to @RG KS:
Definition: SamReadGroup.h:50
std::string ProductionDate
corresponds to @RG DT:
Definition: SamReadGroup.h:54
Contains all BamTools classes & methods.
Definition: Sort.h:24
std::string PlatformUnit
corresponds to @RG PU:
Definition: SamReadGroup.h:52