Loading...
Searching...
No Matches
SamProgram.h
Go to the documentation of this file.
// ***************************************************************************
// SamProgram.h (c) 2011 Derek Barnett
// Marth Lab, Department of Biology, Boston College
// ---------------------------------------------------------------------------
// Last modified: 10 October 2011 (DB)
// ---------------------------------------------------------------------------
// Provides direct read/write access to the SAM header program records.
// ***************************************************************************
#ifndef SAM_PROGRAM_H
#define SAM_PROGRAM_H
#include <string>
#include "api/BamAux.h"
#include "api/api_global.h"
namespace BamTools {
class SamProgramChain;
struct API_EXPORT SamProgram
{
// ctor & dtor
SamProgram();
SamProgram(const std::string& id);
// query/modify entire program record
void Clear(); // clears all data fields
// convenience query methods
bool HasCommandLine() const; // returns true if program record has a command line entry
bool HasID() const; // returns true if program record has an ID
bool HasName() const; // returns true if program record has a name
bool HasPreviousProgramID()
const; // returns true if program record has a 'previous program ID'
bool HasVersion() const; // returns true if program record has a version
// data members
std::string CommandLine; // CL:<CommandLine>
std::string ID; // ID:<ID> *Required for valid SAM header*
std::string Name; // PN:<Name>
std::string PreviousProgramID; // PP:<PreviousProgramID>
std::string Version; // VN:<Version>
std::vector<CustomHeaderTag> CustomTags; // optional custom tags
// internal (non-standard) methods & fields
private:
bool HasNextProgramID() const;
std::string NextProgramID;
friend class BamTools::SamProgramChain;
};
inline bool operator==(const SamProgram& lhs, const SamProgram& rhs)
{
return lhs.ID == rhs.ID;
}
} // namespace BamTools
#endif // SAM_PROGRAM_H
BamAux.h
api_global.h
BamTools::SamProgramChain
Sorted container "chain" of SamProgram records.
Definition SamProgramChain.h:27
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::SamProgram
Represents a SAM program record.
Definition SamProgram.h:22
BamTools::SamProgram::PreviousProgramID
std::string PreviousProgramID
corresponds to @PG PP:<PreviousProgramID>
Definition SamProgram.h:43
BamTools::SamProgram::HasPreviousProgramID
bool HasPreviousProgramID() const
Returns true if program record contains @PG: PP:<PreviousProgramID>.
Definition SamProgram.cpp:105
BamTools::SamProgram::HasVersion
bool HasVersion() const
Returns true if program record contains @PG: VN:<Version>.
Definition SamProgram.cpp:113
BamTools::SamProgram::HasName
bool HasName() const
Returns true if program record contains @PG: PN:<Name>.
Definition SamProgram.cpp:88
BamTools::SamProgram::CustomTags
std::vector< CustomHeaderTag > CustomTags
Definition SamProgram.h:45
BamTools::SamProgram::SamProgram
SamProgram()
default constructor
Definition SamProgram.cpp:45
BamTools::SamProgram::Clear
void Clear()
Clears all data fields.
Definition SamProgram.cpp:59
BamTools::SamProgram::HasID
bool HasID() const
Returns true if program record contains @PG: ID:<ID>.
Definition SamProgram.cpp:80
BamTools::SamProgram::Name
std::string Name
corresponds to @PG PN:<Name>
Definition SamProgram.h:42
BamTools::SamProgram::ID
std::string ID
corresponds to @PG ID:<ID>
Definition SamProgram.h:41
BamTools::SamProgram::CommandLine
std::string CommandLine
corresponds to @PG CL:<CommandLine>
Definition SamProgram.h:40
BamTools::SamProgram::Version
std::string Version
corresponds to @PG VN:<Version>
Definition SamProgram.h:44
BamTools::SamProgram::HasCommandLine
bool HasCommandLine() const
Returns true if program record contains @PG: CL:<CommandLine>.
Definition SamProgram.cpp:72