gatb.core-API-0.0.0
GraphUnitigsTemplate< span > Class Template Reference

Class representing a De Bruijn graph based on unitigs. More...

#include <GraphUnitigs.hpp>

Inheritance diagram for GraphUnitigsTemplate< span >:
Inheritance graph

Public Member Functions

GraphUnitigsTemplateoperator= (GraphUnitigsTemplate const &graph)
 
GraphIterator< NodeGU > iterator () const
 
GraphVector< NodeGU > neighbors (NodeGU &node, Direction dir=DIR_END) const
 
GraphVector< NodeGU > successors (NodeGU &node) const
 
int simplePathAvance (const NodeGU &node, Direction dir, EdgeGU &output) const
 
bool isBranching (const NodeGU &node) const
 
bool isSimple (EdgeGU &edge) const
 
void remove ()
 
 GraphUnitigsTemplate (size_t kmerSize)
 
 GraphUnitigsTemplate (const std::string &uri)
 
- Public Member Functions inherited from GraphTemplate< NodeFast< span >, EdgeFast< span >, GraphDataVariantFast< span > >
 GraphTemplate (size_t kmerSize)
 
 GraphTemplate (bank::IBank *bank, tools::misc::IProperties *params)
 
 GraphTemplate (tools::misc::IProperties *params)
 
 GraphTemplate (const std::string &uri)
 
GraphTemplateoperator= (const GraphTemplate &graph)
 
GraphIterator< NodeFast< span > > iterator () const
 
GraphVector< NodeFast< span > > neighbors (NodeFast< span > &node, Direction dir=DIR_END) const
 
GraphVector< NodeFast< span > > neighbors (const typename NodeFast< span >::Value &kmer) const
 
std::set< BranchingNode_t< NodeFast< span > > > neighbors (typename std::set< BranchingNode_t< NodeFast< span > > >::iterator first, typename std::set< BranchingNode_t< NodeFast< span > > >::iterator last) const
 
GraphVector< NodeFast< span > > successors (NodeFast< span > &node) const
 
GraphVector< NodeFast< span > > predecessors (NodeFast< span > &node) const
 
GraphVector< std::pair< EdgeFast< span >, EdgeFast< span > > > successorsEdge (const NodeFast< span > &node1, const NodeFast< span > &node2) const
 
GraphVector< std::pair< EdgeFast< span >, EdgeFast< span > > > predecessorsEdge (const NodeFast< span > &node1, const NodeFast< span > &node2) const
 
NodeFast< span > neighbor (NodeFast< span > &source, Direction dir, kmer::Nucleotide nt) const
 
NodeFast< span > neighbor (NodeFast< span > &source, Direction dir, kmer::Nucleotide nt, bool &exists) const
 
NodeFast< span > successor (NodeFast< span > &source, kmer::Nucleotide nt) const
 
NodeFast< span > predecessor (NodeFast< span > &source, kmer::Nucleotide nt) const
 
size_t indegree (NodeFast< span > &node) const
 
size_t outdegree (NodeFast< span > &node) const
 
size_t degree (NodeFast< span > &node, Direction dir) const
 
int simplePathAvance (NodeFast< span > &node, Direction dir, EdgeFast< span > &output) const
 
bool contains (const NodeFast< span > &item) const
 
std::string toString (const NodeFast< span > &node) const
 
std::string toString (const EdgeFast< span > &edge) const
 
std::string toString (const BranchingEdge_t< NodeFast< span >, EdgeFast< span > > &edge) const
 
bool isBranching (NodeFast< span > &node) const
 
NodeFast< span > buildNode (const tools::misc::Data &data, size_t offset=0) const
 
NodeFast< span > buildNode (const char *sequence) const
 
NodeFast< span > reverse (const NodeFast< span > &node) const
 
BranchingNode_t< NodeFast< span > > reverse (const BranchingNode_t< NodeFast< span > > &node) const
 
EdgeFast< span > reverse (const EdgeFast< span > &edge) const
 
GraphVector< NodeFast< span > > mutate (const NodeFast< span > &node, size_t idx, int mode=0) const
 
kmer::Nucleotide getNT (const NodeFast< span > &node, size_t idx) const
 
int queryAbundance (NodeFast< span > &node) const
 
int queryNodeState (NodeFast< span > &node) const
 
bool isSimple (EdgeFast< span > &edge) const
 
std::string getName () const
 
size_t getKmerSize () const
 
tools::misc::IPropertiesgetInfo () const
 
void remove ()
 
void precomputeAdjacency (unsigned int nbCores=1, bool verbose=true)
 

Static Public Member Functions

static GraphUnitigsTemplate create (size_t kmerSize)
 
static GraphUnitigsTemplate create (bank::IBank *bank, const char *fmt,...)
 
