\hypertarget{classCDBG__Data__t}{}\section{C\+D\+B\+G\+\_\+\+Data\+\_\+t$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ Class Template Reference}
\label{classCDBG__Data__t}\index{C\+D\+B\+G\+\_\+\+Data\+\_\+t$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$@{C\+D\+B\+G\+\_\+\+Data\+\_\+t$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$}}


If data are to be associated with the unitigs of the compacted de Bruijn graph, those data must be wrapped into a class that inherits from the abstract class \hyperlink{classCDBG__Data__t}{C\+D\+B\+G\+\_\+\+Data\+\_\+t}.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{classCDBG__Data__t_ad3ee42fef3155251e54886f3649f72a2}{clear} (const \hyperlink{classUnitigMap}{Unitig\+Map}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ \&um\+\_\+dest)
\begin{DoxyCompactList}\small\item\em Clear the data associated with a unitig. \end{DoxyCompactList}\item 
void \hyperlink{classCDBG__Data__t_a1d1eefcc5b100fbe000a5d70c4280aa3}{concat} (const \hyperlink{classUnitigMap}{Unitig\+Map}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ \&um\+\_\+dest, const \hyperlink{classUnitigMap}{Unitig\+Map}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ \&um\+\_\+src)
\begin{DoxyCompactList}\small\item\em Join data of two unitigs which are going to be concatenated. \end{DoxyCompactList}\item 
void \hyperlink{classCDBG__Data__t_a474f0f1668ae99e7ca0ee071d1f6f237}{merge} (const \hyperlink{classUnitigMap}{Unitig\+Map}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ \&um\+\_\+dest, const \hyperlink{CompactedDBG_8hpp_a631369597e56604279ba89a211c14fd0}{const\+\_\+\+Unitig\+Map}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ \&um\+\_\+src)
\begin{DoxyCompactList}\small\item\em Merge the data of a sub-\/unitig B to the data of a sub-\/unitig A. \end{DoxyCompactList}\item 
void \hyperlink{classCDBG__Data__t_a2e78ea1698f48c521164b8294435f618}{extract} (const \hyperlink{classUnitigMap}{Unitig\+Map}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ \&um\+\_\+src, bool last\+\_\+extraction)
\begin{DoxyCompactList}\small\item\em Extract data corresponding to a sub-\/unitig of a unitig A. \end{DoxyCompactList}\item 
string \hyperlink{classCDBG__Data__t_a4c6ec7ef1a4ca46bd643f59d25730945}{serialize} (const \hyperlink{CompactedDBG_8hpp_a631369597e56604279ba89a211c14fd0}{const\+\_\+\+Unitig\+Map}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ \&um\+\_\+src) const
\begin{DoxyCompactList}\small\item\em Serialize the data to a G\+F\+A-\/formatted string. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename Unitig\+\_\+data\+\_\+t, typename Graph\+\_\+data\+\_\+t = void$>$\newline
class C\+D\+B\+G\+\_\+\+Data\+\_\+t$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$}

If data are to be associated with the unitigs of the compacted de Bruijn graph, those data must be wrapped into a class that inherits from the abstract class \hyperlink{classCDBG__Data__t}{C\+D\+B\+G\+\_\+\+Data\+\_\+t}. 

