|
| DataAccessor (const uint8_t id=0) |
| Constructor (set up an empty DataAccessor).
|
|
void | clear (const UnitigColorMap< U > &um) |
| Clear the colors and data associated with a colored unitig. More...
|
|
const U * | getData (const const_UnitigColorMap< U > &um) const |
| Get the unitig data. More...
|
|
U * | getData (const UnitigColorMap< U > &um) const |
| Get the unitig data. More...
|
|
const UnitigColors * | getUnitigColors (const const_UnitigColorMap< U > &um) const |
| Get the colors of the reference unitig. More...
|
|
UnitigColors * | getUnitigColors (const UnitigColorMap< U > &um) const |
| Get the colors of the reference unitig. More...
|
|
UnitigColors | getSubUnitigColors (const const_UnitigColorMap< U > &um) const |
| Create a new UnitigColors object for a unitig B corresponding to a unitig mapping to a reference unitig A, i.e, B = A[um.dist..um.dist + um.len + k - 1] or B = rev(A[um.dist..um.dist + um.len + k - 1]) if um.strand == false. More...
|
|
vector< string > | getSubUnitigColorNames (const const_UnitigColorMap< U > &um) const |
| Obtain the name of the colors present on AT LEAST one k-mer of a unitig mapping. More...
|
|
void | concat (const UnitigColorMap< U > &um_dest, const UnitigColorMap< U > &um_src) |
| Join data and colors of two colored unitigs which are going to be concatenated. More...
|
|
void | merge (const UnitigColorMap< U > &um_dest, const const_UnitigColorMap< U > &um_src) |
| Merge the data and colors of a sub-unitig B to the data and colors of a sub-unitig A. More...
|
|
void | extract (const UnitigColorMap< U > &um_src, const bool last_extraction) |
| Extract data and colors corresponding to a sub-unitig of a unitig A. More...
|
|
string | serialize (const const_UnitigColorMap< U > &um_src) const |
| Serialize the data to a GFA-formatted string. More...
|
|
void | clear (const UnitigMap< DataAccessor< Unitig_data_t >, DataStorage< Unitig_data_t > > &um_dest) |
| Clear the data associated with a unitig. More...
|
|
void | concat (const UnitigMap< DataAccessor< Unitig_data_t >, DataStorage< Unitig_data_t > > &um_dest, const UnitigMap< DataAccessor< Unitig_data_t >, DataStorage< Unitig_data_t > > &um_src) |
| Join data of two unitigs which are going to be concatenated. More...
|
|
void | merge (const UnitigMap< DataAccessor< Unitig_data_t >, DataStorage< Unitig_data_t > > &um_dest, const const_UnitigMap< DataAccessor< Unitig_data_t >, DataStorage< Unitig_data_t > > &um_src) |
| Merge the data of a sub-unitig B to the data of a sub-unitig A. More...
|
|
void | extract (const UnitigMap< DataAccessor< Unitig_data_t >, DataStorage< Unitig_data_t > > &um_src, bool last_extraction) |
| Extract data corresponding to a sub-unitig of a unitig A. More...
|
|
string | serialize (const const_UnitigMap< DataAccessor< Unitig_data_t >, DataStorage< Unitig_data_t > > &um_src) const |
| Serialize the data to a GFA-formatted string. More...
|
|
template<typename Unitig_data_t = void>
class DataAccessor< Unitig_data_t >
Interface to access the colors and the data associated with a unitig of a ColoredCDBG.
The class as one template parameter: the type of data associated with the unitigs of the graph.
template<typename Unitig_data_t = void>
Join data and colors of two colored 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. 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.
- 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. |
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 = void>
Extract data and colors 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.
- Parameters
-
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. |