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

Function assembleContig

Assembly/AssembleAlgorithm.h:14–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12 */
13template <typename Graph>
14size_t assembleContig(
15 Graph* seqCollection, FastaWriter* writer,
16 BranchRecord& branch, unsigned id)
17{
18 assert(!branch.isActive());
19 assert(branch.getState() == BS_NOEXT
20 || branch.getState() == BS_AMBI_SAME
21 || branch.getState() == BS_AMBI_OPP);
22
23 // Assemble the contig.
24 Sequence contig(branch);
25
26 size_t kmerCount = branch.calculateBranchMultiplicity();
27 if (writer != NULL)
28 writer->WriteSequence(contig, id, kmerCount);
29
30 // Remove low-coverage contigs.
31 float coverage = (float)kmerCount / branch.size();
32 if (opt::coverage > 0 && coverage < opt::coverage) {
33 for (BranchRecord::iterator it = branch.begin();
34 it != branch.end(); ++it)
35 seqCollection->remove(it->first);
36 return branch.size();
37 }
38 return 0;
39}
40
41/** Assemble contigs.
42 * @return the number of contigs assembled

Callers 4

assembleContigMethod · 0.85
assembleFunction · 0.85

Calls 8

getStateMethod · 0.80
isActiveMethod · 0.45
WriteSequenceMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected