ProgramInfo

#include <pbbam/ProgramInfo.h>
class PacBio::BAM::ProgramInfo

The ProgramInfo class represents a program entry (@PG) in the SAM header.

Conversion & Validation

static ProgramInfo FromSam(const std::string &sam)

Creates a ProgramInfo object from SAM-formatted text.

Return
program info object
Parameters
  • sam: SAM-formatted text

static std::string ToSam(const ProgramInfo &prog)

Converts a ProgramInfo object to its SAM-formatted text.

Return
SAM-formatted text (no trailing newline)
Parameters

bool IsValid() const

Currently this checks to see that ProgramInfo::Id does not contain an empty string.

Return
true if program info is valid

std::string ToSam() const

Converts this object to its SAM-formatted text.

Return
SAM-formatted text (no trailing newline)

Constructors & Related Methods

ProgramInfo()

Creates an empty program info object.

ProgramInfo(std::string id)

Creates a program info object with an ID.

Parameters
  • id: program ID (@PG:ID)

ProgramInfo(const ProgramInfo &other)
ProgramInfo(ProgramInfo &&other)
ProgramInfo &operator=(const ProgramInfo &other)
ProgramInfo &operator=(ProgramInfo &&other)
~ProgramInfo()

Attributes

std::string CommandLine() const

Return
string value of @PG:CL

std::map<std::string, std::string> CustomTags() const

Result map consists of {tagName => value}.

Return
any non-standard tags added to the @PG entry

std::string Description() const

Return
string value of @PG:DS

std::string Id() const

Return
string value of @PG:ID

std::string Name() const

Return
string value of @PG:PN

std::string PreviousProgramId() const

Return
string value of @PG:PP

std::string Version() const

Return
string value of @PG:VN

ProgramInfo &CommandLine(const std::string &cmd)

Sets the value for @PG:CL.

Return
reference to this object
Parameters
  • cmd: new value

ProgramInfo &CustomTags(const std::map<std::string, std::string> &custom)

Sets a new collection of non-standard tags.

Custom tag map entries should consist of {tagName => value}.

Return
reference to this object
Parameters
  • custom: new tags

ProgramInfo &Description(const std::string &description)

Sets the value for @PG:DS.

Return
reference to this object
Parameters
  • description: new value

ProgramInfo &Id(const std::string &id)

Sets the value for @PG:ID.

Return
reference to this object
Parameters
  • id: new value

ProgramInfo &Name(const std::string &name)

Sets the value for @PG:PN.

Return
reference to this object
Parameters
  • name: new value

ProgramInfo &PreviousProgramId(const std::string &id)

Sets the value for @PG:PP.

Return
reference to this object
Parameters
  • id: new value

ProgramInfo &Version(const std::string &version)

Sets the value for @PG:VN.

Return
reference to this object
Parameters
  • version: new value