Bifrost
|
Contain all the information for the mapping of a k-mer or a sequence to a unitig of a Compacted de Bruijn graph. More...
Public Member Functions | |
UnitigMap (size_t l=1) | |
UnitigMap constructor. More... | |
bool | operator== (const UnitigMap &o) |
Check if two UnitigMaps are the same. More... | |
bool | operator!= (const UnitigMap &o) |
Check if two UnitigMaps are different. More... | |
string | toString () const |
Return a string containing the sequence of the mapped unitig. More... | |
string | reverseToString () const |
Return a string containing the reverse-complement sequence of the mapped unitig. More... | |
Kmer | getHead () const |
Return the head k-mer of the mapped unitig. More... | |
Kmer | getTail () const |
Return the tail k-mer of the mapped unitig. More... | |
Kmer | getKmer (const size_t pos) const |
Return the k-mer starting at position pos in the mapped unitig. More... | |
const T * | getData () const |
Return a pointer to the data associated with the mapped unitig. More... | |
void | setData (const T *const data) const |
Set the data associated with a mapped unitig. More... | |
void | mergeData (const UnitigMap< T > &um) |
Merge the data of the mapped unitig with the data of another mapped unitig. More... | |
Unitig< T > | splitData (const bool last_split) |
Create new data to associate with a new unitig which is a sub-unitig of the current mapped unitig. More... | |
BackwardCDBG< T, true > | getPredecessors () const |
Return a constant BackwardCDBG object that can create iterators (through BackwardCDBG::begin() and BackwardCDBG::end()) over the predecessors of the current mapped unitig. More... | |
ForwardCDBG< T, true > | getSuccessors () const |
Return a constant BackwardCDBG object that can create iterators (through BackwardCDBG::begin() and BackwardCDBG::end()) over the successors of the current mapped unitig. More... | |
BackwardCDBG< T, false > | getPredecessors () |
Return a BackwardCDBG object that can create iterators (through BackwardCDBG::begin() and BackwardCDBG::end()) over the predecessors of the current mapped unitig. More... | |
ForwardCDBG< T, false > | getSuccessors () |
Return a BackwardCDBG object that can create iterators (through BackwardCDBG::begin() and BackwardCDBG::end()) over the successors of the current mapped unitig. More... | |
Data Fields | |
size_t | dist |
0-based distance of the match from start of the unitig | |
size_t | len |
Length of the match on the unitig (in k-mers) | |
size_t | size |
Length of the unitig. | |
bool | strand |
True if the k-mer or sequence matches the forward strand, false if it matches its reverse-complement. | |
bool | isEmpty |
True if the k-mer or sequence does not match a unitig of the graph, false otherwise. | |
CompactedDBG< T > * | cdbg |
Compacted de Bruijn graph containing the unitig associated with the mapping. | |
Contain all the information for the mapping of a k-mer or a sequence to a unitig of a Compacted de Bruijn graph.
Its template parameter indicates the type of data associated with the unitig and should be the same as the one specified for CompactedDBG. An example of using such a structure is shown in src/snippets.hpp.
const T * UnitigMap< T >::getData | ( | ) | const |
Return a pointer to the data associated with the mapped unitig.
Kmer UnitigMap< T >::getHead | ( | ) | const |
Return the head k-mer of the mapped unitig.
Kmer UnitigMap< T >::getKmer | ( | const size_t | pos | ) | const |
Return the k-mer starting at position pos in the mapped unitig.
pos | is the start position of the k-mer to extract. |
BackwardCDBG< T, true > UnitigMap< T >::getPredecessors | ( | ) | const |
Return a constant BackwardCDBG object that can create iterators (through BackwardCDBG::begin() and BackwardCDBG::end()) over the predecessors of the current mapped unitig.
BackwardCDBG< T, false > UnitigMap< T >::getPredecessors | ( | ) |
Return a BackwardCDBG object that can create iterators (through BackwardCDBG::begin() and BackwardCDBG::end()) over the predecessors of the current mapped unitig.
ForwardCDBG< T, true > UnitigMap< T >::getSuccessors | ( | ) | const |
Return a constant BackwardCDBG object that can create iterators (through BackwardCDBG::begin() and BackwardCDBG::end()) over the successors of the current mapped unitig.
ForwardCDBG< T, false > UnitigMap< T >::getSuccessors | ( | ) |
Return a BackwardCDBG object that can create iterators (through BackwardCDBG::begin() and BackwardCDBG::end()) over the successors of the current mapped unitig.
Kmer UnitigMap< T >::getTail | ( | ) | const |
Return the tail k-mer of the mapped unitig.
Merge the data of the mapped unitig with the data of another mapped unitig.
This function calls the function CDBG_Data_t<T>::join but it does not set anything if there is no mapping (UnitigMap<T>::isEmpty = true) or no data associated with the unitigs (T = void).
um | is a reference to a mapped unitig that will be merged with the current mapped unitig. |
Check if two UnitigMaps are different.
Check if two UnitigMaps are the same.
string UnitigMap< T >::reverseToString | ( | ) | const |
Return a string containing the reverse-complement sequence of the mapped unitig.
void UnitigMap< T >::setData | ( | const T *const | data | ) | const |
Set the data associated with a mapped unitig.
The function does not set anything if there is no mapping (UnitigMap<T>::isEmpty = true) or no data associated with the unitigs (T = void).
data | is a pointer to the data that will be copied to the data associated with the mapped unitig. |
Create new data to associate with a new unitig which is a sub-unitig of the current mapped unitig.
Does not do anything if no data are associated with the unitigs (T = void).
last_split | is a boolean indicating this is the last call to UnitigMap<T>::splitData (true) on the current unitig mapped (this) or not (false). |
string UnitigMap< T >::toString | ( | ) | const |
Return a string containing the sequence of the mapped unitig.