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