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

Function processQuery

Scaffold/longseqdist.cpp:80–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78typedef ContigGraph<DG> Graph;
79
80static void processQuery(vector<Alignment>& recs, Graph& g)
81{
82 typedef graph_traits<Graph>::vertex_descriptor V;
83 typedef graph_traits<Graph>::edge_descriptor E;
84 typedef edge_property<Graph>::type EP;
85 if (recs.size() <= 1)
86 return;
87
88 sort(recs.begin(), recs.end());
89 for (vector<Alignment>::const_iterator itx = recs.begin();
90 itx != recs.end(); itx++) {
91 for (vector<Alignment>::const_iterator ity = itx + 1;
92 ity != recs.end(); ity++) {
93 // if aligned to the same contig, don't draw self edge
94 if (itx->contig == ity->contig)
95 continue;
96
97 // if y is subsumed in x don't draw edge
98 unsigned xqend = itx->read_start_pos + itx->align_length;
99 unsigned yqend = ity->read_start_pos + ity->align_length;
100 if (xqend >= yqend)
101 continue;
102
103 V u = find_vertex(itx->contig, itx->isRC, g);
104 V v = find_vertex(ity->contig, ity->isRC, g);
105 E e;
106 EP ep(opt::minGap, 1, opt::minGap);
107 bool found;
108 tie(e, found) = edge(u, v, g);
109 if (found) {
110 EP& ep = g[e];
111 ep.numPairs++;
112 } else
113 add_edge(u, v, ep, g);
114 }
115 }
116}
117
118static void readAlignments(istream& in, Graph& g)
119{

Callers 1

readAlignmentsFunction · 0.85

Calls 6

find_vertexFunction · 0.50
edgeFunction · 0.50
add_edgeFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected