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...
Inherits UnitigMapBase.
Public Member Functions | |
UnitigMap (size_t length=1, CompactedDBG_ptr_t cdbg_=nullptr) | |
UnitigMap constructor. More... | |
UnitigMap (const size_t start, const size_t length, const size_t unitig_sz, const bool strand) | |
UnitigMap constructor. More... | |
bool | operator== (const UnitigMap &o) const |
Equality operator: check if two UnitigMap are the same. More... | |
bool | operator!= (const UnitigMap &o) const |
Inequality operator: check if two UnitigMap are different. More... | |
string | mappedSequenceToString () const |
Create a string containing the sequence corresponding to the mapping. More... | |
string | referenceUnitigToString () const |
Create a string containing the sequence of the reference unitig used the mapping. More... | |
size_t | lcp (const char *s, const size_t pos_s=0, const size_t pos_um_seq=0, const bool um_reversed=false) const |
Compute the length of the longest common prefix between a given sequence and the reference unitig used in the mapping. More... | |
Kmer | getUnitigHead () const |
Get the head k-mer of the reference unitig used for the mapping. More... | |
Kmer | getUnitigTail () const |
Get the tail k-mer of the reference unitig used for the mapping. More... | |
Kmer | getUnitigKmer (const size_t pos) const |
Get the k-mer starting at position pos in the reference unitig used for the mapping. More... | |
Kmer | getMappedHead () const |
Get the head k-mer of the mapped sequence. More... | |
Kmer | getMappedTail () const |
Get the tail k-mer of the mapped sequence. More... | |
Kmer | getMappedKmer (const size_t pos) const |
Get the k-mer starting at position pos in the mapped sequence. More... | |
UnitigMap< U, G, is_const > | getKmerMapping (const size_t pos) const |
Create a new UnitigMap object which is the mapping of a k-mer on a reference unitig. More... | |
Unitig_data_ptr_t | getData () const |
Get a pointer to the data associated with the reference unitig used in the mapping. More... | |
UnitigMap_BW | getPredecessors () const |
Create a UnitigMap_BW object that can create iterators (through UnitigMap_BW::begin() and UnitigMap_BW::end()) over the predecessors of the reference unitig used in the mapping. More... | |
UnitigMap_FW | getSuccessors () const |
Create a UnitigMap_FW object that can create iterators (through UnitigMap_FW::begin() and UnitigMap_FW::end()) over the successors of the reference unitig used in the mapping. More... | |
CompactedDBG_ptr_t | getGraph () const |
Get a pointer to the CompactedDBG containing the reference unitig used in the mapping. More... | |
![]() | |
UnitigMapBase (const size_t length=1) | |
UnitigMapBase constructor (isEmpty = true). More... | |
UnitigMapBase (const size_t start, const size_t length, const size_t unitig_sz, const bool strand) | |
UnitigMapBase constructor (isEmpty = false). More... | |
bool | operator== (const UnitigMapBase &o) const |
Equality operator: check if two UnitigMapBase are the same. More... | |
bool | operator!= (const UnitigMapBase &o) const |
Inequality operator: check if two UnitigMapBase are different. More... | |
Additional Inherited Members | |
![]() | |
size_t | dist |
Start position of the mapping (0-based distance) from the start of the reference unitig. | |
size_t | len |
Length of the mapping on the reference unitig, in k-mers. | |
size_t | size |
Length of the reference unitig. | |
bool | strand |
True if the mapped k-mer or sequence matches the forward strand, false if it matches its reverse-complement. | |
bool | isEmpty |
True if there is no mapping. | |
Contain all the information for the mapping of a k-mer or a sequence to a unitig of a Compacted de Bruijn graph.
A UnitigMap object has 3 template parameters: the type of data associated with the unitigs of the graph, the type of data associated with the graph and a boolean indicating if this is a constant UnitigMap (const_UnitigMap) or not. A const_UnitigMap can be modified but you can't modify the CompactedDBG you can access using UnitigMap::getCompactedDBG. The unitig data and graph data types should be the same as the ones used for the CompactedDBG.
UnitigMap< Unitig_data_t, Graph_data_t, is_const >::UnitigMap | ( | size_t | length = 1 , |
CompactedDBG_ptr_t | cdbg_ = nullptr |
||
) |
UnitigMap constructor.
length | is the length of the mapping in k-mers (default is 1 k-mer). |
cdbg_ | is a pointer to the CompactedDBG containing the reference unitig used for the mapping (default is nullptr). |
UnitigMap< Unitig_data_t, Graph_data_t, is_const >::UnitigMap | ( | const size_t | start, |
const size_t | length, | ||
const size_t | unitig_sz, | ||
const bool | strand | ||
) |
UnitigMap constructor.
This constructor is used to create temporary mappings and must not be used to extract information from the graph.
start | is the start position of the mapping (0-based distance) from the start of the reference unitig. |
length | is the length of the mapping in k-mers. |
unitig_sz | is the length of the reference unitig used for the mapping. |
strand | indicates if the mapped k-mer or sequence matches the forward strand (true) or the reverse-complement (false). |
Unitig_data_ptr_t UnitigMap< Unitig_data_t, Graph_data_t, is_const >::getData | ( | ) | const |
Get a pointer to the data associated with the reference unitig used in the mapping.
|
inline |
Get a pointer to the CompactedDBG containing the reference unitig used in the mapping.
Kmer UnitigMap< Unitig_data_t, Graph_data_t, is_const >::getMappedHead | ( | ) | const |
Get the head k-mer of the mapped sequence.
Kmer UnitigMap< Unitig_data_t, Graph_data_t, is_const >::getMappedKmer | ( | const size_t | pos | ) | const |
Get the k-mer starting at position pos in the mapped sequence.
pos | is the start position of the k-mer to extract within the mapped sequence. |
Kmer UnitigMap< Unitig_data_t, Graph_data_t, is_const >::getMappedTail | ( | ) | const |
Get the tail k-mer of the mapped sequence.
UnitigMap_BW UnitigMap< Unitig_data_t, Graph_data_t, is_const >::getPredecessors | ( | ) | const |
Create a UnitigMap_BW object that can create iterators (through UnitigMap_BW::begin() and UnitigMap_BW::end()) over the predecessors of the reference unitig used in the mapping.
UnitigMap_FW UnitigMap< Unitig_data_t, Graph_data_t, is_const >::getSuccessors | ( | ) | const |
Create a UnitigMap_FW object that can create iterators (through UnitigMap_FW::begin() and UnitigMap_FW::end()) over the successors of the reference unitig used in the mapping.
Kmer UnitigMap< Unitig_data_t, Graph_data_t, is_const >::getUnitigHead | ( | ) | const |
Get the head k-mer of the reference unitig used for the mapping.
Kmer UnitigMap< Unitig_data_t, Graph_data_t, is_const >::getUnitigKmer | ( | const size_t | pos | ) | const |
Get the k-mer starting at position pos in the reference unitig used for the mapping.
pos | is the start position of the k-mer to extract. |
Kmer UnitigMap< Unitig_data_t, Graph_data_t, is_const >::getUnitigTail | ( | ) | const |
Get the tail k-mer of the reference unitig used for the mapping.
size_t UnitigMap< Unitig_data_t, Graph_data_t, is_const >::lcp | ( | const char * | s, |
const size_t | pos_s = 0 , |
||
const size_t | pos_um_seq = 0 , |
||
const bool | um_reversed = false |
||
) | const |
Compute the length of the longest common prefix between a given sequence and the reference unitig used in the mapping.
s | is a pointer to an array of characters representing the sequence from which the length of the longest common prefix must be computed. |
pos_s | is the start position in s from which the longest common prefix must be computed. |
pos_um_seq | is the start position in the reference unitig of the mapping from which the longest common prefix must be computed. |
um_reversed | indicates if the longest common prefix must be computed from the reverse-complement of the reference unitig used in the mapping (true) or not (false). |
string UnitigMap< Unitig_data_t, Graph_data_t, is_const >::mappedSequenceToString | ( | ) | const |
Create a string containing the sequence corresponding to the mapping.
string UnitigMap< Unitig_data_t, Graph_data_t, is_const >::referenceUnitigToString | ( | ) | const |
Create a string containing the sequence of the reference unitig used the mapping.