return (seq_count == 0) ? true : false;
}
+Sequence::size_type Sequence::find_first_not_of(
+ const std::string& query,
+ Sequence::size_type index)
+{
+ typedef std::set<std::string::value_type> sequence_set;
+ sequence_set match_set;
+
+ for(const_iterator query_item = query.begin();
+ query_item != query.end();
+ ++query_item)
+ {
+ match_set.insert(*query_item);
+ }
+ for(const_iterator base = begin();
+ base != end();
+ ++base)
+ {
+ if(match_set.find(*base) == match_set.end()) {
+ return base-begin();
+ }
+ }
+ return Sequence::npos;
+}
+
Sequence::size_type Sequence::start() const
{
if (parent)
const_iterator end() const;
//! is our sequence empty?
bool empty() const;
+ //! find first
+ size_type find_first_not_of(const std::string&, size_type index=0);
//! how many base pairs are there in our sequence
size_type size() const;
//! alias for size (used by string)
BOOST_CHECK_EQUAL(s.get_sequence(), std::string() );
}
+BOOST_AUTO_TEST_CASE( sequence_find_first_not_of )
+{
+ std::string str1("AAAAT");
+ Sequence seq1(str1);
+ BOOST_CHECK_EQUAL(seq1.find_first_not_of("A"), str1.find_first_not_of("A"));
+
+ std::string str2("AATTGGCC");
+ Sequence seq2(str2);
+ BOOST_CHECK_EQUAL(seq2.find_first_not_of("qwer"), str2.find_first_not_of("qwer"));
+}
+
//! when we try to load a missing file, do we get an error?
BOOST_AUTO_TEST_CASE( sequence_load_exception )
{