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

Function collapseJoinedBranches

Assembly/BubbleAlgorithm.h:245–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243/** Collapse a bubble to a single path. */
244template <typename Graph>
245void collapseJoinedBranches(Graph* collection,
246 BranchGroup& group)
247{
248 typedef typename graph_traits<Graph>::vertex_descriptor V;
249 typedef typename vertex_bundle_type<Graph>::type VP;
250 typedef typename std::map<V, VP> Map;
251
252 const BranchRecord& best = group[0];
253 logger(5) << "Popping " << best.size() << ' '
254 << best.front().first << '\n';
255
256 // Add the k-mer from the dead branches.
257 Map doomed;
258 for (BranchGroup::const_iterator branchIt = group.begin() + 1;
259 branchIt != group.end(); ++branchIt) {
260 const BranchRecord& branch = *branchIt;
261 for (BranchRecord::const_iterator it = branch.begin();
262 it != branch.end(); ++it)
263 doomed.insert(*it);
264 }
265
266 // Remove the k-mer that are in the good branch.
267 for (BranchRecord::const_iterator it = best.begin();
268 it != best.end(); ++it)
269 doomed.erase(it->first);
270
271 // Remove the dead k-mer from the assembly.
272 for (typename Map::const_iterator it = doomed.begin();
273 it != doomed.end(); ++it)
274 removeSequenceAndExtensions(collection, *it);
275}
276
277} // namespace AssemblyAlgorithms
278

Callers 2

popBubblesFunction · 0.85

Calls 7

eraseMethod · 0.80
sizeMethod · 0.45
frontMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected