3 #ifndef CONTIG_JUMP_NETWORK_HPP
4 #define CONTIG_JUMP_NETWORK_HPP
8 struct JumpEdgeProperty{
12 typedef boost::adjacency_list<
24 const ScafVertexPair jumped_edge;
25 const unsigned gap_length;
27 VertexPair<JumpGraph> translated_jumped_edge;
28 std::vector<IloNumVar> edge_index_to_variable;
31 void construct_jump_graph_directional(
const bool forward,
const VTranslateMap<JumpGraph, RawScaffoldGraph>& translate)
34 const ScafMatching& M = sg.get_matching();
35 const RawScaffoldGraph& g = sg.get_graph();
36 const ScafVertex& u = jumped_edge.first;
37 const ScafVertex& v = jumped_edge.second;
39 const ScafVertex& Mu = sg.matched_with(u);
40 const ScafVertex& Mv = sg.matched_with(v);
43 Q.insert((forward ? u : v), 0);
44 ScafVertexSet seen({u, v});
48 const DistQueue::const_iterator x_pair = Q.get_min_element();
49 const ScafVertex x = x_pair->first;
50 const unsigned x_dist = x_pair->second;
51 const ScafVertex& Mx = sg.matched_with(x);
54 for(
auto range = boost::out_edges(x, g); range.first != range.second; ++range.first){
55 const ScafEdge& xy = *range.first;
56 const ScafVertex& y = sg.target(xy);
60 const ScafVertex& My = sg.matched_with(y);
61 const ScafEdge yMy = boost::edge(y, My, g).first;
62 const int xy_length = sg[xy].length;
63 const int yMy_length = sg[yMy].length;
64 const int My_dist = x_dist + xy_length + yMy_length;
66 assert(xy_length + yMy_length > 0);
67 DEBUG5(std::cout <<
"found matching edge "<< I.get_edge_name(yMy)<<
" with length "<<yMy_length<<
" vs gap of "<<gap_length<<std::endl);
68 if(My_dist <= gap_length){
71 construct_contig_jump_expressions(I, x, y, 0, env, uv_map, &In_Bound, &Out_Bound, NULL, forward);
74 construct_contig_jump_expressions(I, y, My, yMy_length, env, uv_map, &In_Bound, &Out_Bound, &length_expr, forward);
76 if(!contains(seen, My)) {
77 Q.insert(My, My_dist);
87 void construct_jump_graph()
94 jumped_edge(sg.source(_jumped_edge), sg.target(_jumped_edge)),
95 gap_length(std::max<int>(_sg[_jumped_edge].length, 0))
98 assert(!g[jumped_edge].is_matching_edge());
99 construct_jump_graph();
Definition: contig_jump_network.hpp:8
Definition: read_adj_list.hpp:22
Definition: contig_jump_network.hpp:21
Definition: scaffold_graph.hpp:12
Definition: set_queue.hpp:20