Merge the specified two contigs, default overlap is k-1, * generate a consensus sequence of the overlapping region. The result * is stored in the first argument. */
| 376 | * is stored in the first argument. |
| 377 | */ |
| 378 | static void mergeContigs(const Graph& g, |
| 379 | unsigned overlap, Sequence& seq, |
| 380 | const Sequence& s, const ContigNode& node, const Path& path) |
| 381 | { |
| 382 | assert(s.length() >= overlap); |
| 383 | Sequence ao; |
| 384 | Sequence bo(s, 0, overlap); |
| 385 | Sequence o; |
| 386 | do { |
| 387 | assert(seq.length() >= overlap); |
| 388 | ao = seq.substr(seq.length() - overlap); |
| 389 | o = createConsensus(ao, bo); |
| 390 | } while (o.empty() && chomp(seq, 'n')); |
| 391 | if (o.empty()) { |
| 392 | cerr << "warning: the head of " |
| 393 | << get(vertex_name, g, node) |
| 394 | << " does not match the tail of the previous contig\n" |
| 395 | << ao << '\n' << bo << '\n' << path << endl; |
| 396 | seq += 'n'; |
| 397 | seq += s; |
| 398 | } else { |
| 399 | seq.resize(seq.length() - overlap); |
| 400 | seq += o; |
| 401 | seq += Sequence(s, overlap); |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | static Sequence mergePath(const Graph&g, const Path& path) |
| 406 | { |