Extend the specified path as long as is unambiguously possible and * add the result to the specified container. */
| 452 | * add the result to the specified container. |
| 453 | */ |
| 454 | static void |
| 455 | extendPaths(const Lengths& lengths, ContigID id, const ContigPathMap& paths, ContigPathMap& out) |
| 456 | { |
| 457 | ContigPathMap::const_iterator pathIt = paths.find(id); |
| 458 | assert(pathIt != paths.end()); |
| 459 | |
| 460 | pair<ContigPathMap::iterator, bool> inserted; |
| 461 | #pragma omp critical(out) |
| 462 | inserted = out.insert(*pathIt); |
| 463 | assert(inserted.second); |
| 464 | ContigPath& path = inserted.first->second; |
| 465 | |
| 466 | if (gDebugPrint) |
| 467 | #pragma omp critical(cout) |
| 468 | cout << "\n* " << get(g_contigNames, id) << "+\n" << '\t' << path << '\n'; |
| 469 | |
| 470 | set<ContigNode> seen; |
| 471 | seen.insert(ContigNode(id, false)); |
| 472 | deque<ContigNode> mergeQ; |
| 473 | appendToMergeQ(mergeQ, seen, path); |
| 474 | while (mergePaths(lengths, path, mergeQ, seen, paths) > 0) |
| 475 | ; |
| 476 | |
| 477 | if (!mergeQ.empty() && gDebugPrint) { |
| 478 | #pragma omp critical(cout) |
| 479 | { |
| 480 | cout << "invalid\n"; |
| 481 | for (deque<ContigNode>::const_iterator it = mergeQ.begin(); it != mergeQ.end(); ++it) |
| 482 | cout << get(g_contigNames, *it) << '\t' << paths.find(it->contigIndex())->second |
| 483 | << '\n'; |
| 484 | } |
| 485 | } |
| 486 | } |
| 487 | |
| 488 | /** Return true if the contigs are equal or both are ambiguous. */ |
| 489 | static bool |
no test coverage detected