1 #ifndef __gamgee__read_bases__
2 #define __gamgee__read_bases__
4 #include "htslib/sam.h"
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);
36 uint32_t
size()
const {
return m_num_bases; };
40 std::shared_ptr<bam1_t> m_sam_record;
44 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
number of base qualities in the container
Definition: read_bases.cpp:88
Base operator[](const uint32_t index) const
use freely as you would an array.
Definition: read_bases.cpp:79
~ReadBases()=default
default destruction is sufficient, since our shared_ptr will handle deallocation
ReadBases(const std::shared_ptr< bam1_t > &sam_record)
creates a ReadBases object that points to htslib memory already allocated
Definition: read_bases.cpp:19
uint32_t size() const
Definition: read_bases.h:36
ReadBases & operator=(const ReadBases &other)
creates a deep copy of a ReadBases object
Definition: read_bases.cpp:52
Utility class to handle the memory management of the sam record object for read bases.
Definition: read_bases.h:26