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

Function mergeContigs

MergePaths/PathConsensus.cpp:378–403  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

376 * is stored in the first argument.
377 */
378static 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
405static Sequence mergePath(const Graph&g, const Path& path)
406{

Callers 1

mergePathFunction · 0.70

Calls 6

chompFunction · 0.85
resizeMethod · 0.80
createConsensusFunction · 0.70
getFunction · 0.70
lengthMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected