1 #ifndef gamgee__utils__guard
2 #define gamgee__utils__guard
32 std::string
complement(
const std::string& sequence);
63 inline void check_max_boundary(
const uint32_t index,
const uint32_t size,
const std::string& prefix_msg) {
65 std::stringstream error_message {};
66 error_message << prefix_msg <<
"Index: " << index <<
" must be less than " << size << std::endl;
67 throw std::out_of_range(error_message.str());
95 return ((x == y) || (bcf_float_is_missing(x) && bcf_float_is_missing(y))
96 || (bcf_float_is_vector_end(x) && bcf_float_is_vector_end(y)));
103 template<
class TYPE>
inline
121 return bcf_float_is_vector_end(value);
129 template<
class ITER>
inline
131 if(end_ptr !=
nullptr && current_ptr < end_ptr
141 #endif // gamgee__utils__guard
std::string reverse_complement(const std::string &sequence)
calculates the reverse complement of a sequence
Definition: utils.cpp:46
void check_max_boundary(const uint32_t index, const uint32_t size, const std::string &prefix_msg)
checks that an index is greater than or equal to size
Definition: utils.h:63
bool bcf_is_vector_end_value< int32_t >(const int32_t &value)
Definition: utils.h:112
std::string complement(std::string &sequence)
calculates the complement of a sequence in-place
Definition: utils.cpp:34
std::vector< std::string > hts_string_array_to_vector(const char *const *const string_array, const uint32_t array_size)
converts an array of c-strings into a vector
Definition: utils.cpp:53
#define bcf_int32_vector_end
Definition: vcf.h:752
bool bcf_is_vector_end_value(const TYPE &value)
Definition: utils.h:104
const uint8_t * cache_and_advance_to_end_if_necessary(const uint8_t *current_ptr, const uint8_t *end_ptr, ITER &it)
advances current ptr to end of the vector if the current element is bcf_*_vector_end ...
Definition: utils.h:130
bool bcf_check_equal_element< float >(const float &x, const float &y)
: Check whether two float values from VCF fields are equal
Definition: utils.h:94
bool bcf_check_equal_element(const TYPE &x, const TYPE &y)
Check whether two values from VCF fields of primitive types (for which the == operator is defined) * ...
Definition: utils.h:85
Definition: exceptions.h:9
bool bcf_is_vector_end_value< float >(const float &value)
Definition: utils.h:120