MCPcopy Create free account
hub / github.com/BirolLab/abyss / mergePaths

Function mergePaths

MergePaths/MergePaths.cpp:353–387  ·  view source on GitHub ↗

Attempt to merge the paths specified in mergeQ with path. * @return the number of paths merged */

Source from the content-addressed store, hash-verified

351 * @return the number of paths merged
352 */
353static unsigned
354mergePaths(
355 const Lengths& lengths,
356 ContigPath& path,
357 deque<ContigNode>& mergeQ,
358 set<ContigNode>& seen,
359 const ContigPathMap& paths)
360{
361 unsigned merged = 0;
362 deque<ContigNode> invalid;
363 for (ContigNode pivot; !mergeQ.empty(); mergeQ.pop_front()) {
364 pivot = mergeQ.front();
365 ContigPathMap::const_iterator path2It = paths.find(pivot.contigIndex());
366 if (path2It == paths.end())
367 continue;
368
369 ContigPath path2 = path2It->second;
370 if (pivot.sense())
371 reverseComplement(path2.begin(), path2.end());
372 ContigPath consensus = align(lengths, path, path2, pivot);
373 if (consensus.empty()) {
374 invalid.push_back(pivot);
375 continue;
376 }
377
378 appendToMergeQ(mergeQ, seen, path2);
379 path.swap(consensus);
380 if (gDebugPrint)
381#pragma omp critical(cout)
382 cout << get(g_contigNames, pivot) << '\t' << path2 << '\n' << '\t' << path << '\n';
383 merged++;
384 }
385 mergeQ.swap(invalid);
386 return merged;
387}
388
389/** Merge the paths of the specified seed path.
390 * @return the merged contig path

Callers 1

extendPathsFunction · 0.70

Calls 13

appendToMergeQFunction · 0.85
contigIndexMethod · 0.80
senseMethod · 0.80
alignFunction · 0.70
getFunction · 0.70
reverseComplementFunction · 0.50
emptyMethod · 0.45
frontMethod · 0.45
findMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected