Merge a sequence of overlapping paths. */
| 488 | |
| 489 | /** Merge a sequence of overlapping paths. */ |
| 490 | static ContigPath |
| 491 | mergePaths(const Paths& paths, const OverlapMap& overlaps, const ContigPath& merge) |
| 492 | { |
| 493 | assert(!merge.empty()); |
| 494 | ContigNode u = merge.front(); |
| 495 | ContigPath path(getPath(paths, u)); |
| 496 | for (ContigPath::const_iterator it = merge.begin() + 1; it != merge.end(); ++it) { |
| 497 | ContigNode v = *it; |
| 498 | ContigPath vpath(getPath(paths, v)); |
| 499 | unsigned overlap = getOverlap(overlaps, u, v); |
| 500 | assert(path.size() > overlap); |
| 501 | assert(vpath.size() > overlap); |
| 502 | assert(equal(path.end() - overlap, path.end(), vpath.begin())); |
| 503 | path.insert(path.end(), vpath.begin() + overlap, vpath.end()); |
| 504 | u = v; |
| 505 | } |
| 506 | return path; |
| 507 | } |
| 508 | |
| 509 | /** Return true if the edge e is a path overlap. */ |
| 510 | struct IsPathOverlap |
no test coverage detected