Gamgee
You miserable little maggot. I'll stove your head in!
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | List of all members
gamgee::ReadBases Class Reference

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) noexcept
 moves a ReadBases object, transferring ownership of the underlying htslib memory More...
 
ReadBasesoperator= (const ReadBases &other)
 creates a deep copy of a ReadBases object More...
 
ReadBasesoperator= (ReadBases &&other) noexcept
 moves a ReadBases object, transferring ownership of the underlying htslib memory More...
 
 ~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...
 
uint32_t size () const
 
std::string to_string () const
 number of base qualities in the container More...
 

Detailed Description

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.

Note
Any functionality lost because of this should be made available by the ReadBases class.

Constructor & Destructor Documentation

gamgee::ReadBases::ReadBases ( const std::shared_ptr< bam1_t > &  sam_record)
explicit

creates a ReadBases object that points to htslib memory already allocated

Parameters
sam_recorda shared pointer to an htslib raw sam record pointer for this object to take shared ownership
Note
the resulting ReadBases object shares ownership of the pre-allocated memory via shared_ptr reference counting
gamgee::ReadBases::ReadBases ( const ReadBases other)

creates a deep copy of a ReadBases object

Note
the copy will have exclusive ownership over the newly-allocated htslib memory
gamgee::ReadBases::ReadBases ( ReadBases &&  other)
noexcept

moves a ReadBases object, transferring ownership of the underlying htslib memory

gamgee::ReadBases::~ReadBases ( )
default

default destruction is sufficient, since our shared_ptr will handle deallocation

Member Function Documentation

ReadBases & gamgee::ReadBases::operator= ( const ReadBases other)

creates a deep copy of a ReadBases object

Note
the copy will have exclusive ownership over the newly-allocated htslib memory

< shared_ptr assignment will take care of deallocating old sam record if necessary

ReadBases & gamgee::ReadBases::operator= ( ReadBases &&  other)
noexcept

moves a ReadBases object, transferring ownership of the underlying htslib memory

< shared_ptr assignment will take care of deallocating old sam record if necessary

Base gamgee::ReadBases::operator[] ( const uint32_t  index) const

use freely as you would an array.

access an individual base by index

Note
currently implemented as read only
Returns
base at the specified index as an enumerated value
uint32_t gamgee::ReadBases::size ( ) const
inline
string gamgee::ReadBases::to_string ( ) const

number of base qualities in the container

returns a string representation of the bases in this read


The documentation for this class was generated from the following files: