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

Function findNewEdges

FilterGraph/FilterGraph.cc:286–322  ·  view source on GitHub ↗

Returns a list of edges that may be added when the vertex v is * removed. */

Source from the content-addressed store, hash-verified

284/** Returns a list of edges that may be added when the vertex v is
285 * removed. */
286static bool
287findNewEdges(
288 const Graph& g,
289 vertex_descriptor v,
290 vector<EdgeInfo>& eds,
291 vector<bool>& markedContigs)
292{
293 typedef graph_traits<Graph> GTraits;
294 typedef GTraits::vertex_descriptor V;
295 typedef GTraits::out_edge_iterator OEit;
296 typedef GTraits::in_edge_iterator IEit;
297
298 IEit iei0, iei1;
299 tie(iei0, iei1) = in_edges(v, g);
300 OEit oei0, oei1;
301 tie(oei0, oei1) = out_edges(v, g);
302
303 vector<V> marked;
304
305 // if not marked and longest link LE contig length.
306 // for every edge from u->v and v->w we must add an edge u->w
307 for (IEit uv = iei0; uv != iei1; ++uv) {
308 for (OEit vw = oei0; vw != oei1; ++vw) {
309 int x = g[*uv].distance + (int)g[v].length + g[*vw].distance;
310 assert(x <= 0);
311 EdgeInfo ed(source(*uv, g), target(*vw, g), x);
312 eds.push_back(ed);
313 if (out_degree(v, g) > 1)
314 marked.push_back(ed.u);
315 if (in_degree(v, g) > 1)
316 marked.push_back(ed.w);
317 }
318 }
319 for (vector<V>::const_iterator it = marked.begin(); it != marked.end(); it++)
320 markedContigs[get(vertex_index, g, *it)] = true;
321 return true;
322}
323
324/** Adds all edges described in the vector eds. */
325static void

Callers 1

removeContigsFunction · 0.85

Calls 8

in_edgesFunction · 0.50
out_edgesFunction · 0.50
out_degreeFunction · 0.50
in_degreeFunction · 0.50
getFunction · 0.50
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected