Commit cde2c1df authored by Mathieu Giraud's avatar Mathieu Giraud

core/tools.{h,cpp}: subsequence, extract with biological positions, starting from 1

parent 0aae0cf8
......@@ -214,6 +214,10 @@ int remove_trailing_whitespaces(string &str) {
return count;
}
string subsequence(const string &seq, int start, int end) {
return seq.substr(start - 1, end - start + 1);
}
string revcomp(const string &dna, bool do_revcomp) {
if (!do_revcomp)
......
......@@ -146,6 +146,11 @@ string extract_basename(string path, bool remove_ext = true);
*/
int remove_trailing_whitespaces(string &str);
/**
* @return subsequence delimited by biological positions (starting from 1), including both positions
*/
string subsequence(const string &text, int start, int end);
/**
* @return reverse(complement(dna)) if do_revcomp, otherwise dna
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment