9 #ifndef RP_CONTIG_JUMPS_HPP
10 #define RP_CONTIG_JUMPS_HPP
12 #include "utils/graph_typedefs.hpp"
14 #include "utils/scaffolding_utils.hpp"
16 using namespace boost;
21 template <
class Graph>
22 bool rp_contig_jumps(Instance<Graph>& I){
23 const Graph& g = *I.g;
26 for(
const typename Matching<Graph>::value_type& contig : I.matched){
27 const Vertex<Graph> u = contig.first;
28 const Vertex<Graph> v = contig.second;
29 const size_t u_deg = boost::degree(u, g);
30 const size_t v_deg = boost::degree(v, g);
31 const Edge<Graph>& uv = boost::edge(u, v, g).first;
32 const size_t contig_length = boost::get(boost::edge_length, g, uv);
35 if(contig_length < I.insert_size){
36 #warning TODO: implement detection of jumps over more than one contig
37 #warning TODO: for any given short contig, only keep the most supported jump
38 if( ( u_deg > 1) && (v_deg > 1) ){
40 for(OEdgeIterRange<Graph> u_r = boost::out_edges(u, g); u_r.first != u_r.second; ++u_r.first){
41 const Edge<Graph>& ux = *u_r.first;
42 const Vertex<Graph>& x = boost::target(ux, g);
44 for(OEdgeIterRange<Graph> v_r = boost::out_edges(v, g); v_r.first != v_r.second; ++v_r.first){
45 const Edge<Graph>& vy = *v_r.first;
46 const Vertex<Graph>& y = boost::target(vy, g);
47 if( (y != u) && !I.is_matching_edge(x, y)){
48 const std::pair<Edge<Graph>,
bool> xy_pair = boost::edge(x, y, g);
50 const Edge<Graph>& xy = xy_pair.first;
61 DEBUG3(std::cout <<
"deleting jump-edge "<<EdgeAndGraph<Graph>(xy, *I.g)<<std::endl);
Definition: graph_utils.hpp:18
Definition: read_adj_list.hpp:22
bool preprocess
bool indicating whether to run preprocessing or not (currently defunct)
Definition: command_line.hpp:41