Merge the specified path. */
| 292 | |
| 293 | /** Merge the specified path. */ |
| 294 | static Contig |
| 295 | mergePath(const Graph& g, const Contigs& contigs, const ContigPath& path) |
| 296 | { |
| 297 | Sequence seq; |
| 298 | unsigned coverage = 0; |
| 299 | for (ContigPath::const_iterator it = path.begin(); it != path.end(); ++it) { |
| 300 | if (!it->ambiguous()) |
| 301 | coverage += g[*it].coverage; |
| 302 | if (seq.empty()) { |
| 303 | seq = sequence(contigs, *it); |
| 304 | } else { |
| 305 | assert(it != path.begin()); |
| 306 | mergeContigs(g, contigs, *(it - 1), *it, seq, path); |
| 307 | } |
| 308 | } |
| 309 | ostringstream ss; |
| 310 | ss << seq.size() << ' ' << coverage << ' '; |
| 311 | pathToComment(ss, g, path); |
| 312 | return Contig(ss.str(), seq); |
| 313 | } |
| 314 | |
| 315 | /** A container of ContigPath. */ |
| 316 | typedef vector<ContigPath> ContigPaths; |