Contain all the information for the mapping of a k-mer or a sequence to a unitig of a Compacted de Bruijn graph.
More...
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
class UnitigMap< Unitig_data_t, Graph_data_t, is_const >
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() [1/2]
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
UnitigMap< Unitig_data_t, Graph_data_t, is_const >::UnitigMap |
( |
size_t |
length = 1 , |
|
|
CompactedDBG_ptr_t |
cdbg_ = nullptr |
|
) |
| |
UnitigMap constructor.
- Parameters
-
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). |
- Returns
- an empty UnitigMap.
◆ UnitigMap() [2/2]
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
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.
- Parameters
-
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). |
- Returns
- a UnitigMap.
◆ getData()
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = 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.
- Returns
- a pointer to the data associated with the reference unitig used in the mapping or a nullptr pointer if:
- there is no mapping (UnitigMap::isEmpty = true)
- there is no data associated with the unitigs (U = void). The returned pointer is constant if the UnitigMap is constant (UnitigMap<U, G, true>).
◆ getGraph()
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
CompactedDBG_ptr_t UnitigMap< Unitig_data_t, Graph_data_t, is_const >::getGraph |
( |
| ) |
const |
|
inline |
Get a pointer to the CompactedDBG containing the reference unitig used in the mapping.
- Returns
- a pointer to the CompactedDBG containing the reference unitig used in the mapping. If the mapping is empty, a nullptr pointer is returned. The pointer is a constant pointer if the UnitigMap is constant (UnitigMap<U, G, true>).
◆ getKmerMapping()
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
UnitigMap<U, G, is_const> UnitigMap< Unitig_data_t, Graph_data_t, 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.
- Parameters
-
pos | is the start position of the k-mer to map in the reference unitig used for the current mapping. |
- Returns
- a UnitigMap object which is the mapping.
◆ getMappedHead()
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
Kmer UnitigMap< Unitig_data_t, Graph_data_t, is_const >::getMappedHead |
( |
| ) |
const |
Get the head k-mer of the mapped sequence.
- Returns
- a Kmer object which is either the head k-mer of the mapped sequence or an empty k-mer if there is no mapping (UnitigMap::isEmpty = true).
◆ getMappedKmer()
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
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.
- Parameters
-
pos | is the start position of the k-mer to extract within the mapped sequence. |
- Returns
- a Kmer object which is either the k-mer starting at position pos in the mapped sequence or an empty k-mer if there is either no mapping (UnitigMap::isEmpty = true) or the position is greater than length(unitig)-k.
◆ getMappedTail()
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
Kmer UnitigMap< Unitig_data_t, Graph_data_t, is_const >::getMappedTail |
( |
| ) |
const |
Get the tail k-mer of the mapped sequence.
- Returns
- a Kmer object which is either the tail k-mer of the mapped sequence or an empty k-mer if there is no mapping (UnitigMap::isEmpty = true).
◆ getPredecessors()
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
◆ getSuccessors()
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
◆ getUnitigHead()
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
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.
- Returns
- a Kmer object which is either the head k-mer of the mapped unitig or an empty k-mer if there is no mapping (UnitigMap::isEmpty = true).
◆ getUnitigKmer()
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
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.
- Parameters
-
pos | is the start position of the k-mer to extract. |
- Returns
- a Kmer object which is either the k-mer starting at position pos in the mapped unitig or an empty k-mer if there is either no mapping (UnitigMap::isEmpty = true) or the position is greater than length(unitig)-k.
◆ getUnitigTail()
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
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.
- Returns
- a Kmer object which is either the tail k-mer of the mapped unitig or an empty k-mer if there is no mapping (UnitigMap::isEmpty = true).
◆ isSameReferenceUnitig()
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
bool UnitigMap< Unitig_data_t, Graph_data_t, is_const >::isSameReferenceUnitig |
( |
const UnitigMap< Unitig_data_t, Graph_data_t, is_const > & |
o | ) |
const |
check if two UnitigMap have the same unitig as reference.
- Returns
- a boolean indicating if two UnitigMap have the same unitig as reference.
◆ lcp()
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
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.
- Parameters
-
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). |
- Returns
- the length of the longest common prefix
◆ mappedSequenceToString()
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
string UnitigMap< Unitig_data_t, Graph_data_t, is_const >::mappedSequenceToString |
( |
| ) |
const |
Create a string containing the sequence corresponding to the mapping.
- Returns
- a string containing the sequence corresponding to the mapping or an empty string if there is no mapping (UnitigMap::isEmpty = true).
◆ operator!=()
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
bool UnitigMap< Unitig_data_t, Graph_data_t, is_const >::operator!= |
( |
const UnitigMap< Unitig_data_t, Graph_data_t, is_const > & |
o | ) |
const |
Inequality operator: check if two UnitigMap are different.
- Returns
- a boolean indicating if the two UnitigMap are different.
◆ operator==()
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
bool UnitigMap< Unitig_data_t, Graph_data_t, is_const >::operator== |
( |
const UnitigMap< Unitig_data_t, Graph_data_t, is_const > & |
o | ) |
const |
Equality operator: check if two UnitigMap are the same.
- Returns
- a boolean indicating if two UnitigMap are the same.
◆ referenceUnitigToString()
template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
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.
- Returns
- a string containing the sequence of the reference unitig used the mapping or an empty string if there is no mapping (UnitigMap::isEmpty = true).
The documentation for this class was generated from the following files:
CompactedDBG_ptr_t getGraph() const
Get a pointer to the CompactedDBG containing the reference unitig used in the mapping.
Definition: UnitigMap.hpp:243