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

Function popBubbles

Assembly/BubbleAlgorithm.h:45–138  ·  view source on GitHub ↗

Pop bubbles. */

Source from the content-addressed store, hash-verified

43
44/** Pop bubbles. */
45static inline
46size_t popBubbles(SequenceCollectionHash* seqCollection, std::ostream& out)
47{
48 typedef SequenceCollectionHash Graph;
49 typedef graph_traits<Graph>::vertex_descriptor V;
50 typedef Graph::SymbolSetPair SymbolSetPair;
51
52 Timer timer("PopBubbles");
53 size_t numPopped = 0;
54
55 // Set the cutoffs
56 const unsigned maxNumBranches = 3;
57 const unsigned maxLength = opt::bubbleLen - V::length() + 1;
58
59 for (Graph::iterator iter = seqCollection->begin();
60 iter != seqCollection->end(); ++iter) {
61 if (iter->second.deleted())
62 continue;
63
64 SymbolSetPair extRec = iter->second.extension();
65 for (extDirection dir = SENSE; dir <= ANTISENSE; ++dir) {
66 if (extRec.dir[dir].isAmbiguous()) {
67 // Found a potential bubble, examine each branch
68 bool stop = false;
69
70 // Create the branch group
71 BranchGroup branchGroup(dir, maxNumBranches,
72 iter->first);
73 initiateBranchGroup(branchGroup, iter->first,
74 extRec.dir[dir]);
75
76 // Iterate over the branches
77 while(!stop)
78 {
79 size_t numBranches = branchGroup.size();
80 for (unsigned j = 0; j < numBranches; ++j) {
81 // Get the extensions of this branch
82 SymbolSetPair extRec;
83 int multiplicity = -1;
84
85 const V& lastKmer
86 = branchGroup[j].back().first;
87 bool success = seqCollection->getSeqData(
88 lastKmer, extRec, multiplicity);
89 assert(success);
90 (void)success;
91 processBranchGroupExtension(branchGroup, j,
92 lastKmer, extRec, multiplicity,
93 maxLength);
94 }
95
96 // At this point all branches should have the same
97 // length or one will be a noext.
98 branchGroup.updateStatus(maxLength);
99 BranchGroupStatus status
100 = branchGroup.getStatus();
101 if (status == BGS_TOOLONG
102 || status == BGS_TOOMANYBRANCHES

Callers

nothing calls this directly

Calls 15

initiateBranchGroupFunction · 0.85
writeBubbleFunction · 0.85
collapseJoinedBranchesFunction · 0.85
addToDbFunction · 0.85
deletedMethod · 0.80
extensionMethod · 0.80
getSeqDataMethod · 0.80
updateStatusMethod · 0.80
getStatusMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected