gatb.core-API-1.4.2
Node_t< Value_t > Struct Template Reference

Node structure representing a node in the De Bruijn graph. More...

#include <Graph.hpp>

Inheritance diagram for Node_t< Value_t >:
Inheritance graph

Public Types

typedef Value_t Value
 

Public Member Functions

 Node_t ()
 
 Node_t (const Node_t::Value &kmer, kmer::Strand strand=kmer::STRAND_FORWARD, u_int16_t abundance=0, u_int64_t mphfIndex=0)
 
bool operator== (const Node_t &other) const
 
bool operator!= (const Node_t &other) const
 
bool operator< (const Node_t &other) const
 
void set (const Node_t::Value &kmer, const kmer::Strand &strand)
 

Public Attributes

Node_t::Value kmer
 
kmer::Strand strand
 
u_int16_t abundance
 

Detailed Description

template<typename Value_t = tools::math::Integer>
struct gatb::core::debruijn::impl::Node_t< Value_t >

Node structure representing a node in the De Bruijn graph.

The Node structure needs at least two attributes for uniquely defining a node in the DBG:

  • a kmer value (representing a node and its reverse complement)
  • a strand value (telling on which strand the kmer has to be interpreted)

A specific Node::Value type is defined for the kmer type. It may be used sometimes when one wants to perform some action on a node without the need to know the strand.

Although it is possible to instantiate "from scratch" a Node object, it is likely that Node objects are retrieved through the Graph class. Indeed, a Node object is likely to be useful if it belongs to a graph, so it makes sense that the Graph class is the main actor for providing Node objects.

The Node structure may be inherited by other structure, mainly for refining some characteristics for some kinds of nodes. For instance, a BranchingNode structure may be defined for nodes that have more than one incoming and/or outcoming neighbors. Such inherited structures could be understood as regular Node instance with a specific invariant. They can also be the material for specialization of some template methods of the Graph class (see for instance Graph::iterator template specialization for the BranchingNode structure).

The Node structure has also a 'abundance' attribute; it gives the occurrences number of the kmer in the initial set of reads. Note that this attribute has a correct value only when nodes are iterated (from the solid kmers on disk). When Node objects are created via the Graph API (e.g. using as a result of buildNode, successors(), predecessors(), etc..), developers should not assume that the 'abundance' attribute is correctly set. Use the queryAbundance() function instead to get the abundance of a node.

Member Typedef Documentation

typedef Value_t Value

Type for a kmer value.

Constructor & Destructor Documentation

Node_t ( )
inline

Default constructor.

Node_t ( const Node_t< Value_t >::Value kmer,
kmer::Strand  strand = kmer::STRAND_FORWARD,
u_int16_t  abundance = 0,
u_int64_t  mphfIndex = 0 
)
inline

Constructor.

Parameters
[in]kmer: kmer value. By default, it is the minimum value of the forward and revcomp value.
[in]strand: strand telling how to interpret the kmer value. Default value is forward by convention.
[in]abundance: abundance of the kmer. Default value is 0 if not set.

Member Function Documentation

bool operator!= ( const Node_t< Value_t > &  other) const
inline

Overload of operator != NOTE: by now, it doesn't take care of the strand...

bool operator< ( const Node_t< Value_t > &  other) const
inline

Overload of operator < NOTE: by now, it doesn't take care of the strand...

bool operator== ( const Node_t< Value_t > &  other) const
inline

Overload of operator == NOTE: by now, it doesn't take care of the strand...

void set ( const Node_t< Value_t >::Value kmer,
const kmer::Strand strand 
)
inline

Setter for some attributes of the Node object. Usually used by the Graph class for setting a Node object's guts.

Parameters
[in]kmer: the kmer value to be set
[in]strand: strand to be set

Member Data Documentation

u_int16_t abundance

Abundance of the kmer in the initial set of reads.

kmer value for the node (min of the forward and revcomp value of the bi-directed DB graph).

kmer::Strand strand

Strand telling how to interpret the node in the bi-directed DB graph.


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