| 7 | * collection. */ |
| 8 | template <typename Graph> |
| 9 | size_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 |
no test coverage detected