static GraphUnitigsTemplate create (const char *fmt,...)
 
static GraphUnitigsTemplate create (tools::misc::IProperties *options, bool load_unitigs_after=true)
 
static GraphUnitigsTemplate load (const std::string &uri)
 
- Static Public Member Functions inherited from GraphTemplate< NodeFast< span >, EdgeFast< span >, GraphDataVariantFast< span > >
static GraphTemplate create (size_t kmerSize)
 
static GraphTemplate create (bank::IBank *bank, const char *fmt,...)
 
static GraphTemplate create (const char *fmt,...)
 
static GraphTemplate create (tools::misc::IProperties *options)
 
static GraphTemplate load (const std::string &uri)
 
static tools::misc::IOptionsParsergetOptionsParser (bool includeMandatory=true)
 

Additional Inherited Members

- Public Attributes inherited from GraphTemplate< NodeFast< span >, EdgeFast< span >, GraphDataVariantFast< span > >
tools::storage::impl::StorageMode_e _storageMode
 
tools::storage::impl::Storage_storage
 
void * _variant
 
size_t _kmerSize
 
tools::misc::impl::Properties _info
 
- Static Public Attributes inherited from GraphTemplate< NodeFast< span >, EdgeFast< span >, GraphDataVariantFast< span > >
static const tools::storage::impl::StorageMode_e PRODUCT_MODE_DEFAULT
 

Detailed Description

template<size_t span>
class gatb::core::debruijn::impl::GraphUnitigsTemplate< span >

Class representing a De Bruijn graph based on unitigs.

Nodes are k-mer extremities of unitigs. They're represented implicitly internally. Edges are (k-1) overlaps between nodes in different unitigs

Constructor & Destructor Documentation

GraphUnitigsTemplate ( size_t  kmerSize)

Constructor for empty graph.

GraphUnitigsTemplate ( const std::string &  uri)

Constructor. Use for reading from filesystem.

Member Function Documentation

static GraphUnitigsTemplate create ( size_t  kmerSize)
inlinestatic

Build an empty graph.

Parameters
[in]kmerSizekmer size
Returns
the created graph.
GraphUnitigsTemplate< span > create ( bank::IBank bank,
const char *  fmt,
  ... 
)
static

Build a graph from a given bank.

Parameters
[in]bank: bank to get the reads from
[in]fmt: printf-like format for the command line string
Returns
the created graph.
GraphUnitigsTemplate< span > create ( const char *  fmt,
  ... 
)
static

Build a graph from user options.

Parameters
[in]fmtprintf-like format
Returns
the created graph.
static GraphUnitigsTemplate create ( tools::misc::IProperties options,
bool  load_unitigs_after = true 
)
inlinestatic

so, hm, what's the point of a create() function that just calls a constructor? I really don't get the factory pattern yet

bool isBranching ( const NodeGU &  node) const

REMARKS : it's a bit of a misnomer, but in GATB language, Branching means "anything not simple". I.e. simple means outdegree=indegree=1 and branching is every other degree combination, including 0's

bool isSimple ( EdgeGU &  edge) const

Tells whether the provided edge is simple: outdegree(from)==1 and indegree(to)==1

Parameters
[in]edge: the edge to be asked
Returns
true if the edge is simple, false otherwise.
GraphIterator<NodeGU> iterator ( ) const
inline

Creates an iterator over nodes of the graph.

Returns
the nodes iterator.
static GraphUnitigsTemplate load ( const std::string &  uri)
inlinestatic

Load a graph from some URI.

Parameters
[in]uri: the uri to get the graph from
Returns
the loaded graph.
GraphVector<NodeGU> neighbors ( NodeGU &  node,
Direction  dir = DIR_END 
) const
inline

Returns a vector of neighbors of the provided node.

Parameters
[in]node: the node whose neighbors are wanted
[in]direction: the direction of the neighbors. If not set, out and in neighbors are computed.
Returns
a vector of the node neighbors (may be empty). Warning: be sure to check if edge.from (or node.from) is actually your input node, or its reverse complement.
GraphUnitigsTemplate& operator= ( GraphUnitigsTemplate< span > const &  graph)

Affectation overload.

void remove ( )

Remove physically a graph.

int simplePathAvance ( const NodeGU &  node,
Direction  dir,
EdgeGU &  output 
) const

Simple paths traversal invariant: the input kmer has no in-branching.

Returns
1 if a good extension is found 0 if a deadend was reached -1 if out-branching was detected -2 if no out-branching but next kmer has in-branching
GraphVector<NodeGU> successors ( NodeGU &  node) const
inline

Shortcut for 'neighbors' method

Parameters
[in]node: the node whose neighbors are wanted
Returns
a vector of the node neighbors (may be empty).

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