1 // ***************************************************************************
2 // SamReadGroup.cpp (c) 2010 Derek Barnett
3 // Marth Lab, Department of Biology, Boston College
4 // All rights reserved.
5 // ---------------------------------------------------------------------------
6 // Last modified: 23 December 2010 (DB)
7 // ---------------------------------------------------------------------------
8 // Provides functionality for querying/manipulating read group data
9 // **************************************************************************
11 #include <api/SamReadGroup.h>
12 using namespace BamTools;
16 SamReadGroup::SamReadGroup(void)
22 , PredictedInsertSize("")
23 , SequencingCenter("")
25 , SequencingTechnology("")
28 // ctor with provided ID
29 SamReadGroup::SamReadGroup(const string& id)
35 , PredictedInsertSize("")
36 , SequencingCenter("")
38 , SequencingTechnology("")
42 SamReadGroup::SamReadGroup(const SamReadGroup& other)
44 , Sample(other.Sample)
45 , Library(other.Library)
46 , Description(other.Description)
47 , PlatformUnit(other.PlatformUnit)
48 , PredictedInsertSize(other.PredictedInsertSize)
49 , SequencingCenter(other.SequencingCenter)
50 , ProductionDate(other.ProductionDate)
51 , SequencingTechnology(other.SequencingTechnology)
55 SamReadGroup::~SamReadGroup(void) {
60 void SamReadGroup::Clear(void) {
66 PredictedInsertSize.clear();
67 SequencingCenter.clear();
68 ProductionDate.clear();
69 SequencingTechnology.clear();
72 // convenience methods to check if SamReadGroup contains these values:
73 bool SamReadGroup::HasID(void) const { return (!ID.empty()); }
74 bool SamReadGroup::HasSample(void) const { return (!Sample.empty()); }
75 bool SamReadGroup::HasLibrary(void) const { return (!Library.empty()); }
76 bool SamReadGroup::HasDescription(void) const { return (!Description.empty()); }
77 bool SamReadGroup::HasPlatformUnit(void) const { return (!PlatformUnit.empty()); }
78 bool SamReadGroup::HasPredictedInsertSize(void) const { return (!PredictedInsertSize.empty()); }
79 bool SamReadGroup::HasSequencingCenter(void) const { return (!SequencingCenter.empty()); }
80 bool SamReadGroup::HasProductionDate(void) const { return (!ProductionDate.empty()); }
81 bool SamReadGroup::HasSequencingTechnology(void) const { return (!SequencingTechnology.empty()); }