| 240 | /** Build contig overlap graph. */ |
| 241 | template <class KmerType> |
| 242 | static void buildOverlapGraph(Graph& g, vector<KmerType>& prefixes, |
| 243 | unordered_map<KmerType, vector<ContigNode> >& suffixMap) |
| 244 | { |
| 245 | // Add the overlap edges of exactly k-1 bp. |
| 246 | |
| 247 | typedef graph_traits<Graph>::vertex_descriptor V; |
| 248 | typedef unordered_map<KmerType, vector<ContigNode> > SuffixMap; |
| 249 | typedef typename vector<KmerType>::const_iterator PrefixIterator; |
| 250 | typedef const typename SuffixMap::mapped_type Edges; |
| 251 | typedef typename SuffixMap::mapped_type::const_iterator SuffixIterator; |
| 252 | |
| 253 | if (opt::verbose > 0) |
| 254 | cerr << "Finding overlaps of exactly k-1 bp...\n"; |
| 255 | for (PrefixIterator it = prefixes.begin(); it != prefixes.end(); ++it) { |
| 256 | ContigNode v(it - prefixes.begin()); |
| 257 | Edges& edges = suffixMap[*it]; |
| 258 | for (SuffixIterator itu = edges.begin(); itu != edges.end(); ++itu) { |
| 259 | V uc = get(vertex_complement, g, *itu); |
| 260 | V vc = get(vertex_complement, g, v); |
| 261 | if (opt::ss && uc.sense() != vc.sense()) |
| 262 | continue; |
| 263 | add_edge(vc, uc, -(int)opt::k + 1, static_cast<DG&>(g)); |
| 264 | } |
| 265 | } |
| 266 | SuffixMap().swap(suffixMap); |
| 267 | |
| 268 | if (opt::verbose > 0) |
| 269 | printGraphStats(cerr, g); |
| 270 | } |
| 271 | |
| 272 | template <class KmerType> |
| 273 | void loadDataStructures(Graph& g, vector<KmerType>& prefixes, |
no test coverage detected