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

Function buildOverlapGraph

AdjList/AdjList.cpp:242–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240/** Build contig overlap graph. */
241template <class KmerType>
242static 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
272template <class KmerType>
273void loadDataStructures(Graph& g, vector<KmerType>& prefixes,

Callers 2

buildPairedOverlapGraphFunction · 0.85
mainFunction · 0.85

Calls 9

loadDataStructuresFunction · 0.85
addOverlapsSAFunction · 0.85
senseMethod · 0.80
getFunction · 0.50
add_edgeFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
swapMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected