Scaffolding  0.1
This program can assemble genome scaffolds using the pairing information in paired-end reads.
Public Types | Public Member Functions | Public Attributes | List of all members
scaffold::Instance Class Reference

an instance is a ScaffoldGraph with given path- & cycle- numbers and a solution to keep track of deleted edges More...

#include <instance.hpp>

Inheritance diagram for scaffold::Instance:
scaffold::ScaffoldGraph

Public Types

typedef Solution solution_type
 
- Public Types inherited from scaffold::ScaffoldGraph
typedef RawScaffoldGraph Graph
 
typedef boost::graph_traits< Graph >::vertex_descriptor Vertex
 
typedef boost::graph_traits< Graph >::edge_descriptor Edge
 
typedef Graph::vertex_bundled VertexProperty
 
typedef Graph::edge_bundled EdgeProperty
 
typedef Graph::graph_bundled GraphProperty
 
typedef boost::property_map< Graph, unsigned VertexProperty::* >::const_type cVertexIndexMap
 
typedef boost::property_map< Graph, unsigned VertexProperty::* >::type VertexIndexMap
 
typedef boost::unordered_set< Vertex > VertexSet
 

Public Member Functions

 Instance (const unsigned np, const unsigned nc, const unsigned no=UINT_MAX)
 construct an empty solution solution
 
 Instance (RawScaffoldGraph *const _g, const unsigned np, const unsigned nc, const unsigned no=UINT_MAX)
 construct an instance using the given pointer _g as graph - no copy is performed
 
 Instance (const ScaffoldGraph &_g, const unsigned np, const unsigned nc, const unsigned no=UINT_MAX, const bool update_infos=false)
 construct an instance using the given ScaffoldGraph, which is copied More...
 
 Instance (const Instance &I, ScafMatching *const translate=NULL, const bool update_infos=false)
 copy constructor creating a copy of the graph and returning the translate map More...
 
Instancesplit_off_component ()
 split off one connected component from I and return an instance consisting only of it. If we have just one component, do nothing & return NULL More...
 
void disjoint_union (const Instance &I)
 disjointly merge I into us, merging partial solutions along the way
 
void delete_edge (const ScafEdge &e, const bool register_in_solution=false)
 delete an edge e and add the deletion to the solution if requested
 
bool delete_edge (const ScafVertex &u, const ScafVertex &v, const bool register_in_solution=false)
 delete the edge (u,v) and add this deletion to the solution if requested; return success
 
void clear_vertex_except (const ScafVertex &u, const ScafEdge *const e, const bool register_in_solution=false)
 remove all non-matching edges incident with u, except for e
 
- Public Member Functions inherited from scaffold::ScaffoldGraph
 ScaffoldGraph ()
 constructor initializing an empty graph
 
 ScaffoldGraph (const Graph &g)
 constructor initializing a copy of the given graph g
 
 ScaffoldGraph (Graph *const g)
 constructor initializing using the given graph pointer; no copy is performed More...
 
 ScaffoldGraph (const ScaffoldGraph &g, Matching< Graph > *const translate, const bool update_infos=true)
 constructor initializing a copy of the given graph g and returning the translate map in translate; update infos if requested More...
 
 ~ScaffoldGraph ()
 destructor deleting _the_graph
 
void update_vertex_indices (const unsigned first_index=0)
 recompute vertex indices; useful after deleting vertices or uniting scaffold graphs
 
const VertexIndexMap get_index_map () const
 get an index map to use in various boost algorithms
 
std::pair< Edge, bool > find_edge (const Vertex &u, const Vertex &v) const
 find an edge in _the_graph, given its endpoints More...
 
void clear_vertex (const Vertex &u)
 remove all non-matching edges incident with u
 
void delete_vertex (const Vertex &u, const bool update_indices=true, const bool update_infos=true)
 remove a vertex and all its incident edges More...
 
const VertexProperty & operator[] (const Vertex &u) const
 get a const reference to the vertex properties of u
 
VertexProperty & operator[] (const Vertex &u)
 get a reference to the vertex properties of u
 
const EdgeProperty & operator[] (const Edge &e) const
 get a const reference to the edge properties of e
 
EdgeProperty & operator[] (const Edge &e)
 get a reference to the edge properties of e
 
const EdgeProperty & operator[] (const VertexPair< Graph > &uv) const
 get a const reference to the edge properties of uv, throwing invalid_assumption if uv does not exist
 
EdgeProperty & operator[] (const VertexPair< Graph > &uv)
 get a reference to the edge properties of uv, throwing invalid_assumption if uv does not exist
 
const GraphProperty & get_graph_property () const
 return a const reference to the graph properties
 
Vertex source (const Edge &e) const
 get a copy of the source vertex of e
 
Vertex target (const Edge &e) const
 get a copy of the target vertex of e
 
const GraphInfos< Graph > & get_infos () const
 get a const reference to the graph infos
 
const Graph & get_graph () const
 get a const reference to the underlying graph
 
const Matching< Graph > & get_matching () const
 get a const reference to the perfect matching in _the_graph
 
const Vertex & matched_with (const Vertex &v) const
 get a const reference to the vertex matched with v
 
const bool is_matching_edge (const VertexPair< Graph > &uv) const
 return whether the given VertexPair is matched More...
 
const Edge incident_matching_edge (const Vertex &v) const
 return the matching edge that is incident with v
 
const unsigned degree (const Vertex &v) const
 return the degree of v
 
bool adjacent (const Vertex &u, const Vertex &v) const
 return whether u & v are adjacent
 
void get_neighbors (const Vertex &u, VertexSet &nh) const
 put all neighbors of u into nh
 
unsigned get_max_multiplicity () const
 compute the maximum multiplicity occuring in g
 
std::pair< Edge, int > get_max_non_contig_length () const
 return a non-contig edge of maximum length in the graph
 
void delete_edge (const Edge &e, const bool update_infos=true)
 delete an edge e and update infos if requested More...
 
bool delete_edge (const Vertex &u, const Vertex &v)
 delete an edge e and update infos if requested; return whether the edge had existed before or not
 
bool delete_edge (const VertexPair< Graph > &uv)
 convenience function to delete pairs of vertices
 
Vertex const * find_vertex_by_name (const VertexName &name) const
 find a vertex given its name More...
 
Edge const * find_edge_by_name (const EdgeName &name) const
 delete edge by name More...
 
const Vertex add_vertex (const VertexProperty &p, const bool update_infos=true)
 add a new vertex and return it
 
const Vertex add_vertex (const std::string name, const bool update_infos=true, const unsigned index=UINT_MAX)
 add a new vertex and return it; use the given name & index More...
 
const Vertex add_vertex (const Vertex &u, const bool update_infos=true)
 add a new vertex and return it; copy the name from vertex u More...
 
std::pair< Edge, bool > add_edge (const Vertex &u, const Vertex &v, const EdgeProperty &ep=EdgeProperty(), const bool update_infos=true)
 add a new edge unless it is already there; return it and whether an insertion took place More...
 
std::pair< Edge, bool > add_matching_edge (const Vertex &u, const Vertex &v, const EdgeProperty &ep=EdgeProperty(), const bool update_infos=true)
 add a matching edge unless the edge already exists; return the edge and whether an insertion took place More...
 
EdgeName get_edge_name (const VertexPair< Graph > &uv) const
 get a copy of the name of the edge uv; independent of its presence
 
EdgeName get_edge_name (const Edge &e) const
 get a copy of the name of an edge
 
bool is_bridge (const ScafVertex &u, const ScafVertex &v)
 return whether the given vertex pair constitutes a bridge, updating infos if necessary
 
bool is_bridge_const (const ScafVertex &u, const ScafVertex &v) const
 return whether the given vertex pair constitutes a bridge without updating the infos
 
bool is_on_alternating_cycle (const ScafVertex &u, const ScafVertex &v) const
 return whether the given edge is on an alternating cycle
 
unsigned weight () const
 return the total weight of the graph
 
template<class Predicate = TruePredicate<Edge>>
Predicated_EdgeIter< Graph, Predicate, EdgeIter< Graph > > get_edges (const Predicate &pred=Predicate()) const
 get all edges satisfying a predicate
 
Predicated_EdgeIter< Graph, MatchingPredicate< Graph >, EdgeIter< Graph > > get_matching_edges () const
 convenience fuction to get all matching edges
 
Predicated_EdgeIter< Graph, MatchingPredicate< Graph >, EdgeIter< Graph > > get_non_matching_edges () const
 convenience fuction to get all non-matching edges
 
template<class Predicate = TruePredicate<Edge>>
Predicated_EdgeIter< Graph, Predicateget_incident (const Vertex &u, const Predicate &pred=Predicate()) const
 get incident edges of u satisfying a predicate
 
Predicated_EdgeIter< Graph, MatchingPredicate< Graph > > get_incident_non_matching (const Vertex &u) const
 convenience function to get all incident non-matching edges of u
 
Graph *const split_off_component ()
 if _the_graph is disconnected, split off & return a connected compoenent, otherwise return NULL
 
void disjoint_union (const ScaffoldGraph &g)
 merge g into our graph
 
void print_statistics ()
 print various statistics
 
void remove_contigs ()
 remove all contig edges from the graph More...
 

Public Attributes

unsigned num_paths
 max number of paths in solutions
 
unsigned num_cycles
 max number of cycles in solutions
 
unsigned num_objects
 max number of objects (sum of paths & cycles) in solutions
 
solution_type solution
 a partial solution
 

Additional Inherited Members

- Protected Member Functions inherited from scaffold::ScaffoldGraph
void copy_and_init_matching (const ScaffoldGraph &g, Matching< Graph > *const translate, const bool update_infos)
 outsource common constructor work: copy a given graph, construct a matching from the translate map, and update infos if requested
 
void parse_matching_from_graph ()
 compute the matching by parsing the properties of all edges
 
void delete_matching (const Vertex &u)
 remove the indication that uv is a matching edge
 
- Protected Attributes inherited from scaffold::ScaffoldGraph
Graph *const _the_graph
 the underlying boost graph
 
Matching< Graph > matched
 a perfect matching in _the_graph
 
GraphInfos< Graph > infos
 a set of graph properties of the underlying graph More...
 

Detailed Description

an instance is a ScaffoldGraph with given path- & cycle- numbers and a solution to keep track of deleted edges

Constructor & Destructor Documentation

scaffold::Instance::Instance ( const ScaffoldGraph _g,
const unsigned  np,
const unsigned  nc,
const unsigned  no = UINT_MAX,
const bool  update_infos = false 
)
inline

construct an instance using the given ScaffoldGraph, which is copied

update_infos can be used to recompute all graph infos

scaffold::Instance::Instance ( const Instance I,
ScafMatching *const  translate = NULL,
const bool  update_infos = false 
)
inline

copy constructor creating a copy of the graph and returning the translate map

update_infos can be used to recompute all graph infos

Member Function Documentation

Instance* scaffold::Instance::split_off_component ( )
inline

split off one connected component from I and return an instance consisting only of it. If we have just one component, do nothing & return NULL

NOTE: in case of a split-off, the result is guaranteed connected, while the remainder of the instance might not be


The documentation for this class was generated from the following file: