1 #ifndef gamgee__read_bases__guard
2 #define gamgee__read_bases__guard
16 enum class Base {
A = 1,
C = 2,
G = 4,
T = 8,
N = 15 };
28 explicit ReadBases(
const std::shared_ptr<bam1_t>& sam_record);
37 uint32_t
size()
const {
return m_num_bases; };
43 std::shared_ptr<bam1_t> m_sam_record;
47 static const std::map<Base, const char*> base_to_string_map;
Base
simple enum to hold all valid bases in the SAM format
Definition: read_bases.h:16
std::string to_string() const
produce a string representation of the bases in this object
Definition: read_bases.cpp:99
Base operator[](const uint32_t index) const
use freely as you would an array.
Definition: read_bases.cpp:57
~ReadBases()=default
default destruction is sufficient, since our shared_ptr will handle deallocation
class to build Sam objects from existing data or from scratch
Definition: sam_builder.h:58
ReadBases(const std::shared_ptr< bam1_t > &sam_record)
creates a ReadBases object that points to htslib memory already allocated
Definition: read_bases.cpp:21
void set_base(const uint32_t index, const Base base)
modify a base at a specific index
Definition: read_bases.cpp:68
uint32_t size() const
Definition: read_bases.h:37
Definition: exceptions.h:9
bool operator==(const ReadBases &other) const
number of base qualities in the container
Definition: read_bases.cpp:77
ReadBases & operator=(const ReadBases &other)
creates a deep copy of a ReadBases object
Definition: read_bases.cpp:43
Utility class to handle the memory management of the sam record object for read bases.
Definition: read_bases.h:26
bool operator!=(const ReadBases &other) const
check for inequality with another ReadBases object
Definition: read_bases.cpp:92