I am iterating over DNA sequences pulling out chunks of 5-15 bases at a time into C++ std::string objects. Occasionally, my string will contain a non ATCG base, and I want to take an action when this happens. For example, I might see:
CTACGGTACGRCTA
Because there is an 'R', I want to recognize this case. I am familiar with regex, but people seem to recommend several different libraries. I've seen Boost, TR1, and others. Can someone please suggest either a different way to catch my cases or tell me which library I should use and why?
Thanks
A regular expression is overkill for this. You can use std::string::find_first_not_of()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With