/** Remove ambiguous contigs from the ends of the path. */ static void removeAmbiguousContigs(ContigPath& path) { if (!path.empty() && path.back().ambiguous()) path.erase(path.end() - 1); if (!path.empty() && path.front().ambiguous()) path.erase(path.begin()); }
/** Remove the overlapping portion of the specified contig. */ static void removeContigs(ContigPath& path, unsigned first, unsigned last) { assert(first <= path.size()); assert(last <= path.size()); if (first < last) { recordTrimmedContigs(path.begin(), path.begin() + first); recordTrimmedContigs(path.begin() + last, path.end()); path.erase(path.begin() + last, path.end()); path.erase(path.begin(), path.begin() + first); } else { recordTrimmedContigs(path.begin(), path.end()); path.clear(); } removeAmbiguousContigs(path); }