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