Gamgee
You miserable little maggot. I'll stove your head in!
|
Utility class to handle the memory management of the sam record object for read bases. More...
#include <read_bases.h>
Public Member Functions | |
ReadBases (const std::shared_ptr< bam1_t > &sam_record) | |
creates a ReadBases object that points to htslib memory already allocated More... | |
ReadBases (const ReadBases &other) | |
creates a deep copy of a ReadBases object More... | |
ReadBases (ReadBases &&other)=default | |
ReadBases & | operator= (const ReadBases &other) |
creates a deep copy of a ReadBases object More... | |
ReadBases & | operator= (ReadBases &&other)=default |
~ReadBases ()=default | |
default destruction is sufficient, since our shared_ptr will handle deallocation More... | |
Base | operator[] (const uint32_t index) const |
use freely as you would an array. More... | |
void | set_base (const uint32_t index, const Base base) |
modify a base at a specific index More... | |
uint32_t | size () const |
bool | operator== (const ReadBases &other) const |
number of base qualities in the container More... | |
bool | operator!= (const ReadBases &other) const |
check for inequality with another ReadBases object More... | |
std::string | to_string () const |
produce a string representation of the bases in this object More... | |
Friends | |
class | SamBuilder |
builder needs access to the internals in order to build efficiently More... | |
Utility class to handle the memory management of the sam record object for read bases.
This class uses Base to represent the bases A,C,G,T,N so we can get byte by byte correspondence with the underlying compressed memory model.
|
explicit |
creates a ReadBases object that points to htslib memory already allocated
sam_record | a shared pointer to an htslib raw sam record pointer for this object to take shared ownership |
gamgee::ReadBases::ReadBases | ( | const ReadBases & | other | ) |
creates a deep copy of a ReadBases object
|
default |
|
default |
default destruction is sufficient, since our shared_ptr will handle deallocation
bool gamgee::ReadBases::operator!= | ( | const ReadBases & | other | ) | const |
creates a deep copy of a ReadBases object
< shared_ptr assignment will take care of deallocating old sam record if necessary
bool gamgee::ReadBases::operator== | ( | const ReadBases & | other | ) | const |
Base gamgee::ReadBases::operator[] | ( | const uint32_t | index | ) | const |
use freely as you would an array.
access an individual base by index
void gamgee::ReadBases::set_base | ( | const uint32_t | index, |
const Base | base | ||
) |
modify a base at a specific index
set an individual base at the given index to the specified value
< zero out previous 4-bit base encoding
< insert new 4-bit base encoding
|
inline |
string gamgee::ReadBases::to_string | ( | ) | const |
produce a string representation of the bases in this object
returns a string representation of the bases in this read
|
friend |
builder needs access to the internals in order to build efficiently