BamTools
2.5.2
Loading...
Searching...
No Matches
src
api
SamProgram.h
Go to the documentation of this file.
1
// ***************************************************************************
2
// SamProgram.h (c) 2011 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 header program records.
8
// ***************************************************************************
9
10
#ifndef SAM_PROGRAM_H
11
#define SAM_PROGRAM_H
12
13
#include <string>
14
#include "
api/BamAux.h
"
15
#include "
api/api_global.h
"
16
17
namespace
BamTools
{
18
19
class
SamProgramChain;
20
21
struct
API_EXPORT
SamProgram
22
{
23
24
// ctor & dtor
25
SamProgram
();
26
SamProgram
(
const
std::string&
id
);
27
28
// query/modify entire program record
29
void
Clear();
// clears all data fields
30
31
// convenience query methods
32
bool
HasCommandLine()
const
;
// returns true if program record has a command line entry
33
bool
HasID()
const
;
// returns true if program record has an ID
34
bool
HasName()
const
;
// returns true if program record has a name
35
bool
HasPreviousProgramID()
36
const
;
// returns true if program record has a 'previous program ID'
37
bool
HasVersion()
const
;
// returns true if program record has a version
38
39
// data members
40
std::string
CommandLine
;
// CL:<CommandLine>
41
std::string
ID
;
// ID:<ID> *Required for valid SAM header*
42
std::string
Name
;
// PN:<Name>
43
std::string
PreviousProgramID
;
// PP:<PreviousProgramID>
44
std::string
Version
;
// VN:<Version>
45
std::vector<CustomHeaderTag>
CustomTags
;
// optional custom tags
46
47
// internal (non-standard) methods & fields
48
private
:
49
bool
HasNextProgramID()
const
;
50
std::string NextProgramID;
51
friend
class
BamTools::SamProgramChain
;
52
};
53
57
inline
bool
operator==
(
const
SamProgram
& lhs,
const
SamProgram
& rhs)
58
{
59
return
lhs.
ID
== rhs.
ID
;
60
}
61
62
}
// namespace BamTools
63
64
#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::Name
std::string Name
corresponds to @PG PN:<Name>
Definition
SamProgram.h:42
BamTools::SamProgram::CustomTags
std::vector< CustomHeaderTag > CustomTags
Definition
SamProgram.h:45
BamTools::SamProgram::Version
std::string Version
corresponds to @PG VN:<Version>
Definition
SamProgram.h:44
BamTools::SamProgram::PreviousProgramID
std::string PreviousProgramID
corresponds to @PG PP:<PreviousProgramID>
Definition
SamProgram.h:43
BamTools::SamProgram::CommandLine
std::string CommandLine
corresponds to @PG CL:<CommandLine>
Definition
SamProgram.h:40
BamTools::SamProgram::ID
std::string ID
corresponds to @PG ID:<ID>
Definition
SamProgram.h:41
Generated by
1.9.8