If data are to be associated with the unitigs of the colored and compacted de Bruijn graph, those data must be wrapped into a class that inherits from the abstract class CCDBG_Data_t.
More...
template<typename Unitig_data_t>
class CCDBG_Data_t< Unitig_data_t >
If data are to be associated with the unitigs of the colored and compacted de Bruijn graph, those data must be wrapped into a class that inherits from the abstract class CCDBG_Data_t.
To associate data of type "MyUnitigData" to unitigs, class MyUnitigData must be declared as follows:
class MyUnitigData :
public CCDBG_Data_t<MyUnitigData> { ... };
...
ColoredCDBG<MyUnitigData> ccdbg;
An object of type MyUnitigData represents an instanciation of user data associated to one unitig of the graph. CCDBG_Data_t has one template parameter: the type of unitig data ("MyUnitigData"). Because CCDBG_Data_t is an abstract class, all the methods of the base class (CCDBG_Data_t) must be implemented in your wrapper (the derived class, aka MyUnitigData in this example). IMPORTANT: If you do not implement those methods, default ones that have no effects will be applied. Do not forget to implement copy and move constructors/destructors as well as copy and move assignment operators. An example of using such a structure is shown in snippets/test.cpp.
template<typename Unitig_data_t >
Join data of two unitigs which are going to be concatenated.
Specifically, if A is the reference unitig of the UnitigColorMap um_dest and B is the reference unitig of the UnitigColorMap um_src, then after the call to this function, unitigs A and B will be removed and a unitig C = AB will be added to the graph. The object calling this function represents the data to associate with the new unitig C = AB. If um_dest.strand = false, then the reverse-complement of A is going to be used in the concatenation. Reciprocally, if um_src.strand = false, then the reverse-complement of B is going to be used in the concatenation. The data of each unitig can be accessed through the method UnitigColorMap::getData(). The two unitigs A and B are guaranteed to be from the same graph.
- Parameters
-
um_dest | is a UnitigColorMap object representing a unitig (the reference sequence of the mapping) to which another unitig is going to be appended. The object calling this function represents the data associated with the reference unitig of um_dest. |
um_src | is a UnitigColorMap object representing a unitig (and its data) that will be appended at the end of the unitig represented by parameter um_dest. |
template<typename Unitig_data_t >
Extract data corresponding to a sub-unitig of a unitig A.
The extracted sub-unitig, called B in the following, is defined as a mapping to A given by the input UnitigColorMap object um_src. Hence, B = A[um_src.dist, um_src.dist + um_src.len + k - 1] or B = rev(A[um_src.dist, um_src.dist + um_src.len + k - 1]) if um_src.strand == false (B is reverse-complemented). After this function returns, unitig A is deleted from the graph and B is inserted in the graph (along with their data and colors) IF the input parameter last_extraction == true. The object calling this function represents the data associated with sub-unitig B.
- Parameters
-
uc_dest | is a constant pointer to a UnitigColors object representing the k-mer color sets of colored unitig B. If uc_dest == nullptr, no UnitigColors object will be associated with unitig B. |
um_src | is a UnitigColorMap object representing the mapping to a colored unitig A from which a new colored unitig B will be extracted, i.e, B = A[um_src.dist, um_src.dist + um_src.len + k - 1] or B = rev(A[um_src.dist, um_src.dist + um_src.len + k - 1]) if um_src.strand == false. |
last_extraction | is a boolean indicating if this is the last call to this function on the reference unitig A used for the mapping given by um_src. If last_extraction is true, the reference unitig A of um_src will be removed from the graph right after this function returns. Also, all unitigs B extracted from the reference unitig A, along with their data and colors, will be inserted in the graph. |