24 #ifndef __SEQ_UTILITIES_H__ 25 #define __SEQ_UTILITIES_H__ 29 #include <type_traits> 59 template<
typename Iterator>
60 std::map<typename std::iterator_traits<Iterator>::value_type,
unsigned>
63 typedef typename std::iterator_traits<Iterator>::value_type type;
64 typedef typename std::map<type,unsigned> maptype;
65 typedef typename maptype::iterator mitr;
84 template<
typename Iterator>
87 const char & gapchar =
'-',
88 const unsigned & mod = 3)
91 static_assert( std::is_convertible<
typename std::iterator_traits<Iterator>::value_type,
char>::value,
92 "Iterator's value_type must be convertible to char");
94 if(beg==end)
return false;
95 Iterator itr,effective_end=end-1;
97 while(effective_end > beg)
99 if (*effective_end != gapchar)
108 itr = std::find_if(beg,effective_end,
109 std::bind2nd(std::not_equal_to<char>(),gapchar));
111 unsigned cont_gap = 0;
112 while ( itr < effective_end )
114 if ( *itr == gapchar )
120 if (cont_gap % mod != 0.)
The namespace in which this library resides.
bool internalGapCheck(Iterator beg, Iterator end, const char &gapchar='-', const unsigned &mod=3)
std::map< typename std::iterator_traits< Iterator >::value_type, unsigned > makeCountList(Iterator beg, Iterator end)