Debian Codegraph @

ext/bifrost/doc/doxygen/latex/classCDBG__Data__t.tex

raw
1 \hypertarget{classCDBG__Data__t}{}\section{C\+D\+B\+G\+\_\+\+Data\+\_\+t$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ Class Template Reference}
2 \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 $>$}}
3
4
5 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}.
6
7
8 \subsection*{Public Member Functions}
9 \begin{DoxyCompactItemize}
10 \item
11 void \hyperlink{classCDBG__Data__t_ad3ee42fef3155251e54886f3649f72a2}{clear} (const \hyperlink{classUnitigMap}{Unitig\+Map}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ \&um\+\_\+dest)
12 \begin{DoxyCompactList}\small\item\em Clear the data associated with a unitig. \end{DoxyCompactList}\item
13 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)
14 \begin{DoxyCompactList}\small\item\em Join data of two unitigs which are going to be concatenated. \end{DoxyCompactList}\item
15 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)
16 \begin{DoxyCompactList}\small\item\em Merge the data of a sub-\/unitig B to the data of a sub-\/unitig A. \end{DoxyCompactList}\item
17 void \hyperlink{classCDBG__Data__t_a2e78ea1698f48c521164b8294435f618}{extract} (const \hyperlink{classUnitigMap}{Unitig\+Map}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ \&um\+\_\+src, bool last\+\_\+extraction)
18 \begin{DoxyCompactList}\small\item\em Extract data corresponding to a sub-\/unitig of a unitig A. \end{DoxyCompactList}\item
19 string \hyperlink{classCDBG__Data__t_a4c6ec7ef1a4ca46bd643f59d25730945}{serialize} (const \hyperlink{CompactedDBG_8hpp_a631369597e56604279ba89a211c14fd0}{const\+\_\+\+Unitig\+Map}$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$ \&um\+\_\+src) const
20 \begin{DoxyCompactList}\small\item\em Serialize the data to a G\+F\+A-\/formatted string. \end{DoxyCompactList}\end{DoxyCompactItemize}
21
22
23 \subsection{Detailed Description}
24 \subsubsection*{template$<$typename Unitig\+\_\+data\+\_\+t, typename Graph\+\_\+data\+\_\+t = void$>$\newline
25 class C\+D\+B\+G\+\_\+\+Data\+\_\+t$<$ Unitig\+\_\+data\+\_\+t, Graph\+\_\+data\+\_\+t $>$}
26
27 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}.
28
29 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\+:
30 \begin{DoxyCode}
31 \textcolor{keyword}{class }MyUnitigData : \textcolor{keyword}{public} \hyperlink{classCDBG__Data__t}{CDBG\_Data\_t}<MyUnitigData, MyGraphData> \{ ... \};
32 ...
33 CompactedCDBG<MyUnitigData, MyGraphData> cdbg;
34 \end{DoxyCode}
35 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\+:
36 \begin{DoxyCode}
37 \textcolor{keyword}{class }MyUnitigData : \textcolor{keyword}{public} \hyperlink{classCDBG__Data__t}{CDBG\_Data\_t}<MyUnitigData> \{ ... \};
38 \textcolor{keyword}{class }MyUnitigData : \textcolor{keyword}{public} \hyperlink{classCDBG__Data__t}{CDBG\_Data\_t}<MyUnitigData, void> \{ ... \}; \textcolor{comment}{// Equivalent to previous
39 notation}
40 ...
41 CompactedCDBG<MyUnitigData> cdbg;
42 \end{DoxyCode}
43 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.
44
45 \subsection{Member Function Documentation}
46 \mbox{\Hypertarget{classCDBG__Data__t_ad3ee42fef3155251e54886f3649f72a2}\label{classCDBG__Data__t_ad3ee42fef3155251e54886f3649f72a2}}
47 \index{C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}!clear@{clear}}
48 \index{clear@{clear}!C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}}
49 \subsubsection{\texorpdfstring{clear()}{clear()}}
50 {\footnotesize\ttfamily template$<$typename Unitig\+\_\+data\+\_\+t, typename Graph\+\_\+data\+\_\+t = void$>$ \\
51 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]}}
52
53
54
55 Clear the data associated with a unitig.
56
57
58 \begin{DoxyParams}{Parameters}
59 {\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. \\
60 \hline
61 \end{DoxyParams}
62 \mbox{\Hypertarget{classCDBG__Data__t_a1d1eefcc5b100fbe000a5d70c4280aa3}\label{classCDBG__Data__t_a1d1eefcc5b100fbe000a5d70c4280aa3}}
63 \index{C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}!concat@{concat}}
64 \index{concat@{concat}!C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}}
65 \subsubsection{\texorpdfstring{concat()}{concat()}}
66 {\footnotesize\ttfamily template$<$typename Unitig\+\_\+data\+\_\+t, typename Graph\+\_\+data\+\_\+t = void$>$ \\
67 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]}}
68
69
70
71 Join data of two unitigs which are going to be concatenated.
72
73 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}.
74 \begin{DoxyParams}{Parameters}
75 {\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. \\
76 \hline
77 {\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. \\
78 \hline
79 \end{DoxyParams}
80 \mbox{\Hypertarget{classCDBG__Data__t_a2e78ea1698f48c521164b8294435f618}\label{classCDBG__Data__t_a2e78ea1698f48c521164b8294435f618}}
81 \index{C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}!extract@{extract}}
82 \index{extract@{extract}!C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}}
83 \subsubsection{\texorpdfstring{extract()}{extract()}}
84 {\footnotesize\ttfamily template$<$typename Unitig\+\_\+data\+\_\+t, typename Graph\+\_\+data\+\_\+t = void$>$ \\
85 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]}}
86
87
88
89 Extract data corresponding to a sub-\/unitig of a unitig A.
90
91 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.
92 \begin{DoxyParams}{Parameters}
93 {\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. \\
94 \hline
95 {\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. \\
96 \hline
97 \end{DoxyParams}
98 \mbox{\Hypertarget{classCDBG__Data__t_a474f0f1668ae99e7ca0ee071d1f6f237}\label{classCDBG__Data__t_a474f0f1668ae99e7ca0ee071d1f6f237}}
99 \index{C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}!merge@{merge}}
100 \index{merge@{merge}!C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}}
101 \subsubsection{\texorpdfstring{merge()}{merge()}}
102 {\footnotesize\ttfamily template$<$typename Unitig\+\_\+data\+\_\+t, typename Graph\+\_\+data\+\_\+t = void$>$ \\
103 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]}}
104
105
106
107 Merge the data of a sub-\/unitig B to the data of a sub-\/unitig A.
108
109 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}.
110 \begin{DoxyParams}{Parameters}
111 {\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. \\
112 \hline
113 {\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). \\
114 \hline
115 \end{DoxyParams}
116 \mbox{\Hypertarget{classCDBG__Data__t_a4c6ec7ef1a4ca46bd643f59d25730945}\label{classCDBG__Data__t_a4c6ec7ef1a4ca46bd643f59d25730945}}
117 \index{C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}!serialize@{serialize}}
118 \index{serialize@{serialize}!C\+D\+B\+G\+\_\+\+Data\+\_\+t@{C\+D\+B\+G\+\_\+\+Data\+\_\+t}}
119 \subsubsection{\texorpdfstring{serialize()}{serialize()}}
120 {\footnotesize\ttfamily template$<$typename Unitig\+\_\+data\+\_\+t, typename Graph\+\_\+data\+\_\+t = void$>$ \\
121 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]}}
122
123
124
125 Serialize the data to a G\+F\+A-\/formatted string.
126
127 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.
128 \begin{DoxyParams}{Parameters}
129 {\em um\+\_\+src} & is a const\+\_\+\+Unitig\+Map object representing the (reference) unitig to which the data to serialize is associated. \\
130 \hline
131 \end{DoxyParams}
132 \begin{DoxyReturn}{Returns}
133 a string which is the serialization of the data.
134 \end{DoxyReturn}
135
136
137 The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
138 \item
139 src/\hyperlink{CompactedDBG_8hpp}{Compacted\+D\+B\+G.\+hpp}\end{DoxyCompactItemize}