Otherwise it will not compile. To associate data of type \char`\"{}\+My\+Unitig\+Data\char`\"{} to unitigs, class My\+Unitig\+Data must be declared as follows\+: 
\begin{DoxyCode}
\textcolor{keyword}{class }MyUnitigData : \textcolor{keyword}{public} \hyperlink{classCDBG__Data__t}{CDBG\_Data\_t}<MyUnitigData, MyGraphData> \{ ... \};
...
CompactedCDBG<MyUnitigData, MyGraphData> cdbg;
\end{DoxyCode}
 An object of type My\+Unitig\+Data represents an instanciation of user data associated to one unitig of the graph. \hyperlink{classCDBG__Data__t}{C\+D\+B\+G\+\_\+\+Data\+\_\+t} has two template parameters\+: the type of unitig data (\char`\"{}\+My\+Unitig\+Data\char`\"{}) and the type of graph data (\char`\"{}\+My\+Graph\+Data\char`\"{}). Indeed, if class My\+Unitig\+Data is going to be used in combination with class My\+Graph\+Data for a \hyperlink{classCompactedDBG}{Compacted\+D\+BG}, My\+Unitig\+Data must \char`\"{}know\char`\"{} the type My\+Graph\+Data for the parameters of its (mandatory) functions. If no graph data is used, you do not have to specify the template parameter My\+Graph\+Data or you can void it\+: 
\begin{DoxyCode}
\textcolor{keyword}{class }MyUnitigData : \textcolor{keyword}{public} \hyperlink{classCDBG__Data__t}{CDBG\_Data\_t}<MyUnitigData> \{ ... \};
\textcolor{keyword}{class }MyUnitigData : \textcolor{keyword}{public} \hyperlink{classCDBG__Data__t}{CDBG\_Data\_t}<MyUnitigData, void> \{ ... \}; \textcolor{comment}{// Equivalent to previous
       notation}
...
CompactedCDBG<MyUnitigData> cdbg;
\end{DoxyCode}
 Because \hyperlink{classCDBG__Data__t}{C\+D\+B\+G\+\_\+\+Data\+\_\+t} is an abstract class, all the methods from the base class (\hyperlink{classCDBG__Data__t}{C\+D\+B\+G\+\_\+\+Data\+\_\+t}) must be implemented in your wrapper (the derived class, aka My\+Unitig\+Data in this example). I\+M\+P\+O\+R\+T\+A\+NT\+: If you do not implement those methods in your class, default ones that have no effect 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. 

\subsection{Member Function Documentation}
\mbox{\Hypertarget{classCDBG__Data__t_ad3ee42fef3155251e54886f3649f72a2}\label{classCDBG__Data__t_ad3ee42fef3155251e54886f3649f72a2}} 
\index{C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}!clear@{clear}}
\index{clear@{clear}!C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}}
\subsubsection{\texorpdfstring{clear()}{clear()}}
{\footnotesize\ttfamily template$<$typename Unitig\+\_\+data\+\_\+t, typename Graph\+\_\+data\+\_\+t = void$>$ \\
void \hyperlink{classCDBG__Data__t}{C\+D\+B\+G\+\_\+\+Data\+\_\+t}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$\+::clear (\begin{DoxyParamCaption}\item[{const \hyperlink{classUnitigMap}{Unitig\+Map}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ \&}]{um\+\_\+dest }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Clear the data associated with a unitig. 


\begin{DoxyParams}{Parameters}
{\em um\+\_\+dest} & is a \hyperlink{classUnitigMap}{Unitig\+Map} object representing a unitig (the reference sequence of um\+\_\+dest) for which the data must be cleared. The object calling this function represents the data associated with the reference unitig of um\+\_\+dest. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classCDBG__Data__t_a1d1eefcc5b100fbe000a5d70c4280aa3}\label{classCDBG__Data__t_a1d1eefcc5b100fbe000a5d70c4280aa3}} 
\index{C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}!concat@{concat}}
\index{concat@{concat}!C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}}
\subsubsection{\texorpdfstring{concat()}{concat()}}
{\footnotesize\ttfamily template$<$typename Unitig\+\_\+data\+\_\+t, typename Graph\+\_\+data\+\_\+t = void$>$ \\
void \hyperlink{classCDBG__Data__t}{C\+D\+B\+G\+\_\+\+Data\+\_\+t}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$\+::concat (\begin{DoxyParamCaption}\item[{const \hyperlink{classUnitigMap}{Unitig\+Map}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ \&}]{um\+\_\+dest,  }\item[{const \hyperlink{classUnitigMap}{Unitig\+Map}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ \&}]{um\+\_\+src }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Join data of two unitigs which are going to be concatenated. 

Specifically, if A is the reference unitig of the \hyperlink{classUnitigMap}{Unitig\+Map} um\+\_\+dest and B is the reference unitig of the \hyperlink{classUnitigMap}{Unitig\+Map} um\+\_\+src, then after this function returns, unitigs A amd B will be removed and a unitig C = AB will be added to the graph. The object calling this function represents the data associated 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 two unitigs A and B are guaranteed to be from the same graph. The data of each unitig can be accessed through the \hyperlink{classUnitigMap_a0c40fd1ba2df6af9a0c55b7963e41493}{Unitig\+Map\+::get\+Data}. 
\begin{DoxyParams}{Parameters}
{\em um\+\_\+dest} & is a \hyperlink{classUnitigMap}{Unitig\+Map} 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. \\
\hline
{\em um\+\_\+src} & is a \hyperlink{classUnitigMap}{Unitig\+Map} object representing a unitig (the reference sequence of the mapping) that will be appended at the end of the unitig represented by parameter um\+\_\+dest. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classCDBG__Data__t_a2e78ea1698f48c521164b8294435f618}\label{classCDBG__Data__t_a2e78ea1698f48c521164b8294435f618}} 
\index{C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}!extract@{extract}}
\index{extract@{extract}!C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}}
\subsubsection{\texorpdfstring{extract()}{extract()}}
{\footnotesize\ttfamily template$<$typename Unitig\+\_\+data\+\_\+t, typename Graph\+\_\+data\+\_\+t = void$>$ \\
void \hyperlink{classCDBG__Data__t}{C\+D\+B\+G\+\_\+\+Data\+\_\+t}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$\+::extract (\begin{DoxyParamCaption}\item[{const \hyperlink{classUnitigMap}{Unitig\+Map}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ \&}]{um\+\_\+src,  }\item[{bool}]{last\+\_\+extraction }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



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 \hyperlink{classUnitigMap}{Unitig\+Map} object um\+\_\+src. Hence, B = A\mbox{[}um\+\_\+src.\+dist, um\+\_\+src.\+dist + um\+\_\+src.\+len + k -\/ 1\mbox{]} or B = rev(A\mbox{[}um\+\_\+src.\+dist, um\+\_\+src.\+dist + um\+\_\+src.\+len + k -\/ 1\mbox{]}) if um\+\_\+src.\+strand == false (B is reverse-\/complemented). After the function returns, unitig A is deleted from the graph and B is inserted in the graph (along with their data) IF the input parameter last\+\_\+extraction == true. The object calling this function represents the data to associate with sub-\/unitig B. 
\begin{DoxyParams}{Parameters}
{\em um\+\_\+src} & is a \hyperlink{classUnitigMap}{Unitig\+Map} object representing the mapping to a unitig A from which a new unitig B will be extracted, i.\+e, B = A\mbox{[}um\+\_\+src.\+dist, um\+\_\+src.\+dist + um\+\_\+src.\+len + k -\/ 1\mbox{]} or B = rev(A\mbox{[}um\+\_\+src.\+dist, um\+\_\+src.\+dist + um\+\_\+src.\+len + k -\/ 1\mbox{]}) if um\+\_\+src.\+strand == false. \\
\hline
{\em last\+\_\+extraction} & is a boolean indicating if this is the last call to this function on the reference unitig 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, will be inserted in the graph. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classCDBG__Data__t_a474f0f1668ae99e7ca0ee071d1f6f237}\label{classCDBG__Data__t_a474f0f1668ae99e7ca0ee071d1f6f237}} 
\index{C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}!merge@{merge}}
\index{merge@{merge}!C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}}
\subsubsection{\texorpdfstring{merge()}{merge()}}
{\footnotesize\ttfamily template$<$typename Unitig\+\_\+data\+\_\+t, typename Graph\+\_\+data\+\_\+t = void$>$ \\
void \hyperlink{classCDBG__Data__t}{C\+D\+B\+G\+\_\+\+Data\+\_\+t}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$\+::merge (\begin{DoxyParamCaption}\item[{const \hyperlink{classUnitigMap}{Unitig\+Map}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ \&}]{um\+\_\+dest,  }\item[{const \hyperlink{CompactedDBG_8hpp_a631369597e56604279ba89a211c14fd0}{const\+\_\+\+Unitig\+Map}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ \&}]{um\+\_\+src }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Merge the data of a sub-\/unitig B to the data of a sub-\/unitig A. 

The object calling this function represents the data associated with the reference unitig of um\+\_\+dest. The two unitigs A and B are N\+OT guaranteed to be from the same graph. The data of each unitig can be accessed through the \hyperlink{classUnitigMap_a0c40fd1ba2df6af9a0c55b7963e41493}{Unitig\+Map\+::get\+Data}. 
\begin{DoxyParams}{Parameters}
{\em um\+\_\+dest} & is a \hyperlink{classUnitigMap}{Unitig\+Map} object representing a sub-\/unitig (the mapped sequence of the mapping) A. The object calling this function represents the data associated with the reference unitig of um\+\_\+dest. \\
\hline
{\em um\+\_\+src} & is a \hyperlink{classUnitigMap}{Unitig\+Map} object representing a sub-\/unitig (the mapped sequence of the mapping) for which the data must be merged with the data of sub-\/unitig B (given by parameter um\+\_\+dest). \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classCDBG__Data__t_a4c6ec7ef1a4ca46bd643f59d25730945}\label{classCDBG__Data__t_a4c6ec7ef1a4ca46bd643f59d25730945}} 
\index{C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}!serialize@{serialize}}
\index{serialize@{serialize}!C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}}
\subsubsection{\texorpdfstring{serialize()}{serialize()}}
{\footnotesize\ttfamily template$<$typename Unitig\+\_\+data\+\_\+t, typename Graph\+\_\+data\+\_\+t = void$>$ \\
string \hyperlink{classCDBG__Data__t}{C\+D\+B\+G\+\_\+\+Data\+\_\+t}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$\+::serialize (\begin{DoxyParamCaption}\item[{const \hyperlink{CompactedDBG_8hpp_a631369597e56604279ba89a211c14fd0}{const\+\_\+\+Unitig\+Map}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ \&}]{um\+\_\+src }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Serialize the data to a G\+F\+A-\/formatted string. 

This function is used when the graph is written to disk in G\+FA format. If the returned string is not empty, the string is appended as an optional field to the Segment line matching the unitig to which this data is associated. Note that it is your responsability to add G\+F\+A-\/compatible tags matching your data in the string. 
\begin{DoxyParams}{Parameters}
{\em um\+\_\+src} & is a const\+\_\+\+Unitig\+Map object representing the (reference) unitig to which the data to serialize is associated. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a string which is the serialization of the data. 
\end{DoxyReturn}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
src/\hyperlink{CompactedDBG_8hpp}{Compacted\+D\+B\+G.\+hpp}\end{DoxyCompactItemize}
