Loading...
Searching...
No Matches
SamReadGroup.h
Go to the documentation of this file.
// ***************************************************************************
// SamReadGroup.h (c) 2010 Derek Barnett
// Marth Lab, Department of Biology, Boston College
// ---------------------------------------------------------------------------
// Last modified: 10 October 2011 (DB)
// ---------------------------------------------------------------------------
// Provides direct read/write access to the SAM read group data fields.
// ***************************************************************************
#ifndef SAM_READGROUP_H
#define SAM_READGROUP_H
#include <string>
#include <vector>
#include "api/BamAux.h"
#include "api/api_global.h"
namespace BamTools {
struct API_EXPORT SamReadGroup
{
// ctor & dtor
SamReadGroup();
SamReadGroup(const std::string& id);
// query/modify entire read group
void Clear(); // clears all data fields
// convenience query methods
bool HasDescription() const; // returns true if read group has a description
bool HasFlowOrder() const; // returns true if read group has a flow order entry
bool HasID() const; // returns true if read group has a group ID
bool HasKeySequence() const; // returns true if read group has a key sequence
bool HasLibrary() const; // returns true if read group has a library name
bool HasPlatformUnit() const; // returns true if read group has a platform unit ID
bool HasPredictedInsertSize() const; // returns true if read group has a predicted insert size
bool HasProductionDate() const; // returns true if read group has a production date
bool HasProgram() const; // returns true if read group has a program entry
bool HasSample() const; // returns true if read group has a sample name
bool HasSequencingCenter() const; // returns true if read group has a sequencing center ID
bool HasSequencingTechnology()
const; // returns true if read group has a sequencing technology ID
// 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>
std::vector<CustomHeaderTag> CustomTags; // optional custom tags
};
inline bool operator==(const SamReadGroup& lhs, const SamReadGroup& rhs)
{
return lhs.ID == rhs.ID;
}
} // namespace BamTools
#endif // SAM_READGROUP_H
BamAux.h
api_global.h
BamTools
Contains all BamTools classes & methods.
Definition Sort.h:24
BamTools::operator==
bool operator==(const SamProgram &lhs, const SamProgram &rhs)
tests equality by comparing program IDs
Definition SamProgram.h:57
BamTools::SamReadGroup
Represents a SAM read group entry.
Definition SamReadGroup.h:21
BamTools::SamReadGroup::ID
std::string ID
corresponds to @RG ID:<ID>
Definition SamReadGroup.h:48
BamTools::SamReadGroup::ProductionDate
std::string ProductionDate
corresponds to @RG DT:<ProductionDate>
Definition SamReadGroup.h:53
BamTools::SamReadGroup::HasPlatformUnit
bool HasPlatformUnit() const
Returns true if read group contains @RG PU:<PlatformUnit>.
Definition SamReadGroup.cpp:136
BamTools::SamReadGroup::CustomTags
std::vector< CustomHeaderTag > CustomTags
Definition SamReadGroup.h:58
BamTools::SamReadGroup::Library
std::string Library
corresponds to @RG LB:<Library>
Definition SamReadGroup.h:50
BamTools::SamReadGroup::HasProductionDate
bool HasProductionDate() const
Returns true if read group contains @RG DT:<ProductionDate>.
Definition SamReadGroup.cpp:152
BamTools::SamReadGroup::HasPredictedInsertSize
bool HasPredictedInsertSize() const
Returns true if read group contains @RG PI:<PredictedInsertSize>.
Definition SamReadGroup.cpp:144
BamTools::SamReadGroup::Program
std::string Program
corresponds to @RG PG:<Program>
Definition SamReadGroup.h:54
BamTools::SamReadGroup::HasLibrary
bool HasLibrary() const
Returns true if read group contains @RG LB:<Library>.
Definition SamReadGroup.cpp:128
BamTools::SamReadGroup::FlowOrder
std::string FlowOrder
corresponds to @RG FO:<FlowOrder>
Definition SamReadGroup.h:47
BamTools::SamReadGroup::PlatformUnit
std::string PlatformUnit
corresponds to @RG PU:<PlatformUnit>
Definition SamReadGroup.h:51
BamTools::SamReadGroup::SequencingTechnology
std::string SequencingTechnology
corresponds to @RG PL:<SequencingTechnology>
Definition SamReadGroup.h:57
BamTools::SamReadGroup::SamReadGroup
SamReadGroup()
default constructor
Definition SamReadGroup.cpp:62
BamTools::SamReadGroup::Sample
std::string Sample
corresponds to @RG SM:<Sample>
Definition SamReadGroup.h:55
BamTools::SamReadGroup::HasFlowOrder
bool HasFlowOrder() const
Returns true if read group contains @RG FO:<FlowOrder>.
Definition SamReadGroup.cpp:104
BamTools::SamReadGroup::Description
std::string Description
corresponds to @RG DS:<Description>
Definition SamReadGroup.h:46
BamTools::SamReadGroup::KeySequence
std::string KeySequence
corresponds to @RG KS:<KeySequence>
Definition SamReadGroup.h:49
BamTools::SamReadGroup::HasDescription
bool HasDescription() const
Returns true if read group contains @RG DS:<Description>.
Definition SamReadGroup.cpp:96
BamTools::SamReadGroup::Clear
void Clear()
Clears all data fields.
Definition SamReadGroup.cpp:76
BamTools::SamReadGroup::HasSample
bool HasSample() const
Returns true if read group contains @RG SM:<Sample>.
Definition SamReadGroup.cpp:168
BamTools::SamReadGroup::HasSequencingCenter
bool HasSequencingCenter() const
Returns true if read group contains @RG CN:<SequencingCenter>.
Definition SamReadGroup.cpp:176
BamTools::SamReadGroup::HasKeySequence
bool HasKeySequence() const
Returns true if read group contains @RG KS:<KeySequence>.
Definition SamReadGroup.cpp:120
BamTools::SamReadGroup::SequencingCenter
std::string SequencingCenter
corresponds to @RG CN:<SequencingCenter>
Definition SamReadGroup.h:56
BamTools::SamReadGroup::HasSequencingTechnology
bool HasSequencingTechnology() const
Returns true if read group contains @RG PL:<SequencingTechnology>.
Definition SamReadGroup.cpp:184
BamTools::SamReadGroup::HasID
bool HasID() const
Returns true if read group contains @RG: ID:<ID>.
Definition SamReadGroup.cpp:112
BamTools::SamReadGroup::PredictedInsertSize
std::string PredictedInsertSize
corresponds to @RG PI:<PredictedInsertSize>
Definition SamReadGroup.h:52
BamTools::SamReadGroup::HasProgram
bool HasProgram() const
Returns true if read group contains @RG PG:<Program>.
Definition SamReadGroup.cpp:160