libStatGen Software 1
|
Class for tracking the reference information mapping between the reference ids and the reference names. More...
#include <SamReferenceInfo.h>
Public Member Functions | |
SamReferenceInfo () | |
Constructor. | |
~SamReferenceInfo () | |
Destructor. | |
void | add (const char *referenceSequenceName, int32_t referenceSequenceLength) |
Add reference sequence name and reference sequence length. | |
int | getReferenceID (const String &referenceName, bool addID=false) |
Get the reference ID for the specified name, if addID is set to true, a reference id will be created for the referenceName if one does not already exist, while if addID is set to false (default), it will return NO_REF_ID if the reference name does not exist. | |
int | getReferenceID (const char *referenceName, bool addID=false) |
Get the reference ID for the specified name, if addID is set to true, a reference id will be created for the referenceName if one does not already exist, while if addID is set to false (default), it will return NO_REF_ID if the reference name does not exist. | |
const String & | getReferenceLabel (int id) const |
Get the reference name for the specified id, if the id is not found, return "*". | |
int32_t | getNumEntries () const |
Get the number of entries contained here. | |
const char * | getReferenceName (int index) const |
Return the reference name at the specified index, returning "" if the index is out of bounds. | |
int32_t | getReferenceLength (int index) const |
Return the reference length at the specified index, returning 0 if the index is out of bounds. | |
void | clear () |
Reset this reference info. | |
SamReferenceInfo & | operator= (const SamReferenceInfo &rhs) |
Copy the reference information. | |
bool | operator== (const SamReferenceInfo &rhs) const |
bool | operator!= (const SamReferenceInfo &rhs) const |
Static Public Attributes | |
static const int | NO_REF_ID = -3 |
Constant for the value returned if a reference id does not exist for a queried reference name. | |
Class for tracking the reference information mapping between the reference ids and the reference names.
Definition at line 27 of file SamReferenceInfo.h.
SamReferenceInfo::SamReferenceInfo | ( | ) |
Constructor.
Definition at line 20 of file SamReferenceInfo.cpp.
References clear().
SamReferenceInfo::~SamReferenceInfo | ( | ) |
void SamReferenceInfo::add | ( | const char * | referenceSequenceName, |
int32_t | referenceSequenceLength | ||
) |
Add reference sequence name and reference sequence length.
Definition at line 35 of file SamReferenceInfo.cpp.
Referenced by SamFileHeader::addSQ(), and SamFileHeader::setSQTag().
void SamReferenceInfo::clear | ( | ) |
Reset this reference info.
Definition at line 123 of file SamReferenceInfo.cpp.
Referenced by SamReferenceInfo(), ~SamReferenceInfo(), SamFileHeader::copy(), operator=(), and SamFileHeader::resetHeader().
int32_t SamReferenceInfo::getNumEntries | ( | ) | const |
Get the number of entries contained here.
Definition at line 93 of file SamReferenceInfo.cpp.
Referenced by getReferenceLength(), getReferenceName(), and SamValidator::isValidRefID().
int SamReferenceInfo::getReferenceID | ( | const char * | referenceName, |
bool | addID = false |
||
) |
Get the reference ID for the specified name, if addID is set to true, a reference id will be created for the referenceName if one does not already exist, while if addID is set to false (default), it will return NO_REF_ID if the reference name does not exist.
Definition at line 71 of file SamReferenceInfo.cpp.
References getReferenceID().
int SamReferenceInfo::getReferenceID | ( | const String & | referenceName, |
bool | addID = false |
||
) |
Get the reference ID for the specified name, if addID is set to true, a reference id will be created for the referenceName if one does not already exist, while if addID is set to false (default), it will return NO_REF_ID if the reference name does not exist.
Definition at line 45 of file SamReferenceInfo.cpp.
References NO_REF_ID.
Referenced by SamFileHeader::getReferenceID(), getReferenceID(), and SamFileHeader::getReferenceID().
const String & SamReferenceInfo::getReferenceLabel | ( | int | id | ) | const |
Get the reference name for the specified id, if the id is not found, return "*".
Definition at line 80 of file SamReferenceInfo.cpp.
Referenced by SamFileHeader::getReferenceLabel().
int32_t SamReferenceInfo::getReferenceLength | ( | int | index | ) | const |
Return the reference length at the specified index, returning 0 if the index is out of bounds.
Definition at line 112 of file SamReferenceInfo.cpp.
References getNumEntries().
const char * SamReferenceInfo::getReferenceName | ( | int | index | ) | const |
Return the reference name at the specified index, returning "" if the index is out of bounds.
Definition at line 100 of file SamReferenceInfo.cpp.
References getNumEntries().
|
inline |
Definition at line 70 of file SamReferenceInfo.h.
SamReferenceInfo & SamReferenceInfo::operator= | ( | const SamReferenceInfo & | rhs | ) |
Copy the reference information.
Definition at line 131 of file SamReferenceInfo.cpp.
References clear().
bool SamReferenceInfo::operator== | ( | const SamReferenceInfo & | rhs | ) | const |
Definition at line 142 of file SamReferenceInfo.cpp.
|
static |
Constant for the value returned if a reference id does not exist for a queried reference name.
Definition at line 77 of file SamReferenceInfo.h.
Referenced by getReferenceID().