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

Function generateAdjacency

Assembly/AdjacencyAlgorithm.h:9–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7 * collection. */
8template <typename Graph>
9size_t generateAdjacency(Graph* seqCollection)
10{
11 typedef typename graph_traits<Graph>::vertex_descriptor V;
12 typedef typename Graph::Symbol Symbol;
13 typedef typename Graph::SymbolSet SymbolSet;
14
15 Timer timer("GenerateAdjacency");
16
17 size_t count = 0;
18 size_t numBasesSet = 0;
19 for (typename Graph::iterator iter = seqCollection->begin();
20 iter != seqCollection->end(); ++iter) {
21 if (iter->second.deleted())
22 continue;
23
24 if (++count % 1000000 == 0)
25 logger(1) << "Finding adjacent k-mer: " << count << '\n';
26
27 for (extDirection dir = SENSE; dir <= ANTISENSE; ++dir) {
28 V testSeq(iter->first);
29 Symbol adjBase = testSeq.shift(dir);
30 for (unsigned i = 0; i < SymbolSet::NUM; ++i) {
31 testSeq.setLastBase(dir, Symbol(i));
32 if (seqCollection->setBaseExtension(
33 testSeq, !dir, adjBase))
34 numBasesSet++;
35 }
36 }
37 seqCollection->pumpNetwork();
38 }
39
40 if (numBasesSet > 0) {
41 logger(0) << "Added " << numBasesSet << " edges.\n";
42 if (!opt::db.empty())
43 addToDb("EdgesGenerated", numBasesSet);
44 }
45 return numBasesSet;
46}
47
48} // namespace AssemblyAlgorithms
49

Callers 3

runMethod · 0.85
runControlMethod · 0.85
assembleFunction · 0.85

Calls 9

addToDbFunction · 0.85
deletedMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
shiftMethod · 0.45
setLastBaseMethod · 0.45
setBaseExtensionMethod · 0.45
pumpNetworkMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected