| 78 | typedef ContigGraph<DG> Graph; |
| 79 | |
| 80 | static 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 | |
| 118 | static void readAlignments(istream& in, Graph& g) |
| 119 | { |
no test coverage detected