Showing
19 changed files
with
0 additions
and
3936 deletions
1 | -.vscode/* | ||
2 | .vscode | 1 | .vscode |
3 | 2 | ||
4 | -# LaTeX temporary files | ||
5 | -doc/*.toc | ||
6 | -doc/*.bbl | ||
7 | -doc/*.gz | ||
8 | -doc/*.log | ||
9 | -doc/*.aux | ||
10 | -doc/*.blg | ||
11 | -doc/*.fls | ||
12 | -doc/*.fdb_latexmk | ||
13 | - | ||
14 | # Docker installation temporary files | 3 | # Docker installation temporary files |
15 | eigen-eigen-323c052e1731 | 4 | eigen-eigen-323c052e1731 |
16 | cplex_installer_12.8_Student.bin | 5 | cplex_installer_12.8_Student.bin |
... | @@ -20,7 +9,6 @@ ViennaRNA-2.4.13 | ... | @@ -20,7 +9,6 @@ ViennaRNA-2.4.13 |
20 | 9 | ||
21 | # Compiled Object files | 10 | # Compiled Object files |
22 | obj/* | 11 | obj/* |
23 | -doc/*.pdf | ||
24 | data/modules/RIN/__pycache__ | 12 | data/modules/RIN/__pycache__ |
25 | 13 | ||
26 | # Executables | 14 | # Executables | ... | ... |
... | @@ -31,18 +31,6 @@ $(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.cpp $(INCLUDES) | ... | @@ -31,18 +31,6 @@ $(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.cpp $(INCLUDES) |
31 | $(CC) -c $(CFLAGS) $(CXXFLAGS) $< -o $@ | 31 | $(CC) -c $(CFLAGS) $(CXXFLAGS) $< -o $@ |
32 | @echo -e "\033[00;32mCompiled "$<".\033[00m" | 32 | @echo -e "\033[00;32mCompiled "$<".\033[00m" |
33 | 33 | ||
34 | -doc: mainpdf supppdf | ||
35 | - @echo -e "\033[00;32mLaTeX documentation rendered.\033[00m" | ||
36 | - | ||
37 | -mainpdf: doc/main_bioinformatics.tex doc/references.bib doc/bioinfo.cls doc/natbib.bst | ||
38 | - cd doc; pdflatex -synctex=1 -interaction=nonstopmode -file-line-error main_bioinformatics | ||
39 | - cd doc; bibtex main_bioinformatics | ||
40 | - cd doc; pdflatex -synctex=1 -interaction=nonstopmode -file-line-error main_bioinformatics | ||
41 | - cd doc; pdflatex -synctex=1 -interaction=nonstopmode -file-line-error main_bioinformatics | ||
42 | - | ||
43 | -supppdf: doc/supplementary_material.tex | ||
44 | - cd doc; pdflatex -synctex=1 -interaction=nonstopmode -file-line-error supplementary_material | ||
45 | - | ||
46 | .PHONY: all | 34 | .PHONY: all |
47 | all: $(BINDIR)/$(TARGET) doc | 35 | all: $(BINDIR)/$(TARGET) doc |
48 | 36 | ... | ... |
doc/Benchmark_unconstrained.jpg
deleted
100644 → 0
207 KB
doc/Nmotifs.jpg
deleted
100644 → 0
66.7 KB
doc/Nsol.jpg
deleted
100644 → 0
39.3 KB
doc/OUP_First_SBk_Bot_8401.eps
deleted
100644 → 0
No preview for this file type
doc/algorithm2e.sty
deleted
100644 → 0
1 | -% algorithm2e.sty --- style file for algorithms | ||
2 | -%% Copyright 1996-2005 Christophe Fiorio | ||
3 | -% | ||
4 | -% This program may be distributed and/or modified under the | ||
5 | -% conditions of the LaTeX Project Public License, either version 1.2 | ||
6 | -% of this license or (at your option) any later version. | ||
7 | -% The latest version of this license is in | ||
8 | -% http://www.latex-project.org/lppl.txt | ||
9 | -% and version 1.2 or later is part of all distributions of LaTeX | ||
10 | -% version 1999/12/01 or later. | ||
11 | -% | ||
12 | -% This program consists of the files algorithm2e.sty and algorithm2e.tex | ||
13 | -% | ||
14 | -% Report bugs and comments to: | ||
15 | -% fiorio@lirmm.fr | ||
16 | -% | ||
17 | -% $Id: algorithm2e.sty,v 3.9 2005/10/04 12:34:52 fiorio Exp $ | ||
18 | -% | ||
19 | -% PACKAGES REQUIRED: | ||
20 | -% | ||
21 | -% - float (in contrib/supported/float) | ||
22 | -% - ifthen (in base) | ||
23 | -% - xspace (in packages/tools) | ||
24 | -% | ||
25 | -%%%%%%%%%%%%%%% Release 3.9 | ||
26 | -% | ||
27 | -% History: | ||
28 | -% | ||
29 | -% - October 04 2005 - revision 3.9 - | ||
30 | -% * ADD: - \setalcaphskip command which set the horizontal skip before Algorithm: in caption when | ||
31 | -% used in ruled algorithm. | ||
32 | -% * ADD: - SetAlgoInsideSkip command which allows to add an extra vertical space before and after | ||
33 | -% the core of the algorithm (ie: \SetAlgoInsideSkip{bigskip}) | ||
34 | -% * CHANGE: - caption, when used with figure option, is no more controlled by algorithm2e package | ||
35 | -% and so follows the exact behaviour of figures. The drawback is that you cannot change | ||
36 | -% the typo with AlTitleFnt or CapFnt. The avantage is that if you use caption package, | ||
37 | -% it works. | ||
38 | -% * FIX: - problem with numbering line and pdflatex | ||
39 | -% * FIX: - error when algorithm2e package was used with beamer and listings together | ||
40 | -% - February 12 2005 - revision 3.8 - | ||
41 | -% * FIX: - extra line with noend option. | ||
42 | -% - February 10 2005 - revision 3.7 - | ||
43 | -% * ADD: - sidecomment: different macros allowing to put text right after code | ||
44 | -% on the same line. They are defined in the same time comment macros | ||
45 | -% are defined with a star after the macro name. By default comments | ||
46 | -% are right justified but this can be change with appropriate option | ||
47 | -% in the macro. Ex: | ||
48 | -% . default: \tcc*{side comment} | ||
49 | -% . same as previous: \tcc*[r]{side comment} | ||
50 | -% . left justify: \tcc*[l]{side comment} | ||
51 | -% . here: \tcc*[h]{side comment} don't put the end of line mark before | ||
52 | -% comment (; by default) and don't end the line. | ||
53 | -% . flushed: \tcc*[f]{side comment} same as the precedent but right | ||
54 | -% justified | ||
55 | -% * ADD: - scright OPTION (default): right justified side comments (side comments | ||
56 | -% are flushed to the righr) | ||
57 | -% * ADD: - scleft OPTION: left justified side comments (side comments are | ||
58 | -% put right after the code line) | ||
59 | -% * ADD: - \SetSideCommentLeft acts as scleft option | ||
60 | -% * ADD: - \SetSideCommentRight acts as scright option | ||
61 | -% * ADD: - block like macro side text: all macro defining a block allows now | ||
62 | -% to put text right after key words by putting text into (). Done to | ||
63 | -% be used with sidecomment macros, but all text can be used. Ex: | ||
64 | -% \eIf(\tcc*[f]{then comment}){test}{then text}(else side text){else text} | ||
65 | -% * ADD: - fillcomment OPTION (default): end mark of comment is flushed to the | ||
66 | -% right so comments fill all the width of text | ||
67 | -% * ADD: - nofillcomment OPTION: end mark of comment is put right after the | ||
68 | -% comment | ||
69 | -% * ADD: - \SetNoFillComment acts as nofillcomment option. | ||
70 | -% * ADD: - \SetFillComment acts as fillcomment option. | ||
71 | -% * ADD: - dotocloa OPTION which adds an entry in the toc for the list of | ||
72 | -% algorithms. This option load package tocbibind if not already done | ||
73 | -% and so list of figures and list of tables are also added in the toc. | ||
74 | -% If you want to control which ones of the lists will be added in the | ||
75 | -% toc, please load package tocbibind before package algorithm and give | ||
76 | -% it the options you want. | ||
77 | -% * FIX: - vertical spacing for uif macro with noend option | ||
78 | -% * FIX: - all the compatibility problems between caption and other packages | ||
79 | -% * FIX: - typographical differences between list of algorithms and other lists | ||
80 | -% when in report or book | ||
81 | -% | ||
82 | -% - January 24 2005 - revision 3.6 - | ||
83 | -% * FIX: - vertical spacing and space characters at the beginning or end of | ||
84 | -% comments. | ||
85 | -% line numbers of comments not in the nlsty. | ||
86 | -% Thanks to Arnaud Giersch for his comments and suggestions. | ||
87 | -% * FIX: - Set*Sty macro: the styles defined was not protected and was modified | ||
88 | -% by surrounding context. For example KwTo in a \For{}{} was in bold AND | ||
89 | -% italic instead of just in bold. | ||
90 | -% * FIX: - line number misplacement after \Indp | ||
91 | -% | ||
92 | -% - January 21 2005 - revision 3.5 - | ||
93 | -% * ADD: - hidden numbering of the lines. Lines are auto-numbered but numbers | ||
94 | -% are shown only on lines you specify: | ||
95 | -% * linesnumberedhidden option or \linesnumberedhidden macro activate | ||
96 | -% this functionnality. | ||
97 | -% * \showln and \showlnlabel{lab} macros make the number visible on | ||
98 | -% the line. \showlnlabel{lab} allows to set a label for this line. | ||
99 | -% Thanks to Samson de Jager who makes this suggestion and provides the | ||
100 | -% macros. | ||
101 | -% * ADD: - \AlCapFnt and \SetAlCapFnt which allow to have a different font for | ||
102 | -% caption. Works like \AlFnt and \SetAlFnt and by default is the same. | ||
103 | -% * ADD: - \AlCapSkip skip length. This vertical space is added before caption | ||
104 | -% in plain ou boxed mode. It allows to change distance between text | ||
105 | -% and caption. | ||
106 | -% * FIX: - caption compatible with IEEEtran class. | ||
107 | -% * FIX: - some vertical spacing error with \uIf macros (Thanks to Arnaud Giersch) | ||
108 | -% * FIX: - Procedure and Function: lines are also numbered like algorithms | ||
109 | -% * FIX: - CommentSty was not used for Comments | ||
110 | -% | ||
111 | -% - January 10 2005 - revision 3.4 - | ||
112 | -% * FIX: - caption compatible with new release of Beamer class. | ||
113 | -% | ||
114 | -% - June 16 2004 - revision 3.3 - | ||
115 | -% * FIX: - Hyperlink references of Hyperref package works now if compiled with pdflatex | ||
116 | -% and [naturalnames] option of hyperref package is used. | ||
117 | -% * FIX: - algorithm[H] had problem in an list environment - corrected | ||
118 | -% * FIX: - interline was not so regular in nested blocks - corrected | ||
119 | -% * ADD - \Setvlineskip macro which set the vertical skip after the little horizontal | ||
120 | -% rule which closes a block in Vlined mode. By default 0.8ex | ||
121 | -% | ||
122 | -% - June 11 2004 - revision 3.2 - AUTO NUMBERING LINES !!! | ||
123 | -% * ADD: auto numbering of the lines (the so asked and so long awaiting feature) | ||
124 | -% this feature is managed by 3 options and 3 commands: | ||
125 | -% - linesnumbered option: lines of the algo are numbered except for comments and | ||
126 | -% input/output (KwInput and KwInOut) | ||
127 | -% - commentsnumbered option: makes comments be numbered | ||
128 | -% - inoutnumbered option: makes data input/output be numbered | ||
129 | -% - \nllabel{lab} labels the line so you can cite with \ref{lab} | ||
130 | -% - \linesnumbered make the following algorithms having auto-numbered lines | ||
131 | -% - \linesnotnumbered make the following algorithms having no auto-numbered lines | ||
132 | -% * Change: algo2e option renames listofalgorithm in listofalgorithme | ||
133 | -% * FIX: new solution for compatibility with color package, more robust and not tricky. | ||
134 | -% Many thanks to David Carlisle for his advices | ||
135 | -% | ||
136 | -% - June 09 2004 - revision 3.1 - | ||
137 | -% * Change: \SetKwSwitch command defines an additionnal | ||
138 | -% macro \uCase and \Case prints end | ||
139 | -% * Change: now macros SetKw* do a renewcommand if the | ||
140 | -% keyword is already defined. So you can redefine | ||
141 | -% default definition at your own convenience or | ||
142 | -% change your definition without introducing a | ||
143 | -% new macro and changing your text. | ||
144 | -% * ADD: new macro \SetKwIF which do \SetKwIf and | ||
145 | -% \SetKwIfElseIf.The following default definition has been added: | ||
146 | -% \SetKwIF{If}{ElseIf}{Else}{if}{then}{else if}{else}{endif} | ||
147 | -% and so you get the macros; | ||
148 | -% \If \eIf \lIf \uIf \ElseIf \uElseIf \lElseIf \Else | ||
149 | -% \uElse \lElse | ||
150 | -% * ADD: new macro \SetAlgoSkip which allow to fix the | ||
151 | -% vertical skip before and after the algorithms. | ||
152 | -% Default is smallskip, do \SetAlgoSkip{} if you | ||
153 | -% don't want an extra space or \SetAlgoSkip{medskip} | ||
154 | -% or \SetAlgoSkip{bigskip} if you want bigger space. | ||
155 | -% * ADD: macro \SetKwIf defines in addition a new macro | ||
156 | -% \uElse (depending on wat name you | ||
157 | -% have given in #2 arg). | ||
158 | -% * ADD: macro \SetKwIfElseIf defines in addition a new macro | ||
159 | -% \uElse and \ugElseIf (depending on what name you | ||
160 | -% have given in #2 and #3 arg). | ||
161 | -% * Change: baseline of algorithm is now top, so two | ||
162 | -% algorithms can be put side by side. | ||
163 | -% * FIX: Compatibility with color package solved. The problem | ||
164 | -% was due to a redefinition of standard macros by color package | ||
165 | -% This solves compatibility problem with other packages | ||
166 | -% as pstcol or colortbl. | ||
167 | -% (notified by Dirk Fressmann, Antti Tarvainen and Koby Crammer) | ||
168 | -% * Fix: extra little shift to the right with boxed style | ||
169 | -% algorithm removed (notified by P. Tanovski) | ||
170 | -% * Fix: algoln option was buggy (notified bye Jiaying Shen) | ||
171 | -% * Fix: german and portuges option didn't work due to bad | ||
172 | -% typo (notified by Martin Sievers, Thorsten Vitt | ||
173 | -% and Jeronimo Pellegrini) | ||
174 | -% | ||
175 | -% - February 13 2004 - revision 3.0 - | ||
176 | -% * Major revision which makes the package independent from | ||
177 | -% float.sty, so now | ||
178 | -% - algorithm* works better, in particular can be used in | ||
179 | -% multicols environments | ||
180 | -% - (known bug corrected) | ||
181 | -% [H] works now for all sort of environment but is | ||
182 | -% handled differently for classic environment and star | ||
183 | -% environment (algorithm, figure, procedure and | ||
184 | -% function). For star environment, H acts like for | ||
185 | -% classical figure environment, so it doesn't stay here | ||
186 | -% absolutely. | ||
187 | -% - (known bug corrected) | ||
188 | -% you can use now floatflt package with algorithm | ||
189 | -% package and even with figure option. Beware that if | ||
190 | -% you want to put an algorithm inside a floatingfigure, | ||
191 | -% it cannot be floating, so [H] is required and then | ||
192 | -% figure option should not be used, since standard | ||
193 | -% figure[H] are still floating with LaTeX. | ||
194 | -% * boxruled: a new style added. Possible now since no | ||
195 | -% style no more defined by the float package. | ||
196 | -% * nocaptionofalgo: dosen't print Algorithm #: in the | ||
197 | -% caption for algorithm in ruled or algoruled style. | ||
198 | -% note: this is just documentation of a macro which was | ||
199 | -% already in the package. | ||
200 | -% - December 14 2003 - revision 2.52 - | ||
201 | -% * output message shorter | ||
202 | -% * french keyword macro \PourTous was missing for | ||
203 | -% longend option, it has been added. | ||
204 | -% * TitleofAlgo prints Function or Procedure in | ||
205 | -% corresponding environments. | ||
206 | -% | ||
207 | -% - October 27 2003 - revision 2.51 - Revision submitted to CTAN archive | ||
208 | -% * correction of a minor which make caption in procedure | ||
209 | -% and function to be blanck with pdfscreen package | ||
210 | -% (thanks to Joel Gossens for the notification) | ||
211 | -% * add two internal definition to avoid some errors when | ||
212 | -% used with Hyperref package (Hyperref package need to | ||
213 | -% define new counter macro from existing ones, and | ||
214 | -% don't do it for algorithm2e package, so we do it) | ||
215 | -% | ||
216 | -% - October 17 2003 - revision 2.50 - first revision for CTAN archive | ||
217 | -% | ||
218 | -% * add \AlFnt and \SetAlFnt{font} macros: | ||
219 | -% \AlFnt is used at the beginning of the caption and the | ||
220 | -% body of algorithm in order to define the fonts used | ||
221 | -% for typesetting algorithms. You can use it elsewhere | ||
222 | -% you want to typeset text as algorithm. For example | ||
223 | -% you can do \SetAlFnt{\small\sf} to have algorithms | ||
224 | -% typeset in small sf font. Default is nothing so | ||
225 | -% algorithm is typeset as the text of the document. | ||
226 | -% * add \AlTitleFnt{text} and \SetAlTitleFnt{font} macros: | ||
227 | -% The {Algorithm: } in the caption is typeset with | ||
228 | -% \AlTitleFnt{Algorithm:}. You can use it to have text | ||
229 | -% typeset as {Algorithm:} of captions. Default is | ||
230 | -% textbf. | ||
231 | -% Default can be redefined by \SetAlTitleFnt{font}. | ||
232 | -% * add CommentSty typo for text comment. | ||
233 | -% * add some compatibility with hyperref package (still | ||
234 | -% an error on multiply defined refs but pdf correctly | ||
235 | -% generated) | ||
236 | -% * flush text to left in order to have correct | ||
237 | -% indentation even with class as amsart which center | ||
238 | -% all figures | ||
239 | -% * add german, portugues and czech options for title of | ||
240 | -% algorithms and typo. | ||
241 | -% * add portuguese translation of predefined keywords | ||
242 | -% * add czech translation of some predefined keywords | ||
243 | -% | ||
244 | -% - December 23 2002 - revision 2.40 | ||
245 | -% * add some french keyword missing | ||
246 | -% * add function* and procedure* environment like | ||
247 | -% algorithme* environment: print in one column even | ||
248 | -% if twocolumn option is specified for the document. | ||
249 | -% * add a new macro \SetKwComment to define macro which | ||
250 | -% writes comments in the text. First argument is the | ||
251 | -% name of the macro, second is the text put before the | ||
252 | -% comment, third is the text put at the end of the | ||
253 | -% comment.Default are \tcc and \tcp | ||
254 | -% * add new options to change the way algo are numbered: | ||
255 | -% [algopart] algo are numbered within part (counter must exist) | ||
256 | -% [algochapter] algo are numbered within chapter | ||
257 | -% [algosection] algo are numbered within section | ||
258 | -% | ||
259 | -% - March 27 2002 - revision 2.39 | ||
260 | -% * Gilles Geeraerts: added the \SetKwIfElseIf to manage | ||
261 | -% if (c) | ||
262 | -% i; | ||
263 | -% else if (c) | ||
264 | -% i; | ||
265 | -% ... | ||
266 | -% else | ||
267 | -% i; | ||
268 | -% end | ||
269 | -% * Also added \gIf \gElsIf \gElse. | ||
270 | -% | ||
271 | -% - January 02 2001 - revision 2.38 | ||
272 | -% * bugs related to the caption in procedure and function | ||
273 | -% environment are corrected. | ||
274 | -% * bug related to option noend (extra vertical space added | ||
275 | -% after block command as If or For) is corrected. | ||
276 | -% * czech option language added (thanks to Libor Bus: l.bus@sh.cvut.cz). | ||
277 | -% | ||
278 | -% - October 16 2000 - revision 2.37 | ||
279 | -% * option algo2e added: change the name of environment | ||
280 | -% algorithm into algorithm2e. So allow to use the package | ||
281 | -% with some journal style which already define an algorithm | ||
282 | -% environment. | ||
283 | -% | ||
284 | -% - September 13 2000 - revision 2.36 | ||
285 | -% * option slide added: require package color | ||
286 | -% * Hack for slide class in order to have correct | ||
287 | -% margins | ||
288 | -% | ||
289 | -% - November 25 1999 - revision 2.35 | ||
290 | -% * revision number match RCS number | ||
291 | -% * Thanks to David A. Bader, a new option is added: | ||
292 | -% noend: no end keywords are printed. | ||
293 | -% | ||
294 | -% - November 19 1999 - revision 2.32 | ||
295 | -% * minor bug on longend option corrected. | ||
296 | -% | ||
297 | -% - August 26 1999 - revision 2.31 | ||
298 | -% * add an option : figure | ||
299 | -% this option makes algorithms be figure and so are numbered | ||
300 | -% as figures, have Figure as caption and are put in | ||
301 | -% the \listoffigures | ||
302 | -% | ||
303 | -% - January 21 1999 - revision 2.3 beta | ||
304 | -% add 2 new environments: procedure and function. | ||
305 | -% These environments works like algorithm environment but: | ||
306 | -% - the ruled (or algoruled) style is imperative. | ||
307 | -% - the caption now writes Procedure name.... | ||
308 | -% - the syntax of the \caption command is restricted as | ||
309 | -% follow: you MUST put a name followed by 2 braces like | ||
310 | -% this ``()''. You can put arguments inside the braces and | ||
311 | -% text after. If no argument is given, the braces will be | ||
312 | -% removed in the title. | ||
313 | -% - label now puts the name (the text before the braces in the | ||
314 | -% caption) of the procedure or function as reference (not | ||
315 | -% the number like a classic algorithm environment). | ||
316 | -% There are also two new styles : ProcNameSty and | ||
317 | -% ProcArgSty. These style are by default the same as FuncSty | ||
318 | -% and ArgSty but are used in the caption of a procedure or a | ||
319 | -% function. | ||
320 | -% | ||
321 | -% - November 28 1996 - revision 2.22 | ||
322 | -% add a new macro \SetKwInParam{arg1}{arg2}{arg3}: | ||
323 | -% it defines a macro \arg1{name}{arg} which prints name in keyword | ||
324 | -% style followed byt arg surrounded by arg2 and arg3. The main | ||
325 | -% application is to a function working as \SetKwInput to be used | ||
326 | -% in the head of the algorithm. For example | ||
327 | -% \SetKwInParam{Func}{(}{)} allows | ||
328 | -% \Func{functionname}{list of arguments} which prints: | ||
329 | -% \KwSty{functioname(}list of arguments\KwSty{)} | ||
330 | -% | ||
331 | -% | ||
332 | -% - November 27 1996 - revision 2.21 : | ||
333 | -% minor bug in length of InOut boxes fixed. | ||
334 | -% add algorithm* environment. | ||
335 | -% | ||
336 | -% - July 12 1996 - revision 2.2 : \SetArg and \SetKwArg macros removed. | ||
337 | -% | ||
338 | -% \SetArg has been removed since it never has been | ||
339 | -% documented. | ||
340 | -% \SetKwArg has been removed since \SetKw can now | ||
341 | -% take an argument in order to be consistent with | ||
342 | -% \SetKwData and \SetKwFunction macros. | ||
343 | -% | ||
344 | -% - July 04 1996 - revision 2.1 : still more LaTeX2e! Minor compatibility break | ||
345 | -% | ||
346 | -% Macros use now \newcommand instead of \def, use of \setlength, | ||
347 | -% \newsavebox, ... and other LaTeX2e specific stuff. | ||
348 | -% The compatibility break: | ||
349 | -% - \SetData becomes \SetKwData to be more consistent. So the old | ||
350 | -% \SetKwData becomes \SetKwInput | ||
351 | -% - old macros \titleofalgo, \Freetitleofalgo and \freetitleofalgo | ||
352 | -% from LaTeX209 version which did print a warning message and call | ||
353 | -% \Titleofalgo in version 2.0 are now removed! | ||
354 | -% | ||
355 | -% - March 13 1996 - revision 2.0: first official major revision. | ||
356 | -% | ||
357 | -% | ||
358 | -%%%%%%%%%%%%%% | ||
359 | -% | ||
360 | -% Known bugs: | ||
361 | -% ----------- | ||
362 | -% - no more known bugs... all are corrected! | ||
363 | -% | ||
364 | -%%%%%%%%%%%%%% | ||
365 | -% | ||
366 | -% Package options: | ||
367 | -% --------------- | ||
368 | -% - french, english, german, portuguese, czech : for the name of the algorithm, e.g. | ||
369 | -% - boxed, boxruled, ruled, algoruled, plain : layout of the algorithm | ||
370 | -% - algo2e : environment is algorithm2e instead of algorithms | ||
371 | -% and \listofalgorithmes instead of \listofalgorithms | ||
372 | -% - slide : to use when making slides | ||
373 | -% - noline,lined,vlined : how block are designed. | ||
374 | -% - linesnumbered : auto numbering of the algorithm's lines | ||
375 | -% - algopart,algochapter,algosection : algo numbering within part, chapter or section | ||
376 | -% - titlenumbered,titlenotnumbered : numbering of title set by \Titleofalgo | ||
377 | -% - figure : algorithms are figures, numbered as figures, and put in the list of figures. | ||
378 | -% - resetcount, noresetcount : start value of line numbers. | ||
379 | -% - algonl : line numbers preceded by algo number | ||
380 | -% - shortend, longend, noend : short or long end keyword as endif for e.g. | ||
381 | -% | ||
382 | -% defaults are; english,plain,resetcount,titlenotnumbered | ||
383 | -% | ||
384 | -%%%%%%%%%%%%%% | ||
385 | -% | ||
386 | -% Short summary | ||
387 | -% ------------- | ||
388 | -% | ||
389 | -% algorithm is an environment for writing algorithm in LaTeX2e | ||
390 | -% It provide macros that allow you to create differents | ||
391 | -% sorts of key words, therefore a set of predefined key word | ||
392 | -% is gived. | ||
393 | -% | ||
394 | -% IT should be used as follows | ||
395 | -% | ||
396 | -% \begin{algorithm} | ||
397 | -% ... | ||
398 | -% ... | ||
399 | -% \end{algorithm} | ||
400 | -% | ||
401 | -% | ||
402 | -% IMPORTANT : each line MUST end with \; | ||
403 | -% | ||
404 | -% Note that if you define macros outside algorithm environment they | ||
405 | -% are avaible in all the document and particulary you can use then | ||
406 | -% inside all algorithms without re-define them. | ||
407 | -% | ||
408 | -% an example: | ||
409 | -% | ||
410 | -% \begin{algorithm}[H] | ||
411 | -% \SetLine | ||
412 | -% \AlgData{this text} | ||
413 | -% \AlgResult{how to write algorithm with \LaTeX2e } | ||
414 | -% | ||
415 | -% initialization\; | ||
416 | -% \While{not at end of this document}{ | ||
417 | -% read current section\; | ||
418 | -% \eIf{understand}{ | ||
419 | -% go to next section\; | ||
420 | -% current section becomes this one\; | ||
421 | -% }{ | ||
422 | -% go back to the beginning of current section\; | ||
423 | -% } | ||
424 | -% } | ||
425 | -% \caption{How to write algorithm} | ||
426 | -% \end{algorithm} | ||
427 | -% | ||
428 | -% | ||
429 | -%%%%%%%%%%%%%% predefined english keywords | ||
430 | -% | ||
431 | -% \AlgData{input} | ||
432 | -% \AlgResult{output} | ||
433 | -% \KwIn{input} | ||
434 | -% \KwOut{output} | ||
435 | -% \KwData{input} | ||
436 | -% \KwResult{output} | ||
437 | -% \Ret{[value]} | ||
438 | -% \KwTo % a simple keyword | ||
439 | -% \Begin{block inside} | ||
440 | -% \If{condition}{Then block} % in a block | ||
441 | -% \uIf{condition}{Then block} % in a block unended | ||
442 | -% \Else{inside Else} % in a block | ||
443 | -% \eIf{condition}{Then Block}{Else block} % in blocks | ||
444 | -% \lIf{condition}{Else text} % on the same line | ||
445 | -% \lElse{Else text} % on the same line | ||
446 | -% \Switch{Condition}{Switch block} | ||
447 | -% \Case{a case}{case block} % in a block | ||
448 | -% \lCase{a case}{case text} % on the same line | ||
449 | -% \Other{otherwise block} % in a block | ||
450 | -% \lOther{otherwise block} % on the same line | ||
451 | -% \For{condition}{text loop} % in a block | ||
452 | -% \lFor{condition}{text} % on the same line | ||
453 | -% \ForEach{condition}{text loop} % in a block | ||
454 | -% \lForEach{condition}{text} % on the same line | ||
455 | -% \Repeat{End condition}{text loop} % in a block | ||
456 | -% \lRepeat{condition}{text} % on the same line | ||
457 | -% \While{condition}{text loop} % in a block | ||
458 | -% \lWhile{condition}{text loop} % on the same line | ||
459 | -% | ||
460 | -% | ||
461 | -%%%%%%%%%%%%%% predefined french keywords | ||
462 | -% | ||
463 | -% \AlgDonnees{input} | ||
464 | -% \AlgRes{input} | ||
465 | -% \Donnees{input} | ||
466 | -% \Res{input} | ||
467 | -% \Retour[valeur]} | ||
468 | -% \Deb{block inside} | ||
469 | -% \KwA % un mot clef simple | ||
470 | -% \Si{condition}{Bloc du Alors} % Dans un bloc | ||
471 | -% \uSi{condition}{Bloc du Alors} % Dans un bloc non termine | ||
472 | -% \eSi{condition}{Bloc du Alors}{Bloc du Sinon} % Dans un bloc | ||
473 | -% \lSi{condition}{texte du Alors} % sur la meme ligne | ||
474 | -% \lSinon{texte du Sinon} % sur la meme ligne | ||
475 | -% \Suivant{Condition}{Bloc de l'instruction} | ||
476 | -% \Cas{cas}{Bloc de ce cas} % Dans un bloc | ||
477 | -% \lCas{cas}{Bloc de ce cas} % sur la meme ligne | ||
478 | -% \Autres{Bloc de l'alternative} % Dans un bloc | ||
479 | -% \lAutres{Bloc de l'alternative} % sur la meme ligne | ||
480 | -% \Pour{condition}{texte de la boucle} % Dans un bloc | ||
481 | -% \lPour{condition}{texte} % sur la meme ligne | ||
482 | -% \PourCh{condition}{texte de la boucle} % Dans un bloc | ||
483 | -% \lPourCh{condition}{texte} % sur la meme ligne | ||
484 | -% \Repeter{End condition}{texte de la boucle} % Dans un bloc | ||
485 | -% \lRepeter{condition}{texte} % sur la meme ligne | ||
486 | -% \Tq{condition}{texte de la boucle} % Dans un bloc | ||
487 | -% \lTq{condition}{texte de la boucle} % sur la meme ligne | ||
488 | -% | ||
489 | -% | ||
490 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
491 | -% | ||
492 | -% for more complete informations you can see algorithm2e.tex | ||
493 | -% | ||
494 | -% | ||
495 | -%%%%%%%%%%%%%%%%%%%%%%%% Identification Part %%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
496 | -% | ||
497 | -\NeedsTeXFormat{LaTeX2e}[1994/12/01] | ||
498 | -% | ||
499 | -\ProvidesPackage{algorithm2e}[2005/10/04 v3.9 algorithms environments] | ||
500 | -% | ||
501 | -% | ||
502 | -%%%%%%%%%%%%%%%%%%%%%%%%%%% Initial Code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
503 | -% | ||
504 | -\@makeother\*% some package redefined it as a letter (as color.sty) | ||
505 | -% | ||
506 | -% definition of commands which can be redefined in options of the package. | ||
507 | -% | ||
508 | -\newcounter{AlgoLine} | ||
509 | -\setcounter{AlgoLine}{0} | ||
510 | -% | ||
511 | -\newcommand{\listalgorithmcfname}{} | ||
512 | -\newcommand{\algorithmcfname}{} | ||
513 | -\newcommand{\algocf@typo}{} | ||
514 | -\newcommand{\@algocf@procname}{} | ||
515 | -\newcommand{\@algocf@funcname}{} | ||
516 | -\newcommand{\@algocf@titleofalgoname}{\algorithmcfname} | ||
517 | -\newcommand{\@algocf@algotitleofalgo}{% | ||
518 | - \renewcommand{\@algocf@titleofalgoname}{\algorithmcfname}} | ||
519 | -\newcommand{\@algocf@proctitleofalgo}{% | ||
520 | - \renewcommand{\@algocf@titleofalgoname}{\algocf@procname}} | ||
521 | -% | ||
522 | -\newcommand{\algocf@style}{plain} | ||
523 | -\newcommand{\@ResetCounterIfNeeded}{} | ||
524 | -\newcommand{\@titleprefix}{} | ||
525 | -% | ||
526 | -\newcommand{\algocf@numbering}[1]{\newcommand{\algocf@within}{#1}} | ||
527 | -% | ||
528 | -\newcommand{\defaultsmacros@algo}{\algocf@defaults@shortend} | ||
529 | -% | ||
530 | -\newcommand{\algocf@list}{loa} | ||
531 | -\newcommand{\algocf@float}{algocf} | ||
532 | -% | ||
533 | -\newcommand{\algocf@envname}{algorithm} | ||
534 | -\newcommand{\algocf@listofalgorithms}{listofalgorithms} | ||
535 | -% | ||
536 | -% | ||
537 | -%%%%%%%%%%%%%%%%%%%%%% Declaration of Options %%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
538 | -% | ||
539 | -\RequirePackage{ifthen} | ||
540 | -% | ||
541 | -\DeclareOption{algo2e}{% | ||
542 | - \renewcommand{\algocf@envname}{algorithm2e} | ||
543 | - \renewcommand{\algocf@listofalgorithms}{listofalgorithmes} | ||
544 | -} | ||
545 | -% | ||
546 | -\newboolean{algocf@slide}\setboolean{algocf@slide}{false} | ||
547 | -\DeclareOption{slide}{% | ||
548 | - \setboolean{algocf@slide}{true}% | ||
549 | -} | ||
550 | -% | ||
551 | -\DeclareOption{figure}{ | ||
552 | -\renewcommand{\algocf@list}{lof} | ||
553 | -\renewcommand{\algocf@float}{figure} | ||
554 | -} | ||
555 | -% | ||
556 | -\DeclareOption{english}{% | ||
557 | -\renewcommand{\listalgorithmcfname}{List of Algorithms}% | ||
558 | -\renewcommand{\algorithmcfname}{Algorithm}% | ||
559 | -\renewcommand{\algocf@typo}{}% | ||
560 | -\renewcommand{\@algocf@procname}{Procedure} | ||
561 | -\renewcommand{\@algocf@funcname}{Function} | ||
562 | -} | ||
563 | -% | ||
564 | -\DeclareOption{french}{% | ||
565 | -\renewcommand{\listalgorithmcfname}{Liste des Algorithmes}% | ||
566 | -\renewcommand{\algorithmcfname}{Algorithme}% | ||
567 | -\renewcommand{\algocf@typo}{\ }% | ||
568 | -\renewcommand{\@algocf@procname}{Procédure} | ||
569 | -\renewcommand{\@algocf@funcname}{Fonction} | ||
570 | -} | ||
571 | -% | ||
572 | -\DeclareOption{czech}{% | ||
573 | -\renewcommand{\listalgorithmcfname}{Seznam algoritm\v{u}}% | ||
574 | -\renewcommand{\algorithmcfname}{Algoritmus}% | ||
575 | -\renewcommand{\algocf@typo}{}% | ||
576 | -\renewcommand{\@algocf@procname}{Procedura} | ||
577 | -\renewcommand{\@algocf@funcname}{Funkce} | ||
578 | -} | ||
579 | -% | ||
580 | -\DeclareOption{german}{% | ||
581 | -\renewcommand{\listalgorithmcfname}{Liste der Algorithmen}% | ||
582 | -\renewcommand{\algorithmcfname}{Algorithmus}% | ||
583 | -\renewcommand{\algocf@typo}{\ }% | ||
584 | -\renewcommand{\@algocf@procname}{Prozedur}% | ||
585 | -\renewcommand{\@algocf@funcname}{Funktion}% | ||
586 | -} | ||
587 | -% | ||
588 | -\DeclareOption{portugues}{% | ||
589 | -\renewcommand{\listalgorithmcfname}{Lista de Algoritmos}% | ||
590 | -\renewcommand{\algorithmcfname}{Algoritmo}% | ||
591 | -\renewcommand{\algocf@typo}{}% | ||
592 | -\renewcommand{\@algocf@procname}{Procedimento} | ||
593 | -\renewcommand{\@algocf@funcname}{Fun\c{c}\~{a}o} | ||
594 | -} | ||
595 | -% | ||
596 | -% OPTIONs plain, boxed, ruled, algoruled & boxruled | ||
597 | -% | ||
598 | -\newcommand{\algocf@style@plain}{\renewcommand{\algocf@style}{plain}} | ||
599 | -\newcommand{\algocf@style@boxed}{\renewcommand{\algocf@style}{boxed}} | ||
600 | -\newcommand{\algocf@style@ruled}{\renewcommand{\algocf@style}{ruled}} | ||
601 | -\newcommand{\algocf@style@algoruled}{\renewcommand{\algocf@style}{algoruled}} | ||
602 | -\newcommand{\algocf@style@boxruled}{\renewcommand{\algocf@style}{boxruled}} | ||
603 | -\newcommand{\restylealgo}[1]{\csname algocf@style@#1\endcsname} | ||
604 | -\DeclareOption{plain}{\algocf@style@plain} | ||
605 | -\DeclareOption{boxed}{\algocf@style@boxed} | ||
606 | -\DeclareOption{ruled}{\algocf@style@ruled} | ||
607 | -\DeclareOption{algoruled}{\algocf@style@algoruled} | ||
608 | -\DeclareOption{boxruled}{\algocf@style@boxruled} | ||
609 | -% | ||
610 | -% OPTIONs algopart,algochapter & algosection | ||
611 | -% | ||
612 | -\DeclareOption{algopart}{\algocf@numbering{part}} %algo part numbered | ||
613 | -\DeclareOption{algochapter}{\algocf@numbering{chapter}} %algo chapter numbered | ||
614 | -\DeclareOption{algosection}{\algocf@numbering{section}} %algo section numbered | ||
615 | -% | ||
616 | -% OPTIONs resetcount & noresetcount | ||
617 | -% | ||
618 | -\DeclareOption{resetcount}{\renewcommand{\@ResetCounterIfNeeded}{\setcounter{AlgoLine}{0}}} | ||
619 | -\DeclareOption{noresetcount}{\renewcommand{\@ResetCounterIfNeeded}{}} | ||
620 | -% | ||
621 | -% OPTION linesnumbered | ||
622 | -% | ||
623 | -\newboolean{algocf@linesnumbered}\setboolean{algocf@linesnumbered}{false} | ||
624 | -\newcommand{\algocf@linesnumbered}{\relax} | ||
625 | -\DeclareOption{linesnumbered}{% | ||
626 | - \setboolean{algocf@linesnumbered}{true} | ||
627 | - \renewcommand{\algocf@linesnumbered}{\everypar={\nl}} | ||
628 | -} | ||
629 | -% | ||
630 | -% OPTION linesnumberedhidden | ||
631 | -% | ||
632 | -\DeclareOption{linesnumberedhidden}{% | ||
633 | - \setboolean{algocf@linesnumbered}{true} | ||
634 | - \renewcommand{\algocf@linesnumbered}{\everypar{\stepcounter{AlgoLine}}} | ||
635 | -} | ||
636 | -% | ||
637 | -% OPTION commentsnumbered inoutnumbered | ||
638 | -% | ||
639 | -\newboolean{algocf@commentsnumbered}\setboolean{algocf@commentsnumbered}{false} | ||
640 | -\DeclareOption{commentsnumbered}{\setboolean{algocf@commentsnumbered}{true}} | ||
641 | -\newboolean{algocf@inoutnumbered}\setboolean{algocf@inoutnumbered}{false} | ||
642 | -\DeclareOption{inoutnumbered}{\setboolean{algocf@inoutnumbered}{true}} | ||
643 | -% | ||
644 | -% OPTIONs titlenumbered & titlenotnumbered | ||
645 | -% | ||
646 | -\DeclareOption{titlenumbered}{% | ||
647 | - \renewcommand{\@titleprefix}{% | ||
648 | - \refstepcounter{algocf@float}% | ||
649 | - \AlTitleFnt{\@algocf@titleofalgoname\ | ||
650 | - \expandafter\csname the\algocf@float\endcsname\algocf@typo : }}% | ||
651 | -} | ||
652 | -% | ||
653 | -\DeclareOption{titlenotnumbered}{\renewcommand{\@titleprefix}{% | ||
654 | - \AlTitleFnt{\@algocf@titleofalgoname\algocf@typo : }}% | ||
655 | -} | ||
656 | -% | ||
657 | -% OPTIONs lined, vlined & noline | ||
658 | -% | ||
659 | -\DeclareOption{lined}{\AtBeginDocument{\SetLine}} % \SetLine | ||
660 | -\DeclareOption{vlined}{\AtBeginDocument{\SetVline}} % \SetVline | ||
661 | -\DeclareOption{noline}{\AtBeginDocument{\SetNoline}} % \Setnoline (default) | ||
662 | -% | ||
663 | -% OPTIONs algonl | ||
664 | -% line numbered with the counter of the algorithm | ||
665 | -% | ||
666 | -\DeclareOption{algonl}{\renewcommand{\theAlgoLine}{\expandafter\csname the\algocf@float\endcsname.\arabic{AlgoLine}}} | ||
667 | -% | ||
668 | -% OPTIONs longend, shotend & noend | ||
669 | -% | ||
670 | -\DeclareOption{longend}{% | ||
671 | -\renewcommand{\defaultsmacros@algo}{\algocf@defaults@longend}} | ||
672 | -\DeclareOption{shortend}{% | ||
673 | -\renewcommand{\defaultsmacros@algo}{\algocf@defaults@shortend}} | ||
674 | -\newboolean{algocf@optnoend}\setboolean{algocf@optnoend}{false} | ||
675 | -\DeclareOption{noend}{% | ||
676 | - \setboolean{algocf@optnoend}{true}% | ||
677 | - \renewcommand{\defaultsmacros@algo}{\algocf@defaults@noend}} | ||
678 | -% | ||
679 | -% OPTION dotoc | ||
680 | -% | ||
681 | -\newboolean{algocf@dotocloa}\setboolean{algocf@dotocloa}{false} | ||
682 | -\DeclareOption{dotocloa}{% | ||
683 | - \setboolean{algocf@dotocloa}{true} | ||
684 | -} | ||
685 | -% | ||
686 | -% OPTION comments | ||
687 | -% | ||
688 | -\newboolean{algocf@optfillcomment}\setboolean{algocf@optfillcomment}{true} | ||
689 | -\DeclareOption{nofillcomment}{% | ||
690 | - \setboolean{algocf@optfillcomment}{false}% | ||
691 | -} | ||
692 | -\DeclareOption{fillcomment}{% | ||
693 | - \setboolean{algocf@optfillcomment}{true}% | ||
694 | -} | ||
695 | -% | ||
696 | -% OPTION sidecommments | ||
697 | -% | ||
698 | -\newboolean{algocf@scleft}\setboolean{algocf@scleft}{false} | ||
699 | -\DeclareOption{scleft}{% | ||
700 | - \setboolean{algocf@scleft}{true}% | ||
701 | -} | ||
702 | -\DeclareOption{sright}{% default | ||
703 | - \setboolean{algocf@scleft}{false}% | ||
704 | -} | ||
705 | -% | ||
706 | -% | ||
707 | -%%%%%%%%%%%%%%%%%%%%%%% Execution of Options %%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
708 | -% | ||
709 | -\ExecuteOptions{english,plain,resetcount,titlenotnumbered} | ||
710 | -% | ||
711 | -\ProcessOptions | ||
712 | -% | ||
713 | -\@algocf@algotitleofalgo % fix name for \Titleofalgo to \algorithmcfname by default | ||
714 | -% | ||
715 | -%%%%%%%%%%%%%%%%%%%%%%%%%% Package Loading %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
716 | -% | ||
717 | -%\RequirePackage{float}[2001/11/08] | ||
718 | -% | ||
719 | -\RequirePackage{xspace} | ||
720 | -% | ||
721 | -\ifthenelse{\boolean{algocf@slide}}{\RequirePackage{color}}{} | ||
722 | -% | ||
723 | - | ||
724 | -\AtEndOfPackage{% | ||
725 | - \ifthenelse{\boolean{algocf@dotocloa}}{% | ||
726 | - \renewcommand{\listofalgorithmes}{\tocfile{\listalgorithmcfname}{loa}}% | ||
727 | - }{\relax} | ||
728 | -} | ||
729 | - | ||
730 | -% if loa in toc required, load tocbibind package if not already done. | ||
731 | -\ifthenelse{\boolean{algocf@dotocloa}}{% | ||
732 | - \ifx\@tocextra\undefined% | ||
733 | - \RequirePackage{tocbibind} | ||
734 | - \fi% | ||
735 | -} | ||
736 | - | ||
737 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Main Part %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
738 | -% | ||
739 | -\newcommand{\algocf@name}{algorithm2e} | ||
740 | -\newcommand{\algocf@date}{october 04 2005} | ||
741 | -\newcommand{\algocf@version}{Release 3.9} | ||
742 | -\newcommand{\algocf@id}{\algocf@version\space -- \algocf@date\space --} | ||
743 | -\typeout{********************************************************^^JPackage `\algocf@name'\space\algocf@id^^J% | ||
744 | - - algorithm2e-announce@lirmm.fr mailing list for announcement about releases^^J% | ||
745 | - - algorithm2e-discussion@lirmm.fr mailing list for discussion about package^^J% | ||
746 | - subscribe by emailing sympa@lirmm.fr with 'subscribe <list> <firstname name>'^^J% | ||
747 | - - Author: Christophe Fiorio (fiorio@lirmm.fr)^^J********************************************************} | ||
748 | -%% | ||
749 | -%% | ||
750 | -%% | ||
751 | -%% | ||
752 | -%% | ||
753 | -%% | ||
754 | -%%%% hyperref compatibility tricks: Hyperref package defines H counters from | ||
755 | - % standard counters (i.e \theHpage from \thepage) and check some particular | ||
756 | - % counters of some packages, unfortunately it doesn't do the same for | ||
757 | - % algorithm2e package but act as Hcounter was defined. To avoid errors we | ||
758 | - % defined \theHalgocf ourself | ||
759 | -%%%% | ||
760 | -% \@ifundefined{theHalgocf}{\def\theHalgocf{\thealgocf}}{}% | ||
761 | -% \@ifundefined{theHAlgoLine}{\def\theHAlgoLine{\theAlgoLine}}{}% | ||
762 | -% \@ifundefined{theHalgocf}{\def\theHalgocf{\thealgocf}}{}% | ||
763 | -% \@ifundefined{theHAlgoLine}{\def\theHAlgoLine{\thealgocf}}{}% | ||
764 | -% \@ifundefined{toclevel@algocf}{\def\toclevel@algocf{0}}{}% | ||
765 | -%% | ||
766 | -%% | ||
767 | -%% | ||
768 | -\newcommand{\@defaultskiptotal}{0.5em}%\Setnlskip{0.5em} | ||
769 | -\newskip\skiptotal\skiptotal=0.5em%\Setnlskip{0.5em} | ||
770 | -\newskip\skiprule | ||
771 | -\newskip\skiphlne | ||
772 | -\newskip\skiptext | ||
773 | -\newskip\skiplength | ||
774 | -\newskip\algomargin | ||
775 | -\newskip\skipalgocfslide\skipalgocfslide=1em | ||
776 | -\newdimen\algowidth | ||
777 | -\newdimen\inoutsize | ||
778 | -\newdimen\inoutline | ||
779 | -% | ||
780 | -\newcommand{\@algoskip}{\smallskip}% | ||
781 | -\newcommand{\SetAlgoSkip}[1]{\renewcommand{\@algoskip}{\csname#1\endcsname}}% | ||
782 | -\newcommand{\@algoinsideskip}{\relax}% | ||
783 | -\newcommand{\SetAlgoInsideSkip}[1]{\renewcommand{\@algoinsideskip}{\csname#1\endcsname}}% | ||
784 | -% | ||
785 | -\newsavebox{\algocf@inoutbox} | ||
786 | -\newsavebox{\algocf@inputbox} | ||
787 | -%% | ||
788 | -%% | ||
789 | -\newcommand{\arg@e}{} | ||
790 | -\newcommand{\arg@space}{\ } | ||
791 | -\newcommand{\BlankLine}{\vskip 1ex} | ||
792 | -%% | ||
793 | -\newcommand{\vespace}{1ex} | ||
794 | -\newcommand{\SetInd}[2]{% | ||
795 | -\skiprule=#1% | ||
796 | -\skiptext=#2% | ||
797 | -\skiplength=\skiptext\advance\skiplength by \skiprule\advance\skiplength by 0.4pt} | ||
798 | -\SetInd{0.5em}{1em} | ||
799 | -\algomargin=\leftskip\advance\algomargin by \parindent | ||
800 | -\newcommand{\incmargin}[1]{\advance\algomargin by #1} | ||
801 | -\newcommand{\decmargin}[1]{\advance\algomargin by -#1} | ||
802 | -\newcommand{\Setnlskip}[1]{% | ||
803 | -\renewcommand{\@defaultskiptotal}{#1}% | ||
804 | -\setlength{\skiptotal}{#1}} | ||
805 | -\newcommand{\setnlskip}[1]{\Setnlskip{#1}}%kept for compatibility issue | ||
806 | -%% | ||
807 | -\newskip\AlCapSkip\AlCapSkip=0ex | ||
808 | -\newskip\AlCapHSkip\AlCapSkip=0ex | ||
809 | -\newcommand{\setalcapskip}[1]{\setlength{\AlCapSkip}{#1}} | ||
810 | -\newcommand{\setalcaphskip}[1]{\setlength{\AlCapHSkip}{#1}} | ||
811 | -\setalcaphskip{.5\algomargin} | ||
812 | -%% | ||
813 | -%% | ||
814 | -\newcommand{\Indentp}[1]{\advance\leftskip by #1} | ||
815 | -\newcommand{\Indp}{\advance\leftskip by 1em} | ||
816 | -\newcommand{\Indpp}{\advance\leftskip by 0.5em} | ||
817 | -\newcommand{\Indm}{\advance\leftskip by -1em} | ||
818 | -\newcommand{\Indmm}{\advance\leftskip by -0.5em} | ||
819 | -%% | ||
820 | -%% | ||
821 | -%% Line Numbering | ||
822 | -%% | ||
823 | -%% | ||
824 | -% number line style | ||
825 | -\newcommand{\nlSty}[1]{\textnormal{\textbf{#1}}}% default definition | ||
826 | -\newcommand{\Setnlsty}[3]{\renewcommand{\nlSty}[1]{\textnormal{\csname#1\endcsname{#2##1#3}}}} | ||
827 | -% | ||
828 | -% | ||
829 | -\newcommand{\algocf@nlhlabel}[2]{% | ||
830 | - \immediate\write\@auxout{% | ||
831 | - \string\newlabel{#1}{% | ||
832 | - {#2}% current label | ||
833 | - {\thepage}% page | ||
834 | - {}% current label string | ||
835 | -% {AlgoLine\thealgocfline.\theAlgoLine}% current Href | ||
836 | - {AlgoLine\thealgocfline.\theAlgoLine}% current Href | ||
837 | - {}% | ||
838 | - }% | ||
839 | - }% | ||
840 | -} | ||
841 | -% | ||
842 | -% nl definitions | ||
843 | -% | ||
844 | -\newcommand{\nl}{% | ||
845 | - \@ifundefined{href}{% if not hyperref then do a simple refstepcounter | ||
846 | - \refstepcounter{AlgoLine}% | ||
847 | - }{% else if hyperref, do the anchor so 2 lines in two differents algorithms cannot have the same href | ||
848 | -% \stepcounter{AlgoLine}\Hy@raisedlink{\hyper@anchorstart{AlgoLine\thealgocfline.\theAlgoLine}\hyper@anchorend}% | ||
849 | - \stepcounter{AlgoLine}\Hy@raisedlink{\hyper@anchorstart{AlgoLine\thealgocfline.\theAlgoLine}\hyper@anchorend}% | ||
850 | - }% now we can do the line numbering | ||
851 | - \strut\vadjust{\kern-\dp\strutbox\vtop to \dp\strutbox{% | ||
852 | - \baselineskip\dp\strutbox\vss\llap{\scriptsize{\nlSty{\theAlgoLine}\hskip\skiptotal}}\null}}% | ||
853 | -}% | ||
854 | -\newcommand{\nllabel}[1]{% | ||
855 | - \@ifundefined{href}{\label{#1}}{\algocf@nlhlabel{#1}{\theAlgoLine}}}% | ||
856 | -% | ||
857 | -\newcommand{\enl}{;% | ||
858 | - \@ifundefined{href}{% if not hyperref then do a simple refstepcounter | ||
859 | - \refstepcounter{AlgoLine}% | ||
860 | - }{% else if hyperref, do the anchor so 2 lines in two differents algorithms cannot have the same href | ||
861 | -% \stepcounter{AlgoLine}\Hy@raisedlink{\hyper@anchorstart{AlgoLine\thealgocfline.\theAlgoLine}\hyper@anchorend}% | ||
862 | - \stepcounter{AlgoLine}\Hy@raisedlink{\hyper@anchorstart{AlgoLine\thealgocfline.\theAlgoLine}\hyper@anchorend}% | ||
863 | - }% now we can do the line numbering | ||
864 | - \hfill\rlap{% | ||
865 | - \scriptsize{\nlSty{\theAlgoLine}}}\par} | ||
866 | -\newcommand{\nlset}[1]{% | ||
867 | - \hskip 0pt\llap{% | ||
868 | - \scriptsize{\nlSty{#1}}\hskip\skiptotal}\ignorespaces} | ||
869 | -% | ||
870 | -% lnl definitions | ||
871 | -% | ||
872 | -\@ifundefined{href}{% if not hyperref | ||
873 | - \newcommand{\lnl}[1]{\nl\label{#1}\ignorespaces}% | ||
874 | -}{% else hyperref | ||
875 | - \newcommand{\lnl}[1]{\nl\algocf@nlhlabel{#1}{\theAlgoLine}\ignorespaces}% | ||
876 | -} | ||
877 | -% | ||
878 | -% nlset | ||
879 | -% | ||
880 | -\@ifundefined{href}{% | ||
881 | - \newcommand{\lnlset}[2]{\nlset{#2}\protected@edef\@currentlabel{#2}\label{#1}}% | ||
882 | -}{%else hyperref | ||
883 | - \newcommand{\lnlset}[2]{\nlset{#2}% | ||
884 | - \Hy@raisedlink{\hyper@anchorstart{AlgoLine.#2}\hyper@anchorend}\algocf@nlhlabel{#1}{#2}% | ||
885 | - \ignorespaces% | ||
886 | - }% | ||
887 | -} | ||
888 | - | ||
889 | -% | ||
890 | -% set char put at end of each line | ||
891 | -% | ||
892 | -\newcommand{\algocf@endline}{\string;} | ||
893 | -\newcommand{\SetEndCharOfAlgoLine}[1]{\renewcommand{\algocf@endline}{#1}} | ||
894 | -% | ||
895 | -% end of line definition | ||
896 | -% | ||
897 | -\newcommand{\@endalgoln}{\algocf@endline\par}% default definition: printsemicolon | ||
898 | -\newcommand{\dontprintsemicolon}{\renewcommand{\@endalgoln}{\par}} | ||
899 | -\newcommand{\printsemicolon}{\renewcommand{\@endalgoln}{\algocf@endline\par}} | ||
900 | -% | ||
901 | -% line numbering | ||
902 | -% | ||
903 | -\newcommand{\linesnumbered}{\setboolean{algocf@linesnumbered}{true}\renewcommand{\algocf@linesnumbered}{\everypar={\nl}}} | ||
904 | -\newcommand{\linesnotnumbered}{% | ||
905 | - \setboolean{algocf@linesnumbered}{false}% | ||
906 | - \renewcommand{\algocf@linesnumbered}{\relax}% | ||
907 | -} | ||
908 | -% | ||
909 | -\newcommand{\linesnumberedhidden}{% | ||
910 | - \setboolean{algocf@linesnumbered}{true}\renewcommand{\algocf@linesnumbered}{\everypar{\stepcounter{AlgoLine}}}} | ||
911 | -\newcommand{\showln}{\nlset{\theAlgoLine}\ignorespaces} % display the line number on this line (without labelling) | ||
912 | -\newcommand{\showlnlabel}[1]{\lnlset{#1}{\theAlgoLine}\ignorespaces} % display the line number and label this line | ||
913 | -% | ||
914 | -%% | ||
915 | -% | ||
916 | -%% | ||
917 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
918 | -% | ||
919 | -% Styling text commands | ||
920 | -% | ||
921 | -\newcommand{\AlTitleFnt}[1]{\textbf{#1}\unskip}% default definition | ||
922 | -\newcommand{\SetAlTitleFnt}[1]{\renewcommand{\AlTitleFnt}[1]{\csname#1\endcsname{##1}\unskip}}% | ||
923 | -\newcommand{\AlFnt}{\relax}% default definition | ||
924 | -\newcommand{\SetAlFnt}[1]{\renewcommand{\AlFnt}{#1}}% | ||
925 | -\newcommand{\AlCapFnt}{\AlFnt{}}% default definition | ||
926 | -\newcommand{\SetAlCapFnt}[1]{\renewcommand{\AlCapFnt}{#1}}% | ||
927 | -\newcommand{\KwSty}[1]{\textnormal{\textbf{#1}}\unskip}% default definition | ||
928 | -\newcommand{\SetKwSty}[1]{\renewcommand{\KwSty}[1]{\textnormal{\csname#1\endcsname{##1}}\unskip}}% | ||
929 | -\newcommand{\ArgSty}[1]{\textnormal{\emph{#1}}\unskip}%\SetArgSty{emph} | ||
930 | -\newcommand{\SetArgSty}[1]{\renewcommand{\ArgSty}[1]{\textnormal{\csname#1\endcsname{##1}}\unskip}}% | ||
931 | -\newcommand{\FuncSty}[1]{\textnormal{\texttt{#1}}\unskip}%\SetFuncSty{texttt} | ||
932 | -\newcommand{\SetFuncSty}[1]{\renewcommand{\FuncSty}[1]{\textnormal{\csname#1\endcsname{##1}}\unskip}}% | ||
933 | -\newcommand{\DataSty}[1]{\textnormal{\textsf{#1}}\unskip}%%\SetDataSty{textsf} | ||
934 | -\newcommand{\SetDataSty}[1]{\renewcommand{\DataSty}[1]{\textnormal{\csname#1\endcsname{##1}}\unskip}}% | ||
935 | -\newcommand{\CommentSty}[1]{\textnormal{\texttt{#1}}\unskip}%%\SetDataSty{texttt} | ||
936 | -\newcommand{\SetCommentSty}[1]{\renewcommand{\CommentSty}[1]{\textnormal{\csname#1\endcsname{##1}}\unskip}}% | ||
937 | -\newcommand{\TitleSty}[1]{#1\unskip}%\SetTitleSty{}{} | ||
938 | -\newcommand{\SetTitleSty}[2]{\renewcommand{\TitleSty}[1]{% | ||
939 | -\csname#1\endcsname{\csname#2\endcsname##1}}\unskip} | ||
940 | -% | ||
941 | -%% | ||
942 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
943 | -% | ||
944 | -% Block basic commands | ||
945 | -% | ||
946 | -\newcommand{\al@push}[1]{\advance\skiptotal by #1\moveright #1} | ||
947 | -\newcommand{\al@pop}[1]{\advance\skiptotal by -#1} | ||
948 | -\newcommand{\al@addskiptotal}{\advance\skiptotal by 0.4pt\advance\hsize by -0.4pt} % 0.4 pt=width of \vrule | ||
949 | -\newcommand{\al@subskiptotal}{\advance\skiptotal by -0.4pt\advance\hsize by 0.4pt} % 0.4 pt=width of \vrule | ||
950 | -% | ||
951 | -\skiphlne=.8ex% | ||
952 | -\newcommand{\Setvlineskip}[1]{\skiphlne=#1} | ||
953 | -\newcommand{\V@line}[1]{% no vskip in between boxes but a strut to separate them, | ||
954 | - \strut\par\nointerlineskip% then interblock space stay the same whatever is inside it | ||
955 | - \al@push{\skiprule}% move to the right before the vertical rule | ||
956 | - \hbox{\vrule% | ||
957 | - \vtop{\al@push{\skiptext}%move the right after the rule | ||
958 | - \vtop{\al@addskiptotal\advance\hsize by -\skiplength #1}\Hlne}}\vskip\skiphlne% inside the block | ||
959 | - \al@pop{\skiprule}%\al@subskiptotal% restore indentation | ||
960 | - \nointerlineskip}% no vskip after | ||
961 | -% | ||
962 | -\newcommand{\V@sline}[1]{% no vskip in between boxes but a strut to separate them, | ||
963 | - \strut\par\nointerlineskip% then interblock space stay the same whatever is inside it | ||
964 | - \al@push{\skiprule}% move to the right before the vertical rule | ||
965 | - \hbox{\vrule% the vertical rule | ||
966 | - \vtop{\al@push{\skiptext}%move the right after the rule | ||
967 | - \vtop{\al@addskiptotal\advance\hsize by -\skiplength #1}}}% inside the block | ||
968 | - \al@pop{\skiprule}}% restore indentation | ||
969 | - %\nointerlineskip}% no vskip after | ||
970 | -% | ||
971 | -\newcommand{\H@lne}{\hrule height 0.4pt depth 0pt width .5em} | ||
972 | -% | ||
973 | -\newcommand{\No@line}[1]{% no vskip in between boxes but a strut to separate them, | ||
974 | - \strut\par\nointerlineskip% then interblock space stay the same whatever is inside it | ||
975 | - \al@push{\skiprule}% | ||
976 | - \hbox{% | ||
977 | - \vtop{\al@push{\skiptext}% | ||
978 | - \vtop{\advance\hsize by -\skiplength #1}}}% inside the block | ||
979 | - \al@pop{\skiprule}}% | ||
980 | - %\nointerlineskip}% no vskip after | ||
981 | -% | ||
982 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
983 | -%% | ||
984 | -%% default=NoLine | ||
985 | -% | ||
986 | -\newcommand{\a@@block}[2]{\No@line{##1}\KwSty{##2}\par} | ||
987 | -\newcommand{\a@block}[2]{\a@@block{#1}{#2}} % this to be redefined as a@group in | ||
988 | - % case of noend option | ||
989 | -\newcommand{\a@group}[1]{\No@line{##1}} | ||
990 | -\newcommand{\Hlne}{} | ||
991 | -% | ||
992 | -% | ||
993 | -\newcommand{\SetNoline}{%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Noline | ||
994 | -\renewcommand{\a@@block}[2]{\No@line{##1}\KwSty{##2}\strut\par}% | ||
995 | -\renewcommand{\a@group}[1]{\No@line{##1}} | ||
996 | -\renewcommand{\Hlne}{}} | ||
997 | -% | ||
998 | -\newcommand{\SetVline}{%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Vline | ||
999 | -\renewcommand{\a@@block}[2]{\V@line{##1}}% | ||
1000 | -\renewcommand{\a@group}[1]{\V@sline{##1}\strut\ignorespaces} | ||
1001 | -\renewcommand{\Hlne}{\H@lne}} | ||
1002 | -% | ||
1003 | -\newcommand{\SetLine}{%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Line | ||
1004 | -\renewcommand{\a@@block}[2]{\strut\V@sline{##1}\KwSty{##2}\strut\par}% no skip after a block so garantie at least a line | ||
1005 | -\renewcommand{\a@group}[1]{\V@sline{##1}\strut\ignorespaces} | ||
1006 | -\renewcommand{\Hlne}{}} | ||
1007 | -% | ||
1008 | -\newcommand{\SetNothing}{%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Noline | ||
1009 | -\renewcommand{\a@@block}[2]{\No@line{##1}\par}% | ||
1010 | -%\long | ||
1011 | -\renewcommand{\a@group}[1]{\No@line{##1}} | ||
1012 | -\renewcommand{\Hlne}{}} | ||
1013 | -% | ||
1014 | -%% | ||
1015 | -%% | ||
1016 | -% | ||
1017 | -% | ||
1018 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
1019 | -% | ||
1020 | -% ``Input :'''s like command | ||
1021 | -% | ||
1022 | -%%% | ||
1023 | -% text staying at the right of the longer keyword of KwInOut commands | ||
1024 | -% (text of KwInOut commands are all vertically aligned) | ||
1025 | -% | ||
1026 | -\newcommand{\algocf@newinout}{\par\parindent=\wd\algocf@inoutbox}% to put right indentation after a \\ in the KwInOut | ||
1027 | -\newcommand{\SetKwInOut}[2]{% | ||
1028 | - \sbox\algocf@inoutbox{\hbox{\KwSty{#2}\algocf@typo:\ }}% | ||
1029 | - \expandafter\ifx\csname InOutSizeDefined\endcsname\relax% if first time used | ||
1030 | - \newcommand\InOutSizeDefined{}\setlength{\inoutsize}{\wd\algocf@inoutbox}% | ||
1031 | - \else% else keep the larger dimension | ||
1032 | - \ifdim\wd\algocf@inoutbox>\inoutsize\setlength{\inoutsize}{\wd\algocf@inoutbox}\fi% | ||
1033 | - \fi% the dimension of the box is now defined. | ||
1034 | - \@ifundefined{#1}{\let\algocf@mkcmd=\newcommand}{\let\algocf@mkcmd=\renewcommand}% | ||
1035 | - \expandafter\algocf@mkcmd\csname#1\endcsname[1]{% | ||
1036 | - \ifthenelse{\boolean{algocf@inoutnumbered}}{\relax}{\everypar={\relax}} | ||
1037 | - {\let\\\algocf@newinout\hangindent=\wd\algocf@inoutbox\hangafter=1\parbox[t]{\inoutsize}{\KwSty{#2}\hfill:\mbox{\ }}##1\par} | ||
1038 | - \algocf@linesnumbered% reset the numbering of the lines | ||
1039 | - }}% | ||
1040 | -% | ||
1041 | -%% allow to ajust the skip size of InOut | ||
1042 | -%% | ||
1043 | -\newcommand{\ResetInOut}[1]{% | ||
1044 | - \sbox\algocf@inoutbox{\hbox{\KwSty{#1}\algocf@typo:\ }}% | ||
1045 | - \setlength{\inoutsize}{\wd\algocf@inoutbox}% | ||
1046 | - } | ||
1047 | -% | ||
1048 | -% | ||
1049 | -%%% | ||
1050 | -% text staying at the right of the keyword. | ||
1051 | -% | ||
1052 | -\newcommand{\algocf@newinput}{\par\parindent=\wd\algocf@inputbox}% to put right indentation after a \\ in the KwInput | ||
1053 | -\newcommand{\SetKwInput}[2]{% | ||
1054 | - \@ifundefined{#1}{\let\algocf@mkcmd=\newcommand}{\let\algocf@mkcmd=\renewcommand}% | ||
1055 | - \expandafter\algocf@mkcmd\csname#1\endcsname[1]{% | ||
1056 | - \sbox\algocf@inputbox{\hbox{\KwSty{#2}\algocf@typo: }}% | ||
1057 | - \ifthenelse{\boolean{algocf@inoutnumbered}}{\relax}{\everypar={\relax}}% | ||
1058 | - {\let\\\algocf@newinput\hangindent=\wd\algocf@inputbox\hangafter=1\unhbox\algocf@inputbox##1\par}% | ||
1059 | - \algocf@linesnumbered% reset the numbering of the lines | ||
1060 | - }}% | ||
1061 | -\newcommand{\SetKwData}[2]{% | ||
1062 | - \@ifundefined{#1}{\let\algocf@mkcmd=\newcommand}{\let\algocf@mkcmd=\renewcommand}% | ||
1063 | - \expandafter\algocf@mkcmd\csname @#1\endcsname[1]{\DataSty{#2(}\ArgSty{##1}\DataSty{)}}% | ||
1064 | - \expandafter\algocf@mkcmd\csname#1\endcsname{% | ||
1065 | - \@ifnextchar\bgroup{\csname @#1\endcsname}{\DataSty{#2}\xspace}}% | ||
1066 | - } | ||
1067 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
1068 | -% | ||
1069 | -% Comments macros | ||
1070 | -% | ||
1071 | -%%%% | ||
1072 | -% comment in the text, first argument is the name of the macro, second is | ||
1073 | -% the text put before the comment, third is the text put at the end of the | ||
1074 | -% comment. | ||
1075 | -% | ||
1076 | -% first side comment justification | ||
1077 | -\newcommand{\SetSideCommentLeft}{\setboolean{algocf@scleft}{true}} | ||
1078 | -\newcommand{\SetSideCommentRight}{\setboolean{algocf@scleft}{false}} | ||
1079 | -\newcommand{\SetNoFillComment}{\setboolean{algocf@optfillcomment}{false}} | ||
1080 | -\newcommand{\SetFillComment}{\setboolean{algocf@optfillcomment}{true}} | ||
1081 | -% | ||
1082 | -% next comment and side comment | ||
1083 | -% | ||
1084 | -\newcommand{\algocf@endmarkcomment}{\relax}% | ||
1085 | -\newcommand{\algocf@fillcomment}{% | ||
1086 | - \ifthenelse{\boolean{algocf@optfillcomment}}{\hfill}{\relax}}% | ||
1087 | -% | ||
1088 | -\newcommand{\algocf@startcomment}{% | ||
1089 | - \hangindent=\wd\algocf@inputbox\hangafter=1\usebox\algocf@inputbox}% | ||
1090 | -\newcommand{\algocf@endcomment}{\algocf@fillcomment\algocf@endmarkcomment\ignorespaces\par}% | ||
1091 | -\newcommand{\algocf@endstartcomment}{\algocf@endcomment\algocf@startcomment\ignorespaces}% | ||
1092 | -% | ||
1093 | -\newboolean{algocf@sidecomment}% | ||
1094 | -\newboolean{algocf@altsidecomment}\setboolean{algocf@altsidecomment}{false}% | ||
1095 | -\newcommand{\algocf@scpar}{\ifthenelse{\boolean{algocf@altsidecomment}}{\relax}{\par}}% | ||
1096 | -\newcommand{\algocf@sclfill}{\ifthenelse{\boolean{algocf@scleft}}{\algocf@fillcomment}{\relax}}% | ||
1097 | -\newcommand{\algocf@scrfill}{\ifthenelse{\boolean{algocf@scleft}}{\relax}{\hfill}} | ||
1098 | -\newcommand{\algocf@startsidecomment}{\usebox\algocf@inputbox}% | ||
1099 | -\newcommand{\algocf@endsidecomment}{\algocf@endmarkcomment\algocf@scpar}% | ||
1100 | -\newcommand{\algocf@endstartsidecomment}{% | ||
1101 | - \algocf@sclfill\algocf@endsidecomment% | ||
1102 | - \algocf@scrfill\algocf@startsidecomment\ignorespaces}% | ||
1103 | -% | ||
1104 | -\newcommand{\SetKwComment}[3]{% | ||
1105 | - % newcommand or renewcommand ? | ||
1106 | - \@ifundefined{#1}{\let\algocf@mkcmd=\newcommand}{\let\algocf@mkcmd=\renewcommand}% | ||
1107 | - %%% comment definition | ||
1108 | - \expandafter\algocf@mkcmd\csname algocf@#1\endcsname[1]{% | ||
1109 | - \sbox\algocf@inputbox{\CommentSty{\hbox{#2}}}% | ||
1110 | - \ifthenelse{\boolean{algocf@commentsnumbered}}{\relax}{\everypar={\relax}}% | ||
1111 | - {\renewcommand{\algocf@endmarkcomment}{#3}% | ||
1112 | - \let\\\algocf@endstartcomment% | ||
1113 | - \algocf@startcomment\CommentSty{% | ||
1114 | - \strut\ignorespaces##1\strut\algocf@fillcomment#3}\par}% | ||
1115 | - \algocf@linesnumbered% reset the numbering of the lines | ||
1116 | - }% | ||
1117 | - %%% side comment definitions | ||
1118 | - % option or not? | ||
1119 | - \expandafter\algocf@mkcmd\csname algocf@#1@star\endcsname{% | ||
1120 | - \@ifnextchar [{\csname algocf@#1@staropt\endcsname}{\csname algocf@#1@sidecomment\endcsname}% | ||
1121 | - }% | ||
1122 | - % manage option | ||
1123 | - \expandafter\def\csname algocf@#1@staropt\endcsname[##1]##2{% | ||
1124 | - \ifthenelse{\boolean{algocf@scleft}}{\setboolean{algocf@sidecomment}{true}}{\setboolean{algocf@sidecomment}{false}}% | ||
1125 | - \ifx##1h\setboolean{algocf@altsidecomment}{true}\SetSideCommentLeft\fi% | ||
1126 | - \ifx##1f\setboolean{algocf@altsidecomment}{true}\SetSideCommentRight\fi% | ||
1127 | - \ifx##1l\setboolean{algocf@altsidecomment}{false}\SetSideCommentLeft\fi% | ||
1128 | - \ifx##1r\setboolean{algocf@altsidecomment}{false}\SetSideCommentRight\fi% | ||
1129 | - \csname algocf@#1@sidecomment\endcsname{##2}% call sidecomment | ||
1130 | - \ifthenelse{\boolean{algocf@sidecomment}}{\setboolean{algocf@scleft}{true}}{\setboolean{algocf@scleft}{false}}% | ||
1131 | - \setboolean{algocf@altsidecomment}{false}% | ||
1132 | - }% | ||
1133 | - % side comment | ||
1134 | - \expandafter\algocf@mkcmd\csname algocf@#1@sidecomment\endcsname[1]{% | ||
1135 | - \sbox\algocf@inputbox{\CommentSty{\hbox{#2}}}% | ||
1136 | - \ifthenelse{\boolean{algocf@commentsnumbered}}{\relax}{\everypar={\relax}}% | ||
1137 | - {% | ||
1138 | - \renewcommand{\algocf@endmarkcomment}{#3}% | ||
1139 | - \let\\\algocf@endstartsidecomment% | ||
1140 | - % here is the comment | ||
1141 | - \ifthenelse{\boolean{algocf@altsidecomment}}{\relax}{\algocf@endline\ }% | ||
1142 | - \algocf@scrfill\algocf@startsidecomment\CommentSty{% | ||
1143 | - \strut\ignorespaces##1\strut\algocf@sclfill#3}\algocf@scpar% | ||
1144 | - }% | ||
1145 | - \algocf@linesnumbered% reset the numbering of the lines | ||
1146 | - } | ||
1147 | - \expandafter\algocf@mkcmd\csname#1\endcsname{\@ifstar{\csname algocf@#1@star\endcsname}{\csname algocf@#1\endcsname}} | ||
1148 | -}% | ||
1149 | -% | ||
1150 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
1151 | -% | ||
1152 | -% Kw | ||
1153 | -% | ||
1154 | -\newcommand{\SetKw}[2]{% | ||
1155 | - \@ifundefined{#1}{\let\algocf@mkcmd=\newcommand}{\let\algocf@mkcmd=\renewcommand}% | ||
1156 | - \expandafter\algocf@mkcmd\csname @#1\endcsname[1]{\KwSty{#2} \ArgSty{##1}}% | ||
1157 | - \expandafter\algocf@mkcmd\csname#1\endcsname{% | ||
1158 | - \@ifnextchar\bgroup{\csname @#1\endcsname}{\KwSty{#2}\xspace}}% | ||
1159 | - } | ||
1160 | -% | ||
1161 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
1162 | -% | ||
1163 | -% KwFunction | ||
1164 | -% | ||
1165 | -\newcommand{\SetKwFunction}[2]{% | ||
1166 | - \@ifundefined{#1}{\let\algocf@mkcmd=\newcommand}{\let\algocf@mkcmd=\renewcommand}% | ||
1167 | - \expandafter\algocf@mkcmd\csname @#1\endcsname[1]{\FuncSty{#2(}\ArgSty{##1}\FuncSty{)}}% | ||
1168 | - \expandafter\algocf@mkcmd\csname#1\endcsname{% | ||
1169 | - \@ifnextchar\bgroup{\csname @#1\endcsname}{\FuncSty{#2}\xspace}}% | ||
1170 | -} | ||
1171 | -% | ||
1172 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
1173 | -% | ||
1174 | -% KwBlock | ||
1175 | -% | ||
1176 | -\newcommand{\SetKwBlock}[3]{% | ||
1177 | -\@ifundefined{algocf@#1}{\let\algocf@mkcmd=\newcommand}{\let\algocf@mkcmd=\renewcommand}% | ||
1178 | -% side text or not? | ||
1179 | -\expandafter\def\csname#1\endcsname{ %Begin | ||
1180 | - \@ifnextchar({\csname algocf@#1opt\endcsname}{\csname algocf@#1\endcsname}} | ||
1181 | -% with side text | ||
1182 | -\expandafter\def\csname algocf@#1opt\endcsname(##1)##2{% \Begin(){} | ||
1183 | - \KwSty{#2} ##1\a@group{##2}\KwSty{#3}% | ||
1184 | - \@ifnextchar({\csname algocf@#1end\endcsname}{\par}}% | ||
1185 | -% without side text at the beginning | ||
1186 | -\expandafter\algocf@mkcmd\csname algocf@#1\endcsname[1]{% \Begin{} | ||
1187 | - \KwSty{#2}\a@group{##1}\KwSty{#3}\@ifnextchar({\csname algocf@#1end\endcsname}{\par}}% | ||
1188 | -% side text at the end | ||
1189 | -\expandafter\def\csname algocf@#1end\endcsname(##1){% \Begin{} | ||
1190 | - \ ##1\par}% | ||
1191 | -} | ||
1192 | -% | ||
1193 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
1194 | -% | ||
1195 | -% For Switch | ||
1196 | -% | ||
1197 | -\newcommand{\SetKwSwitch}[8]{% #1=\Switch #2=\Case #3=\Other #4=swicth #5=case #6=do #7=otherwise #8=endsw | ||
1198 | -%%%% Switch | ||
1199 | -\@ifundefined{algocf@#1}{\let\algocf@mkcmd=\newcommand}{\let\algocf@mkcmd=\renewcommand}% | ||
1200 | -% side text or not? | ||
1201 | -\expandafter\def\csname#1\endcsname{ %Switch | ||
1202 | - \@ifnextchar({\csname algocf@#1opt\endcsname}{\csname algocf@#1\endcsname}} | ||
1203 | -% with side text | ||
1204 | -\expandafter\def\csname algocf@#1opt\endcsname(##1)##2##3{% \Switch(){}{} | ||
1205 | - \KwSty{#4} \ArgSty{##2} \KwSty{#5} ##1\a@block{##3}{#8}}% | ||
1206 | -% without side text | ||
1207 | -\expandafter\algocf@mkcmd\csname algocf@#1\endcsname[2]{% \Switch{}{} | ||
1208 | - \KwSty{#4} \ArgSty{##1} \KwSty{#5}\a@block{##2}{#8}}% | ||
1209 | -% side text at the end | ||
1210 | -\expandafter\def\csname algocf@#1end\endcsname(##1){% \Switch{}{}() | ||
1211 | - | ||
1212 | -} | ||
1213 | - | ||
1214 | -%%%% Case | ||
1215 | -\@ifundefined{algocf@#2}{\let\algocf@mkcmd=\newcommand}{\let\algocf@mkcmd=\renewcommand}% | ||
1216 | -% side text or not? | ||
1217 | -\expandafter\def\csname#2\endcsname{ %Case | ||
1218 | - \@ifnextchar({\csname algocf@#2opt\endcsname}{\csname algocf@#2\endcsname}} | ||
1219 | -\expandafter\def\csname u#2\endcsname{ %uCase | ||
1220 | - \@ifnextchar({\csname algocf@u#2opt\endcsname}{\csname algocf@u#2\endcsname}} | ||
1221 | -\expandafter\def\csname l#2\endcsname{ %lCase | ||
1222 | - \@ifnextchar({\csname algocf@l#2opt\endcsname}{\csname algocf@l#2\endcsname}} | ||
1223 | -% with side text | ||
1224 | -\expandafter\def\csname algocf@#2opt\endcsname(##1)##2##3{% \Case(){}{} | ||
1225 | - \KwSty{#6} \ArgSty{##2} ##1\a@block{##3}{#8}}% | ||
1226 | -\expandafter\def\csname algocf@u#2opt\endcsname(##1)##2##3{% \uCase(){}{} | ||
1227 | - \KwSty{#6} \ArgSty{##2} ##1\a@group{##3}}% | ||
1228 | -\expandafter\def\csname algocf@l#2opt\endcsname(##1)##2##3{% \lCase(){}{} | ||
1229 | - \KwSty{#6} \ArgSty{##2} ##3\algocf@endline\ ##1\par}% | ||
1230 | -% without side text | ||
1231 | -\expandafter\algocf@mkcmd\csname algocf@#2\endcsname[2]{% \Case{}{} | ||
1232 | - \KwSty{#6} \ArgSty{##1}\a@block{##2}{#8}}% | ||
1233 | -\expandafter\algocf@mkcmd\csname algocf@u#2\endcsname[2]{% \uCase{}{} | ||
1234 | - \KwSty{#6} \ArgSty{##1}\a@group{##2}}% | ||
1235 | -\expandafter\algocf@mkcmd\csname algocf@l#2\endcsname[2]{% \lCase{}{} | ||
1236 | - \KwSty{#6} \ArgSty{##1} ##2}% | ||
1237 | -%%%% Other | ||
1238 | -\@ifundefined{algocf@#3}{\let\algocf@mkcmd=\newcommand}{\let\algocf@mkcmd=\renewcommand}% | ||
1239 | -% side text or not? | ||
1240 | -\expandafter\def\csname#3\endcsname{ %Other | ||
1241 | - \@ifnextchar({\csname algocf@#3opt\endcsname}{\csname algocf@#3\endcsname}} | ||
1242 | -\expandafter\def\csname l#3\endcsname{ %Other | ||
1243 | - \@ifnextchar({\csname algocf@l#3opt\endcsname}{\csname algocf@l#3\endcsname}} | ||
1244 | -% with side text | ||
1245 | -\expandafter\def\csname algocf@#3opt\endcsname(##1)##2{% \Other(){}{} | ||
1246 | - \KwSty{#7} ##1\a@block{##2}{#8}}% | ||
1247 | -\expandafter\def\csname algocf@l#3opt\endcsname(##1)##2{% \Other(){}{} | ||
1248 | - \KwSty{#7} ##2\algocf@endline\ ##1\par}% | ||
1249 | -% without side text | ||
1250 | -\expandafter\algocf@mkcmd\csname algocf@#3\endcsname[1]{% default | ||
1251 | - \KwSty{#7}\a@block{##1}{#8}}% | ||
1252 | -\expandafter\algocf@mkcmd\csname algocf@l#3\endcsname[1]{% ldefault | ||
1253 | - \KwSty{#7} ##1}% | ||
1254 | -} | ||
1255 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
1256 | -% | ||
1257 | -% If macros | ||
1258 | -% | ||
1259 | -\newcommand{\SetKwIF}[8]{% #1=\If #2=\ElseIf #3=\Else #4=if #5=then #6=elseif si #7=else #8=endif | ||
1260 | -% | ||
1261 | -% common text | ||
1262 | -\@ifundefined{#1@ifthen}{\let\algocf@mkcmd=\newcommand}{\let\algocf@mkcmd=\renewcommand}% | ||
1263 | -\expandafter\algocf@mkcmd\csname #1@ifthen\endcsname[1]{% | ||
1264 | - \KwSty{#4} \ArgSty{##1} \KwSty{#5}}% | ||
1265 | -\expandafter\algocf@mkcmd\csname #1@endif\endcsname[1]{\a@block{##1}{#8}}% | ||
1266 | -\expandafter\algocf@mkcmd\csname #1@noend\endcsname[1]{\a@group{##1}}% | ||
1267 | -\expandafter\algocf@mkcmd\csname #1@else\endcsname[1]{\a@group{##1}\KwSty{#7}}% | ||
1268 | -\@ifundefined{#2@elseif}{\let\algocf@mkcmd=\newcommand}{\let\algocf@mkcmd=\renewcommand}% | ||
1269 | -\expandafter\algocf@mkcmd\csname #2@elseif\endcsname[1]{% | ||
1270 | - \KwSty{#6} \ArgSty{##1} \KwSty{#5}}% | ||
1271 | -\@ifundefined{#3@else}{\let\algocf@mkcmd=\newcommand}{\let\algocf@mkcmd=\renewcommand}% | ||
1272 | -\expandafter\algocf@mkcmd\csname #3@else\endcsname{\KwSty{#7}}% | ||
1273 | -%%%% If then { } endif | ||
1274 | -% | ||
1275 | -\@ifundefined{algocf@#1}{\let\algocf@mkcmd=\newcommand}{\let\algocf@mkcmd=\renewcommand}% | ||
1276 | -% side text or not? | ||
1277 | -\expandafter\def\csname#1\endcsname{% | ||
1278 | - \@ifnextchar({\csname algocf@#1opt\endcsname}{\csname algocf@#1\endcsname}} | ||
1279 | -% with side text | ||
1280 | -\expandafter\def\csname algocf@#1opt\endcsname(##1)##2##3{% \If(){}{} | ||
1281 | - \csname #1@ifthen\endcsname{##2} ##1\csname #1@endif\endcsname{##3}}% | ||
1282 | -% without side text | ||
1283 | -\expandafter\algocf@mkcmd\csname algocf@#1\endcsname[2]{% \If{}{} | ||
1284 | - \csname #1@ifthen\endcsname{##1}\csname #1@endif\endcsname{##2}}% | ||
1285 | -% | ||
1286 | -%%%% If then {} else {} endif | ||
1287 | -% | ||
1288 | -% side text or not? | ||
1289 | -\expandafter\def\csname e#1\endcsname{% | ||
1290 | - \@ifnextchar({\csname algocf@e#1opt\endcsname}{\csname algocf@e#1optif\endcsname}} | ||
1291 | -% with side text after if | ||
1292 | -\expandafter\def\csname algocf@e#1opt\endcsname(##1)##2##3{% \eIf() | ||
1293 | - \csname #1@ifthen\endcsname{##2} ##1\csname #1@else\endcsname{##3}% | ||
1294 | - \csname algocf@e#1opte\endcsname} | ||
1295 | -% without side text after if | ||
1296 | -\expandafter\def\csname algocf@e#1optif\endcsname##1##2{% \eIf() | ||
1297 | - \csname #1@ifthen\endcsname{##1}\csname #1@else\endcsname{##2}% | ||
1298 | - \csname algocf@e#1opte\endcsname}% | ||
1299 | -% side text after else or not ? | ||
1300 | -\expandafter\def\csname algocf@e#1opte\endcsname{% | ||
1301 | - \@ifnextchar({\csname algocf@e#1optopt\endcsname}{\csname algocf@e#1\endcsname}} | ||
1302 | -% else with a side text | ||
1303 | -\expandafter\def\csname algocf@e#1optopt\endcsname(##1)##2{% | ||
1304 | - ##1\csname #1@endif\endcsname{##2}} | ||
1305 | -% else without side text | ||
1306 | -\expandafter\algocf@mkcmd\csname algocf@e#1\endcsname[1]{% | ||
1307 | - \csname #1@endif\endcsname{##1}} | ||
1308 | -% | ||
1309 | -%%%% If then | ||
1310 | -% | ||
1311 | -% side text or not? | ||
1312 | -\expandafter\def\csname l#1\endcsname{% lif | ||
1313 | - \@ifnextchar({\csname algocf@l#1opt\endcsname}{\csname algocf@l#1\endcsname}} | ||
1314 | -\expandafter\def\csname u#1\endcsname{% uif | ||
1315 | - \@ifnextchar({\csname algocf@u#1opt\endcsname}{\csname algocf@u#1\endcsname}} | ||
1316 | -% with side text | ||
1317 | -\expandafter\def\csname algocf@l#1opt\endcsname(##1)##2##3{% \lIf(){}{} | ||
1318 | - \csname #1@ifthen\endcsname{##2} ##3\algocf@endline\ ##1\par}% | ||
1319 | -\expandafter\def\csname algocf@u#1opt\endcsname(##1)##2##3{% \uIf(){}{} | ||
1320 | - \csname #1@ifthen\endcsname{##2} ##1\csname#1@noend\endcsname{##3}}% | ||
1321 | -% without side text | ||
1322 | -\expandafter\algocf@mkcmd\csname algocf@l#1\endcsname[2]{% \lIf{}{} | ||
1323 | - \csname #1@ifthen\endcsname{##1} ##2}% | ||
1324 | -\expandafter\algocf@mkcmd\csname algocf@u#1\endcsname[2]{% \uIf{}{} | ||
1325 | - \csname #1@ifthen\endcsname{##1}\csname#1@noend\endcsname{##2}}% | ||
1326 | -% | ||
1327 | -%%%% ElseIf {} endif | ||
1328 | -% | ||
1329 | -\@ifundefined{algocf@#2}{\let\algocf@mkcmd=\newcommand}{\let\algocf@mkcmd=\renewcommand}% | ||
1330 | -% side text or not? | ||
1331 | -\expandafter\def\csname#2\endcsname{% ElseIf | ||
1332 | - \@ifnextchar({\csname algocf@#2opt\endcsname}{\csname algocf@#2\endcsname}} | ||
1333 | -% with side text | ||
1334 | -\expandafter\def\csname algocf@#2opt\endcsname(##1)##2##3{% \ElseIf(){}{} | ||
1335 | - \csname #2@elseif\endcsname{##2} ##1\csname #1@endif\endcsname{##3}} | ||
1336 | -% without side text | ||
1337 | -\expandafter\algocf@mkcmd\csname algocf@#2\endcsname[2]{% \ElseIf{}{} | ||
1338 | - \csname #2@elseif\endcsname{##1}\csname #1@endif\endcsname{##2}} | ||
1339 | -% | ||
1340 | -%%%% ElseIf | ||
1341 | -% | ||
1342 | -% side text or not? | ||
1343 | -\expandafter\def\csname l#2\endcsname{% lElseIf | ||
1344 | - \@ifnextchar({\csname algocf@l#2opt\endcsname}{\csname algocf@l#2\endcsname}} | ||
1345 | -\expandafter\def\csname u#2\endcsname{% uElseIf | ||
1346 | - \@ifnextchar({\csname algocf@u#2opt\endcsname}{\csname algocf@u#2\endcsname}} | ||
1347 | -% with side text | ||
1348 | -\expandafter\def\csname algocf@l#2opt\endcsname(##1)##2##3{% \lElseIf(){}{} | ||
1349 | - \csname #2@elseif\endcsname{##2} ##3\algocf@endline\ ##1\par} | ||
1350 | -\expandafter\def\csname algocf@u#2opt\endcsname(##1)##2##3{% \uElseIf(){}{} | ||
1351 | - \csname #2@elseif\endcsname{##2} ##1\csname #1@noend\endcsname{##3}} | ||
1352 | -% without side text | ||
1353 | -\expandafter\algocf@mkcmd\csname algocf@l#2\endcsname[2]{% \lElseIf{}{} | ||
1354 | - \csname #2@elseif\endcsname{##1} ##2}% | ||
1355 | -\expandafter\algocf@mkcmd\csname algocf@u#2\endcsname[2]{% \uElseIf{}{} | ||
1356 | - \csname #2@elseif\endcsname{##1}\csname #1@noend\endcsname{##2}} | ||
1357 | -% | ||
1358 | -%%%% Else {} endif | ||
1359 | -% | ||
1360 | -\@ifundefined{algocf@#3}{\let\algocf@mkcmd=\newcommand}{\let\algocf@mkcmd=\renewcommand}% | ||
1361 | -% side text or not? | ||
1362 | -\expandafter\def\csname#3\endcsname{% Else | ||
1363 | - \@ifnextchar({\csname algocf@#3opt\endcsname}{\csname algocf@#3\endcsname}} | ||
1364 | -% with side text | ||
1365 | -\expandafter\def\csname algocf@#3opt\endcsname(##1)##2{% \Else(){} | ||
1366 | - \csname #3@else\endcsname\ ##1\csname #1@endif\endcsname{##2}} | ||
1367 | -% without side text | ||
1368 | -\expandafter\algocf@mkcmd\csname algocf@#3\endcsname[1]{% \Else{} | ||
1369 | - \csname #3@else\endcsname\csname #1@endif\endcsname{##1}}% | ||
1370 | -% | ||
1371 | -%%%% Else | ||
1372 | -% | ||
1373 | -% side text or not? | ||
1374 | -\expandafter\def\csname l#3\endcsname{% lElse | ||
1375 | - \@ifnextchar({\csname algocf@l#3opt\endcsname}{\csname algocf@l#3\endcsname}} | ||
1376 | -\expandafter\def\csname u#3\endcsname{% uElse | ||
1377 | - \@ifnextchar({\csname algocf@u#3opt\endcsname}{\csname algocf@u#3\endcsname}} | ||
1378 | -% with side text | ||
1379 | -\expandafter\def\csname algocf@l#3opt\endcsname(##1)##2{% \lElse(){} | ||
1380 | - \csname #3@else\endcsname\ ##2\algocf@endline\ ##1\par} | ||
1381 | -\expandafter\def\csname algocf@#3opt\endcsname(##1)##2{% \uElse(){} | ||
1382 | - \csname #3@else\endcsname\ ##1\csname #1@noend\endcsname{##2}} | ||
1383 | -% without side text | ||
1384 | -\expandafter\algocf@mkcmd\csname algocf@l#3\endcsname[1]{% \lElse{} | ||
1385 | - \csname #3@else\endcsname\ ##1}% | ||
1386 | -\expandafter\algocf@mkcmd\csname algocf@u#3\endcsname[1]{% \uElse{} | ||
1387 | - \csname #3@else\endcsname\csname #1@noend\endcsname{##1}}% | ||
1388 | -} | ||
1389 | -% | ||
1390 | -% old for backward compatibility | ||
1391 | -\newcommand{\SetKwIf}[6]{% | ||
1392 | - \SetKwIF{#1}{cf@dumb}{#2}{#3}{#4}{cf@dumb}{#5}{#6}% | ||
1393 | - \typeout{**** WARNING: SetKwIf deprecated: use SetKwIF instead*****^^J}% | ||
1394 | -}% | ||
1395 | -\newcommand{\SetKwIfElseIf}[8]{% | ||
1396 | - \SetKwIF{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}% | ||
1397 | - \typeout{**** WARNING: SetKwIfElseIf deprecated: use SetKwIF instead*****^^J}% | ||
1398 | -}% | ||
1399 | -% | ||
1400 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
1401 | -% | ||
1402 | -% For macros | ||
1403 | -% | ||
1404 | -\newcommand{\SetKwFor}[4]{% | ||
1405 | -\@ifundefined{algocf@#1}{\let\algocf@mkcmd=\newcommand}{\let\algocf@mkcmd=\renewcommand}% | ||
1406 | -% side text or not? | ||
1407 | -\expandafter\def\csname#1\endcsname{ %For | ||
1408 | - \@ifnextchar({\csname algocf@#1opt\endcsname}{\csname algocf@#1\endcsname}} | ||
1409 | -\expandafter\def\csname l#1\endcsname{ %For | ||
1410 | - \@ifnextchar({\csname algocf@l#1opt\endcsname}{\csname algocf@l#1\endcsname}} | ||
1411 | -% with side text | ||
1412 | -\expandafter\def\csname algocf@#1opt\endcsname(##1)##2##3{% \For(){}{} | ||
1413 | - \KwSty{#2} \ArgSty{##2} \KwSty{#3} ##1\a@block{##3}{#4}}% | ||
1414 | -\expandafter\def\csname algocf@l#1opt\endcsname(##1)##2##3{% \lFor(){}{} | ||
1415 | - \KwSty{#2} \ArgSty{##2} \KwSty{#3} ##3\algocf@endline\ ##1\par} | ||
1416 | -% without side text | ||
1417 | -\expandafter\algocf@mkcmd\csname algocf@#1\endcsname[2]{% \For{}{} | ||
1418 | - \KwSty{#2} \ArgSty{##1} \KwSty{#3}\a@block{##2}{#4}}% | ||
1419 | -\expandafter\algocf@mkcmd\csname algocf@l#1\endcsname[2]{% \lFor{}{} | ||
1420 | - \KwSty{#2} \ArgSty{##1} \KwSty{#3} ##2}% | ||
1421 | -} | ||
1422 | -% | ||
1423 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
1424 | -% | ||
1425 | -% Repeat macros | ||
1426 | -% | ||
1427 | -\newcommand{\SetKwRepeat}[3]{% | ||
1428 | -\@ifundefined{algocf@#1}{\let\algocf@mkcmd=\newcommand}{\let\algocf@mkcmd=\renewcommand}% | ||
1429 | -% side text or not? | ||
1430 | -\expandafter\def\csname#1\endcsname{ %Repeat | ||
1431 | - \@ifnextchar({\csname algocf@#1opt\endcsname}{\csname algocf@#1\endcsname}} | ||
1432 | -\expandafter\def\csname l#1\endcsname{ %lRepeat | ||
1433 | - \@ifnextchar({\csname algocf@l#1opt\endcsname}{\csname algocf@l#1\endcsname}} | ||
1434 | -% with side text | ||
1435 | -\expandafter\def\csname algocf@#1opt\endcsname(##1)##2##3{% \Repeat(){}{} | ||
1436 | - \KwSty{#2} ##1\a@group{##3}\KwSty{#3} \ArgSty{##2}% | ||
1437 | - \@ifnextchar({\csname algocf@#1optopt\endcsname}{\@endalgoln}% | ||
1438 | -}% | ||
1439 | -\expandafter\def\csname algocf@#1optopt\endcsname(##1){% \Repeat(){}{}() | ||
1440 | - ##1\@endalgoln}% | ||
1441 | -\expandafter\def\csname algocf@l#1opt\endcsname(##1)##2##3{% \lRepeat(){}{} | ||
1442 | - \KwSty{#2} ##3 \KwSty{#3} \ArgSty{##2}\algocf@endline\ ##1\par}% | ||
1443 | -% without side text | ||
1444 | -\expandafter\algocf@mkcmd\csname algocf@#1\endcsname[2]{% \Repeat{}{} | ||
1445 | - \KwSty{#2}\a@group{##2}\KwSty{#3} \ArgSty{##1} | ||
1446 | - \@ifnextchar({\csname algocf@#1optopt\endcsname}{\@endalgoln}% | ||
1447 | -}% | ||
1448 | -\expandafter\algocf@mkcmd\csname algocf@l#1\endcsname[2]{% \lRepeat{}{} | ||
1449 | - \KwSty{#2} ##2 \KwSty{#3} \ArgSty{##1}}% | ||
1450 | -} | ||
1451 | -% | ||
1452 | -% | ||
1453 | -% | ||
1454 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
1455 | -%%%%%%%%%%%%%%%%%%%% Environments definitions %%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
1456 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
1457 | -% | ||
1458 | -%% | ||
1459 | -%% Caption management | ||
1460 | -%% | ||
1461 | -% for the following macros: | ||
1462 | -% #1 is given by caption and is equal to fnum@algocf | ||
1463 | -% #2 is the text given in argument by the user in the \caption macro | ||
1464 | -% | ||
1465 | -%%%%% text of caption | ||
1466 | -\newcommand{\algocf@captiontext}[2]{#1\algocf@typo: \AlCapFnt{}#2} % text of caption | ||
1467 | -% | ||
1468 | -%%%%% default caption of algorithm: used if no specific style caption is defined | ||
1469 | -\newcommand{\algocf@makecaption}[2]{% | ||
1470 | - \addtolength{\hsize}{\algomargin}% | ||
1471 | - \sbox\@tempboxa{\algocf@captiontext{#1}{#2}}% | ||
1472 | - \ifdim\wd\@tempboxa >\hsize% % if caption is longer than a line | ||
1473 | - \hskip .5\algomargin% | ||
1474 | - \parbox[t]{\hsize}{\algocf@captiontext{#1}{#2}}% then caption is not centered | ||
1475 | - \else% | ||
1476 | - \global\@minipagefalse% | ||
1477 | - \hbox to\hsize{\hfil\box\@tempboxa\hfil}% else caption is centered | ||
1478 | - \fi% | ||
1479 | - \addtolength{\hsize}{-\algomargin}% | ||
1480 | -} | ||
1481 | -% | ||
1482 | -\newsavebox\algocf@capbox | ||
1483 | -\newcommand{\algocf@makecaption@plain}[2]{% | ||
1484 | - \global\sbox\algocf@capbox{\algocf@makecaption{#1}{#2}}}% | ||
1485 | -\newcommand{\algocf@makecaption@boxed}[2]{% | ||
1486 | - \addtolength{\hsize}{-\algomargin}% | ||
1487 | - \global\sbox\algocf@capbox{\algocf@makecaption{#1}{#2}} | ||
1488 | - \addtolength{\hsize}{\algomargin}% | ||
1489 | - }% | ||
1490 | -% | ||
1491 | -\newcommand{\algocf@makecaption@algoruled}[2]{\algocf@makecaption@ruled{#1}{#2}}% | ||
1492 | -\newcommand{\algocf@makecaption@boxruled}[2]{\algocf@makecaption@ruled{#1}{#2}}% | ||
1493 | -\newcommand{\algocf@makecaption@ruled}[2]{% | ||
1494 | - \global\sbox\algocf@capbox{\hskip\AlCapHSkip% .5\algomargin% | ||
1495 | - \parbox[t]{\hsize}{\algocf@captiontext{#1}{#2}}}% then caption is not centered | ||
1496 | -} | ||
1497 | -% | ||
1498 | -\newcommand{\algocf@caption@plain}{\vskip\AlCapSkip\box\algocf@capbox}% | ||
1499 | -\newcommand{\algocf@caption@boxed}{\vskip\AlCapSkip\box\algocf@capbox}% | ||
1500 | -\newcommand{\algocf@caption@ruled}{\box\algocf@capbox\kern2pt\hrule height.8pt depth0pt\kern2pt}% | ||
1501 | -\newcommand{\algocf@caption@algoruled}{\algocf@caption@ruled}% | ||
1502 | -\newcommand{\algocf@caption@boxruled}{% | ||
1503 | - \addtolength{\hsize}{-0.8pt}% | ||
1504 | - \hbox to\hsize{% | ||
1505 | - \vrule%\hskip-0.35pt% | ||
1506 | - \vbox{% | ||
1507 | - \hrule\vskip2\lineskip% | ||
1508 | - \hbox to\hsize{\unhbox\algocf@capbox\hfill}\vskip2\lineskip% | ||
1509 | - }% | ||
1510 | - %\hskip-0.35pt% | ||
1511 | - \vrule% | ||
1512 | - }\vskip-2\lineskip\nointerlineskip% | ||
1513 | - \addtolength{\hsize}{0.8pt}% | ||
1514 | -} | ||
1515 | -% | ||
1516 | -% | ||
1517 | -%%%% set caption for the environment | ||
1518 | - | ||
1519 | -% beamer define is own caption overrinding latex caption! | ||
1520 | -% as we need it, we have put here the original definition | ||
1521 | -\long\def\algocf@latexcaption#1[#2]#3{% original definition of caption | ||
1522 | - \par | ||
1523 | - \addcontentsline{\csname ext@#1\endcsname}{#1}% | ||
1524 | - {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}% | ||
1525 | - \begingroup | ||
1526 | - \@parboxrestore | ||
1527 | - \if@minipage | ||
1528 | - \@setminipage | ||
1529 | - \fi | ||
1530 | - \normalsize | ||
1531 | - \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par | ||
1532 | - \endgroup% | ||
1533 | -} | ||
1534 | - | ||
1535 | -\ifx\beamer@makecaption\undefined% | ||
1536 | -\else% beamer detected | ||
1537 | -\ifx\@makecaption\undefined% | ||
1538 | -\newcommand{\@makecaption}[2]{\relax}% | ||
1539 | -\fi% | ||
1540 | -\fi | ||
1541 | - | ||
1542 | -% | ||
1543 | -% more and more packages redefine \@caption instead of just \@makecaption which makes algorithm2e | ||
1544 | -% caption not works since based on standard \@caption. So we force the definition of \@caption to be | ||
1545 | -% the standard one (the one from LaTeX) inside algorithm environment. | ||
1546 | -% | ||
1547 | -\newcommand{\algocf@setcaption}{% | ||
1548 | - \let\algocf@savecaption=\@caption% | ||
1549 | - \let\@caption=\algocf@latexcaption% | ||
1550 | - \let\algocf@oldmakecaption=\@makecaption% | ||
1551 | - \renewcommand{\@makecaption}[2]{% | ||
1552 | - \expandafter\csname algocf@makecaption@\algocf@style\endcsname{##1}{##2}}% | ||
1553 | -} | ||
1554 | -% | ||
1555 | -%%%%% reset caption | ||
1556 | -% | ||
1557 | -% since we have force the LaTeX caption for algorithm environment, we must go back to the caption | ||
1558 | -% used in the text. | ||
1559 | -\newcommand{\algocf@resetcaption}{% | ||
1560 | - \let\@caption=\algocf@savecaption% | ||
1561 | - \let\@makecaption=\algocf@oldmakecaption% | ||
1562 | -} | ||
1563 | -% | ||
1564 | -%%%%% nocaptionofalgo and restorecaptionofalgo -- | ||
1565 | -\newcommand{\nocaptionofalgo}{% | ||
1566 | - \let\@old@algocf@captiontext=\algocf@captiontext% | ||
1567 | - \renewcommand{\algocf@captiontext}[2]{\AlCapFnt{}##2}% | ||
1568 | -} | ||
1569 | -\newcommand{\restorecaptionofalgo}{% | ||
1570 | - \let\algocf@captiontext=\@old@algocf@captiontext% | ||
1571 | -} | ||
1572 | -% | ||
1573 | -% ---------------------- algocf environment | ||
1574 | -% | ||
1575 | -\newcounter{algocfline} % new counter to make lines numbers be internally | ||
1576 | -\setcounter{algocfline}{0} % different in different algorithms | ||
1577 | -% | ||
1578 | -\expandafter\ifx\csname algocf@within\endcsname\relax% if \algocf@within doesn't exist | ||
1579 | -\newcounter{algocf} % just define a new counter | ||
1580 | -\renewcommand\thealgocf{\@arabic\c@algocf} % and the way it is printed | ||
1581 | -\else% else | ||
1582 | -\newcounter{algocf}[\algocf@within] % counter is numbered within \algocf@within | ||
1583 | -\renewcommand\thealgocf{\csname the\algocf@within\endcsname.\@arabic\c@algocf} | ||
1584 | -\fi | ||
1585 | -% | ||
1586 | -\def\fps@algocf{htbp} % default | ||
1587 | -\def\ftype@algocf{10} % float type | ||
1588 | -\def\ext@algocf{\algocf@list} % loa by default, lof if figure option used | ||
1589 | -\def\fnum@algocf{{\AlCapFnt\AlTitleFnt{\algorithmcfname\nobreakspace\thealgocf}}} | ||
1590 | -\newenvironment{algocf}% % float environment for algorithms | ||
1591 | - {\@float{algocf}}% | ||
1592 | - {\end@float} | ||
1593 | -\newenvironment{algocf*}% % float* environment for algorithms | ||
1594 | - {\@dblfloat{algocf}} | ||
1595 | - {\end@dblfloat} | ||
1596 | - | ||
1597 | -\ifx\l@chapter\undefined% | ||
1598 | -\newcommand\listofalgocfs{ % list of algorithms | ||
1599 | - \section*{\listalgorithmcfname}% | ||
1600 | - \@mkboth{\MakeUppercase\listalgorithmcfname}% | ||
1601 | - {\MakeUppercase\listalgorithmcfname}% | ||
1602 | - \@starttoc{loa}% | ||
1603 | - } | ||
1604 | -\else% | ||
1605 | -%\newcommand\listofalgocfs{% | ||
1606 | -% \if@twocolumn | ||
1607 | -% \@restonecoltrue\onecolumn | ||
1608 | -% \else | ||
1609 | -% \@restonecolfalse | ||
1610 | -% \fi | ||
1611 | -% \chapter*{\listalgorithmcfname}% | ||
1612 | -% \@mkboth{\MakeUppercase\listalgorithmcfname}% | ||
1613 | -% {\MakeUppercase\listalgorithmcfname}% | ||
1614 | -% \@starttoc{loa}% | ||
1615 | -% \if@restonecol\twocolumn\fi | ||
1616 | -% } | ||
1617 | -\fi | ||
1618 | - | ||
1619 | - | ||
1620 | -\newcommand*\l@algocf{\@dottedtocline{1}{1em}{2.3em}}% line of the list | ||
1621 | -% | ||
1622 | -% ---------------------- algorithm environment | ||
1623 | -% | ||
1624 | -%%%%%%% | ||
1625 | -%% | ||
1626 | -%% Algorithm environment definition | ||
1627 | -%% | ||
1628 | -%%%%%%% | ||
1629 | -%% | ||
1630 | -% | ||
1631 | -\newsavebox\algocf@algoframe | ||
1632 | -\def\@algocf@pre@plain{\relax}% action to be done before printing the algo. | ||
1633 | -\def\@algocf@post@plain{\relax}% action to be done after printing the algo. | ||
1634 | -\def\@algocf@capt@plain{bottom}% where the caption should be localized. | ||
1635 | -\def\@algocf@pre@boxed{\noindent\begin{lrbox}{\algocf@algoframe}} | ||
1636 | -\def\@algocf@post@boxed{\end{lrbox}\framebox[\hsize]{\box\algocf@algoframe}\par}% | ||
1637 | -\def\@algocf@capt@boxed{under}% | ||
1638 | -\def\@algocf@pre@ruled{\hrule height.8pt depth0pt\kern2pt}% | ||
1639 | -\def\@algocf@post@ruled{\kern2pt\hrule\relax}% | ||
1640 | -\def\@algocf@capt@ruled{top}% | ||
1641 | -\def\@algocf@pre@algoruled{\hrule height.8pt depth0pt\kern2pt}% | ||
1642 | -\def\@algocf@post@algoruled{\kern2pt\hrule\relax}% | ||
1643 | -\def\@algocf@capt@algoruled{top}% | ||
1644 | -\def\@algocf@pre@boxruled{\noindent\begin{lrbox}{\algocf@algoframe}}% | ||
1645 | -\def\@algocf@post@boxruled{\end{lrbox}\framebox[\hsize]{\box\algocf@algoframe}\par}% | ||
1646 | -\def\@algocf@capt@boxruled{above}% | ||
1647 | -% | ||
1648 | -%% before algocf or figure environment | ||
1649 | -\newcommand{\@algocf@init@caption}{% | ||
1650 | - \@algocf@algotitleofalgo% fix name for \Titleofalgo to \algorithmcfname | ||
1651 | - \algocf@setcaption% set caption to our caption style | ||
1652 | -}% | ||
1653 | -\newcommand{\@algocf@init}{% | ||
1654 | - \refstepcounter{algocfline}% | ||
1655 | - \ifthenelse{\boolean{algocf@optnoend}}{% | ||
1656 | - \renewcommand{\a@block}[2]{\a@group{##1}}% | ||
1657 | - }{% | ||
1658 | - \renewcommand{\a@block}[2]{\a@@block{##1}{##2}}% | ||
1659 | - }% | ||
1660 | -} | ||
1661 | -%% after the end of algocf or figure environment | ||
1662 | -\newcommand{\@algocf@term@caption}{% | ||
1663 | - \algocf@resetcaption% restore original caption | ||
1664 | -}% | ||
1665 | -\newcommand{\@algocf@term}{% | ||
1666 | - \setboolean{algocf@algoH}{false}% no H by default | ||
1667 | - \ifthenelse{\boolean{algocf@optnoend}}{% | ||
1668 | - \renewcommand{\a@block}[2]{\a@@block{##1}{##2}} | ||
1669 | - }{% | ||
1670 | - \renewcommand{\a@block}[2]{\a@group{##1}}% | ||
1671 | - }% | ||
1672 | -} | ||
1673 | -% | ||
1674 | -%%%%%%%%%%%%%%%%% | ||
1675 | -%% makethealgo: macro which print effectively the algo in its box | ||
1676 | -%% | ||
1677 | -\newsavebox\algocf@algobox | ||
1678 | -\newcommand{\algocf@makethealgo}{% | ||
1679 | - \vtop{% | ||
1680 | - % place caption above if needed bye the style | ||
1681 | - \ifthenelse{\equal{\csname @algocf@capt@\algocf@style\endcsname}{above}}% | ||
1682 | - {\csname algocf@caption@\algocf@style\endcsname}{}% | ||
1683 | - % | ||
1684 | - % precommand according to the style | ||
1685 | - \csname @algocf@pre@\algocf@style\endcsname% | ||
1686 | - % place caption at top if needed bye the style | ||
1687 | - \ifthenelse{\equal{\csname @algocf@capt@\algocf@style\endcsname}{top}}% | ||
1688 | - {\csname algocf@caption@\algocf@style\endcsname}{}% | ||
1689 | - % | ||
1690 | - \box\algocf@algobox% the algo | ||
1691 | - % place caption at bottom if needed bye the style | ||
1692 | - \ifthenelse{\equal{\csname @algocf@capt@\algocf@style\endcsname}{bottom}}% | ||
1693 | - {\csname algocf@caption@\algocf@style\endcsname}{}% | ||
1694 | - % postcommand according to the style | ||
1695 | - \csname @algocf@post@\algocf@style\endcsname% | ||
1696 | - % place caption under if needed bye the style | ||
1697 | - \ifthenelse{\equal{\csname @algocf@capt@\algocf@style\endcsname}{under}} | ||
1698 | - {\csname algocf@caption@\algocf@style\endcsname}{}% | ||
1699 | - }% | ||
1700 | -} | ||
1701 | -%%%%%%%%%%%%%%%%%%% | ||
1702 | -% | ||
1703 | -%% at the beginning of algocf or figure environment | ||
1704 | -\newcommand{\@algocf@start}{% | ||
1705 | - \@algoskip% | ||
1706 | - \begin{lrbox}{\algocf@algobox}% | ||
1707 | - \setlength{\algowidth}{\hsize}% | ||
1708 | - \vbox\bgroup% save all the algo in a box | ||
1709 | - \hbox to\algowidth\bgroup\hbox to \algomargin{\hfill}\vtop\bgroup% | ||
1710 | - \ifthenelse{\boolean{algocf@slide}}{\parskip 0.5ex\color{black}}{}% | ||
1711 | - % initialization | ||
1712 | - \addtolength{\hsize}{-1.5\algomargin}% | ||
1713 | - \let\@mathsemicolon=\;\def\;{\ifmmode\@mathsemicolon\else\@endalgoln\fi}% | ||
1714 | - \raggedright\AlFnt{}% | ||
1715 | - \ifthenelse{\boolean{algocf@slide}}{\incmargin{\skipalgocfslide}}{}% | ||
1716 | - \@algoinsideskip% | ||
1717 | - % | ||
1718 | -} | ||
1719 | -% | ||
1720 | -%% at the end of algocf or figure environment | ||
1721 | -\newcommand{\@algocf@finish}{% | ||
1722 | - \@algoinsideskip% | ||
1723 | - \egroup%end of vtop which contain all the text | ||
1724 | - \egroup%end of hbox wich contains [margin][vtop] | ||
1725 | - \ifthenelse{\boolean{algocf@slide}}{\decmargin{\skipalgocfslide}}{}% | ||
1726 | - % | ||
1727 | - \egroup%end of main vbox | ||
1728 | - \end{lrbox}% | ||
1729 | - %\egroup% end of algo box | ||
1730 | - \algocf@makethealgo% print the algo | ||
1731 | - \@algoskip% | ||
1732 | - % restore dimension and macros | ||
1733 | - \setlength{\hsize}{\algowidth}% | ||
1734 | - \lineskip\normallineskip\setlength{\skiptotal}{\@defaultskiptotal}% | ||
1735 | - \let\;=\@mathsemicolon% | ||
1736 | - % | ||
1737 | -} | ||
1738 | -%%%%%%%%%%%%%%%%%%%% | ||
1739 | -%% basic definition of the environment algorithm | ||
1740 | -%% | ||
1741 | - | ||
1742 | -\newboolean{algocf@algoH}\setboolean{algocf@algoH}{false} | ||
1743 | -\newenvironment{algocf@Here}{\noindent% | ||
1744 | - \def\@captype{algocf}% if not defined, caption exit with an error | ||
1745 | -% \hbox\bgroup% | ||
1746 | - \begin{minipage}{\hsize} | ||
1747 | -}{% | ||
1748 | - \end{minipage} | ||
1749 | -% \egroup% | ||
1750 | -}% | ||
1751 | -\newenvironment{\algocf@envname}[1][htbp]{% | ||
1752 | - \@algocf@init% | ||
1753 | - \ifthenelse{\equal{\algocf@float}{figure}}% | ||
1754 | - {\begin{figure}[#1]}% | ||
1755 | - {\@algocf@init@caption\ifthenelse{\equal{#1}{H}}% | ||
1756 | - {\setboolean{algocf@algoH}{true}\begin{algocf@Here}}% | ||
1757 | - {\begin{algocf}[#1]}% | ||
1758 | - }% | ||
1759 | - \@algocf@start% | ||
1760 | - \@ResetCounterIfNeeded% | ||
1761 | - \algocf@linesnumbered% | ||
1762 | -}{% | ||
1763 | - \@algocf@finish% | ||
1764 | - \ifthenelse{\equal{\algocf@float}{figure}}% | ||
1765 | - {\end{figure}}% | ||
1766 | - {\@algocf@term@caption\ifthenelse{\boolean{algocf@algoH}}% | ||
1767 | - {\end{algocf@Here}}% | ||
1768 | - {\end{algocf}}% | ||
1769 | - }% | ||
1770 | - \@algocf@term | ||
1771 | -} | ||
1772 | -%%% | ||
1773 | -%%% algorithm* | ||
1774 | -%%% | ||
1775 | -\newenvironment{\algocf@envname*}[1][htbp]{% | ||
1776 | - \@algocf@init% | ||
1777 | - \ifthenelse{\equal{\algocf@float}{figure}}% | ||
1778 | - {\begin{figure*}[#1]}% | ||
1779 | - {\begin{algocf*}[#1]}% | ||
1780 | - \@algocf@start% | ||
1781 | - \@ResetCounterIfNeeded% | ||
1782 | - \algocf@linesnumbered% | ||
1783 | -}{ | ||
1784 | - \@algocf@finish% | ||
1785 | - \ifthenelse{\equal{\algocf@float}{figure}}% | ||
1786 | - {\end{figure*}}% | ||
1787 | - {\end{algocf*}}% | ||
1788 | - \@algocf@term% | ||
1789 | -} | ||
1790 | -% | ||
1791 | -%%%%%%%%%%%%%%%%%%%%%%% | ||
1792 | -%%% | ||
1793 | -% | ||
1794 | -\expandafter\newcommand\csname\algocf@listofalgorithms\endcsname{% | ||
1795 | - \ifthenelse{\equal{\algocf@float}{figure}}{\listoffigures}{\listofalgocfs} | ||
1796 | -} | ||
1797 | -%%% | ||
1798 | -%%% | ||
1799 | -% | ||
1800 | -% ---------------------- procedure and function environments | ||
1801 | -% | ||
1802 | -% | ||
1803 | -% -- new style (used in particular in the caption of function and procedure environments) | ||
1804 | -% | ||
1805 | -\newcommand{\ProcNameSty}[1]{\FuncSty{#1}}% | ||
1806 | -\newcommand{\SetProcNameSty}[1]{\renewcommand{\ProcNameSty}[1]{\textnormal{\csname#1\endcsname{##1}}}} | ||
1807 | -\newcommand{\ProcArgSty}[1]{\ArgSty{#1}}% | ||
1808 | -\newcommand{\SetProcArgSty}[1]{\renewcommand{\ProcArgSty}[1]{\textnormal{\csname#1\endcsname{##1}}}} | ||
1809 | -% three macros to extract parts of the caption | ||
1810 | -\gdef\algocf@captname#1(#2)#3@{#1} % keep characters before the first brace | ||
1811 | -\gdef\algocf@captparam#1(#2)#3@{#2} % keep character in between the braces | ||
1812 | -\gdef\algocf@captother#1(#2)#3@{#3} % keep character after the braces | ||
1813 | -% | ||
1814 | -%%% Text of caption for Procedure or Function | ||
1815 | -\newcommand{\algocf@captionproctext}[2]{% | ||
1816 | - {\AlCapFnt{}\AlTitleFnt{\algocf@procname} % | ||
1817 | - \ProcNameSty{\algocf@captname #2@}% Name of the procedure in ProcName Style. | ||
1818 | - \ifthenelse{\equal{\algocf@captparam #2@}{\arg@e}}{}% if no argument, write nothing | ||
1819 | - {% else put arguments in ProcArgSty: | ||
1820 | - \ProcNameSty{(}\ProcArgSty{\algocf@captparam #2@}\ProcNameSty{)}% | ||
1821 | - }% endif | ||
1822 | - \algocf@captother #2@% | ||
1823 | - } | ||
1824 | -} | ||
1825 | -%%%% set caption for the environment | ||
1826 | -% unfortunately, makecaption is called with \ignorespace #3 so | ||
1827 | -% we can't do the @currentlabel definition inside \algocf@captionproctext | ||
1828 | -\long\def\algocf@caption@proc#1[#2]#3{% | ||
1829 | - \gdef\@currentlabel{\algocf@captname #3@}% | ||
1830 | - \algocf@old@caption{#1}[\algocf@procname\nobreakspace #2]{\ #3}% | ||
1831 | -}% | ||
1832 | -\newcommand{\algocf@setcaptionproc}{% | ||
1833 | - \let\algocf@oldcaptiontext=\algocf@captiontext% | ||
1834 | - \renewcommand{\algocf@captiontext}[2]{% | ||
1835 | - \algocf@captionproctext{##1}{##2}}% | ||
1836 | - \let\algocf@old@caption=\@caption% | ||
1837 | - \let\@caption=\algocf@caption@proc% | ||
1838 | -} | ||
1839 | -%%%%% reset caption | ||
1840 | -\newcommand{\algocf@resetcaptionproc}{% | ||
1841 | - \let\algocf@captiontext=\algocf@oldcaptiontext% | ||
1842 | - \let\@caption=\algocf@old@caption% | ||
1843 | -} | ||
1844 | -% | ||
1845 | -% | ||
1846 | -%%%%% algocf@proc is the generic environment for procedure and function environment. | ||
1847 | -% | ||
1848 | -\newboolean{algocf@procstar}\setboolean{algocf@procstar}{false} | ||
1849 | -\newenvironment{algocf@proc}[1][htbp]{% | ||
1850 | - \@algocf@proctitleofalgo% set Titleofalgo to Procedure: or Function: | ||
1851 | - % accordingly to the environment | ||
1852 | - \let\old@thealgocf=\thealgocf%\renewcommand{\thealgocf}{--}% | ||
1853 | - \algocf@setcaptionproc% set the text of caption to proc | ||
1854 | - \algocf@setcaption% set caption to our caption style | ||
1855 | - \refstepcounter{algocfline}% | ||
1856 | - \ifthenelse{\equal{\algocf@float}{figure}}{% | ||
1857 | - \ifthenelse{\boolean{algocf@procstar}}{\begin{figure*}[#1]}{\begin{figure}[#1]}% | ||
1858 | - }{% | ||
1859 | - \ifthenelse{\boolean{algocf@procstar}}% | ||
1860 | - {\begin{algocf*}[#1]}% | ||
1861 | - {\ifthenelse{\equal{#1}{H}}% | ||
1862 | - {\setboolean{algocf@algoH}{true}\begin{algocf@Here}}% | ||
1863 | - {\begin{algocf}[#1]}% | ||
1864 | - }% | ||
1865 | - }% | ||
1866 | - \@algocf@start% | ||
1867 | - \@ResetCounterIfNeeded% | ||
1868 | - \algocf@linesnumbered% | ||
1869 | -}{% | ||
1870 | - \@algocf@finish% | ||
1871 | - \ifthenelse{\equal{\algocf@float}{figure}}{% | ||
1872 | - \ifthenelse{\boolean{algocf@procstar}}{\end{figure*}}{\end{figure}}% | ||
1873 | - }{% | ||
1874 | - \ifthenelse{\boolean{algocf@procstar}} | ||
1875 | - {\end{algocf*}} | ||
1876 | - {\ifthenelse{\boolean{algocf@algoH}} | ||
1877 | - {\end{algocf@Here}}% | ||
1878 | - {\end{algocf}}% | ||
1879 | - }% | ||
1880 | - }% | ||
1881 | - \let\thealgocf=\old@thealgocf% | ||
1882 | - \@algocf@term% restore original caption and H boolean | ||
1883 | - \algocf@resetcaptionproc% | ||
1884 | -} | ||
1885 | - | ||
1886 | -% | ||
1887 | -% -- procedure and function environments are defined from algocf@proc environment | ||
1888 | -% | ||
1889 | -\newenvironment{procedure}[1][htbp]% | ||
1890 | -{\setboolean{algocf@procstar}{false}% | ||
1891 | - \newcommand{\algocf@procname}{\@algocf@procname}\begin{algocf@proc}[#1]}% | ||
1892 | -{\end{algocf@proc}} | ||
1893 | -\newenvironment{function}[1][htbp]% | ||
1894 | -{\setboolean{algocf@procstar}{false}% | ||
1895 | - \newcommand{\algocf@procname}{\@algocf@funcname}\begin{algocf@proc}[#1]}% | ||
1896 | -{\end{algocf@proc}} | ||
1897 | -% | ||
1898 | -\newenvironment{procedure*}[1][htbp]% | ||
1899 | -{\setboolean{algocf@procstar}{true}% | ||
1900 | - \newcommand{\algocf@procname}{\@algocf@procname}\begin{algocf@proc}[#1]}% | ||
1901 | -{\end{algocf@proc}} | ||
1902 | -\newenvironment{function*}[1][htbp]% | ||
1903 | -{\setboolean{algocf@procstar}{true}% | ||
1904 | - \newcommand{\algocf@procname}{\@algocf@funcname}\begin{algocf@proc}[#1]}% | ||
1905 | -{\end{algocf@proc}} | ||
1906 | -% | ||
1907 | -% | ||
1908 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
1909 | -% | ||
1910 | -% | ||
1911 | -\newcommand{\Titleofalgo}[1]{\@titleprefix\TitleSty{#1}\par\smallskip} | ||
1912 | -% | ||
1913 | -% | ||
1914 | -% ------------------------- Default Definitions | ||
1915 | -% | ||
1916 | -%% | ||
1917 | -%% | ||
1918 | -% | ||
1919 | -\newcommand{\algocf@defaults@common}{ | ||
1920 | -%\SetKwInOut{AlgDonnees}{Donn\'ees}\SetKwInOut{AlgRes}{R\'esultat} | ||
1921 | -\SetKwInput{Donnees}{Donn\'ees}% | ||
1922 | -\SetKwInput{Res}{R\'esultat}% | ||
1923 | -\SetKwInput{Entree}{Entr\'ees}% | ||
1924 | -\SetKwInput{Sortie}{Sorties}% | ||
1925 | -\SetKw{KwA}{\`a}% | ||
1926 | -\SetKw{Retour}{retourner}% | ||
1927 | -\SetKwBlock{Deb}{d\'ebut}{fin}% | ||
1928 | -\SetKwRepeat{Repeter}{r\'ep\'eter}{jusqu'\`a}% | ||
1929 | -% | ||
1930 | -\SetKwComment{tcc}{/* }{ */} | ||
1931 | -\SetKwComment{tcp}{// }{} | ||
1932 | -% | ||
1933 | -%\SetKwInOut{AlgData}{Data}\SetKwInOut{AlgResult}{Result} | ||
1934 | -\SetKwInput{KwIn}{Input}% | ||
1935 | -\SetKwInput{KwOut}{Output}% | ||
1936 | -\SetKwInput{KwData}{Data}% | ||
1937 | -\SetKwInput{KwResult}{Result}% | ||
1938 | -\SetKw{KwTo}{to} | ||
1939 | -\SetKw{KwRet}{return}% | ||
1940 | -\SetKw{Return}{return}% | ||
1941 | -\SetKwBlock{Begin}{begin}{end}% | ||
1942 | -\SetKwRepeat{Repeat}{repeat}{until}% | ||
1943 | -% | ||
1944 | -% --- German keywords | ||
1945 | -% | ||
1946 | -% \SetKwInOut{AlgDaten}{Daten}%AlgData | ||
1947 | -% \SetKwInOut{AlgErgebnis}{Ergebnis}%AlgResult | ||
1948 | -\SetKwInput{Ein}{Eingabe}%KwIn | ||
1949 | -\SetKwInput{Aus}{Ausgabe}%KwOut | ||
1950 | -\SetKwInput{Daten}{Daten}%KwData | ||
1951 | -\SetKwInput{Ergebnis}{Ergebnis}%KwResult | ||
1952 | -\SetKw{Bis}{bis}%KwTo | ||
1953 | -\SetKw{KwZurueck}{zur\"uck}%KwRet | ||
1954 | -\SetKw{Zurueck}{zur\"uck}%Return | ||
1955 | -\SetKwBlock{Beginn}{Beginn}{Ende}%Begin | ||
1956 | -\SetKwRepeat{Wiederh}{wiederhole}{bis}%Repeat | ||
1957 | -% | ||
1958 | -% --- Czech keywords | ||
1959 | -% | ||
1960 | -% \SetKwInOut{AlgVst}{Vstup}\SetKwInOut{AlgVyst}{V\'{y}stup} | ||
1961 | -\SetKwInput{Vst}{Vstup}% | ||
1962 | -\SetKwInput{Vyst}{V\'{y}stup}% | ||
1963 | -\SetKwInput{Vysl}{V\'{y}sledek}% | ||
1964 | -% | ||
1965 | -% --- Portuguese keywords | ||
1966 | -% | ||
1967 | -% \SetKwInOut{AlgDados}{Dados}\SetKwInOut{AlgResultado}{Result.} | ||
1968 | -\SetKwInput{Entrada}{Entrada}% | ||
1969 | -\SetKwInput{Saida}{Sa\'{i}da}% | ||
1970 | -\SetKwInput{Dados}{Dados}% | ||
1971 | -\SetKwInput{Resultado}{Resultado}% | ||
1972 | -\SetKw{Ate}{at\'{e}} | ||
1973 | -\SetKw{KwRetorna}{retorna}% | ||
1974 | -\SetKw{Retorna}{retorna}% | ||
1975 | -\SetKwBlock{Inicio}{in\'{i}cio}{fim}% | ||
1976 | -\SetKwRepeat{Repita}{repita}{at\'{e}}% | ||
1977 | -% --- End | ||
1978 | -} | ||
1979 | -% | ||
1980 | -% | ||
1981 | -\newcommand{\algocf@defaults@longend}{% | ||
1982 | -\algocf@defaults@common | ||
1983 | -\SetKwIF{gSi}{gSinonSi}{gSinon}{si}{alors}{sinon si}{sinon}{finsi}% | ||
1984 | -\SetKwIF{Si}{SinonSi}{Sinon}{si}{alors}{sinon si}{sinon}{finsi}% | ||
1985 | -\SetKwSwitch{Suivant}{Cas}{Autre}{suivant}{faire}{cas o\`u}{autres cas}{fin d'alternative}% | ||
1986 | -\SetKwFor{Pour}{pour}{faire}{finpour}% | ||
1987 | -\SetKwFor{PourPar}{pour}{faire en parallèle}{finpour}% | ||
1988 | -\SetKwFor{PourCh}{pour chaque}{faire}{finprch}% | ||
1989 | -\SetKwFor{PourTous}{pour tous les}{faire}{finprts}% | ||
1990 | -\SetKwFor{Tq}{tant que}{faire}{fintq}% | ||
1991 | -% | ||
1992 | -\SetKwIF{gIf}{gElsIf}{gElse}{if}{then}{else if}{else}{endif}% | ||
1993 | -\SetKwIF{If}{ElseIf}{Else}{if}{then}{else if}{else}{endif}% | ||
1994 | -\SetKwSwitch{Switch}{Case}{Other}{switch}{do}{case}{otherwise}{endsw}% | ||
1995 | -\SetKwFor{For}{for}{do}{endfor}% | ||
1996 | -\SetKwFor{ForPar}{for}{do in parallel}{endfpar} | ||
1997 | -\SetKwFor{ForEach}{foreach}{do}{endfch}% | ||
1998 | -\SetKwFor{ForAll}{forall the}{do}{endfall}% | ||
1999 | -\SetKwFor{While}{while}{do}{endw}% | ||
2000 | -% | ||
2001 | -% --- German for longend | ||
2002 | -% | ||
2003 | -\SetKwIF{gWenn}{gSonstWenn}{gSonst}{wenn}{dann}{sonst wenn}{sonst}{Ende-wenn}%gIf | ||
2004 | -\SetKwIF{Wenn}{SonstWenn}{Sonst}{wenn}{dann}{sonst wenn}{sonst}{Ende-wenn}%gIf | ||
2005 | -\SetKwSwitch{Unterscheide}{Fall}{Anderes}{unterscheide}{tue}{Fall}{sonst}{Ende-Unt.}%Switch | ||
2006 | -\SetKwFor{Fuer}{f\"ur}{tue}{Ende-f\"ur}%For | ||
2007 | -\SetKwFor{FuerPar}{f\"ur}{tue gleichzeitig}{Ende-gleichzeitig}%ForPar | ||
2008 | -\SetKwFor{FuerJedes}{f\"ur jedes}{tue}{Ende-f\"ur}%ForEach | ||
2009 | -\SetKwFor{FuerAlle}{f\"ur alle}{tue}{Ende-f\"ur}%ForAll | ||
2010 | -\SetKwFor{Solange}{solange}{tue}{Ende-solange}%While | ||
2011 | -% | ||
2012 | -% --- Portuguese | ||
2013 | -% | ||
2014 | -\SetKwIF{gSe}{gSenaoSe}{gSenao}{se}{ent\~{a}o}{sen\~{a}o se}{sen\~{a}o}{fim se}% | ||
2015 | -\SetKwIF{Se}{SenaoSe}{Senao}{se}{ent\~{a}o}{sen\~{a}o se}{sen\~{a}o}{fim se}% | ||
2016 | -\SetKwSwitch{Selec}{Caso}{Outro}{selecione}{fa\c{c}a}{caso}{sen\~{a}o}{fim selec}% | ||
2017 | -\SetKwFor{Para}{para}{fa\c{c}a}{fim para}% | ||
2018 | -\SetKwFor{ParaPar}{para}{fa\c{c}a em paralelo}{fim para} | ||
2019 | -\SetKwFor{ParaCada}{para cada}{fa\c{c}a}{fim para cada}% | ||
2020 | -\SetKwFor{ParaTodo}{para todo}{fa\c{c}a}{fim para todo}% | ||
2021 | -\SetKwFor{Enqto}{enquanto}{fa\c{c}a}{fim enqto}% | ||
2022 | -} | ||
2023 | -% | ||
2024 | -% | ||
2025 | -\newcommand{\algocf@defaults@shortend}{% | ||
2026 | -\algocf@defaults@common | ||
2027 | -\SetKwIF{gSi}{gSinonSi}{gSinon}{si}{alors}{sinon si}{sinon}{fin}% | ||
2028 | -\SetKwIF{Si}{SinonSi}{Sinon}{si}{alors}{sinon si}{sinon}{fin}% | ||
2029 | -\SetKwSwitch{Suivant}{Cas}{Autre}{suivant}{faire}{cas o\`u}{autres cas}{fin}% | ||
2030 | -\SetKwFor{Pour}{pour}{faire}{fin}% | ||
2031 | -\SetKwFor{PourPar}{pour}{faire en parallèle}{fin}% | ||
2032 | -\SetKwFor{PourCh}{pour chaque}{faire}{fin}% | ||
2033 | -\SetKwFor{PourTous}{pour tous les}{faire}{fin}% | ||
2034 | -\SetKwFor{Tq}{tant que}{faire}{fin}% | ||
2035 | -% | ||
2036 | -% | ||
2037 | -\SetKwIF{gIf}{gElsIf}{gElse}{if}{then}{else if}{else}{end}% | ||
2038 | -\SetKwIF{If}{ElseIf}{Else}{if}{then}{else if}{else}{end}% | ||
2039 | -\SetKwSwitch{Switch}{Case}{Other}{switch}{do}{case}{otherwise}{end}% | ||
2040 | -\SetKwFor{For}{for}{do}{end}% | ||
2041 | -\SetKwFor{ForPar}{for}{do in parallel}{end} | ||
2042 | -\SetKwFor{ForEach}{foreach}{do}{end}% | ||
2043 | -\SetKwFor{ForAll}{forall}{do}{end}% | ||
2044 | -\SetKwFor{While}{while}{do}{end}% | ||
2045 | -% | ||
2046 | -% --- German for shortend | ||
2047 | -% | ||
2048 | -\SetKwIF{gWenn}{gSonstWenn}{gSonst}{wenn}{dann}{sonst wenn}{sonst}{Ende}%gIf | ||
2049 | -\SetKwIF{Wenn}{SonstWenn}{Sonst}{wenn}{dann}{sonst wenn}{sonst}{Ende}%gIf | ||
2050 | -\SetKwSwitch{Unterscheide}{Fall}{Anderes}{unterscheide}{tue}{Fall}{sonst}{}%Switch | ||
2051 | -\SetKwFor{Fuer}{f\"ur}{tue}{Ende}%For | ||
2052 | -\SetKwFor{FuerPar}{f\"ur}{tue gleichzeitig}{Ende}%ForPar | ||
2053 | -\SetKwFor{FuerJedes}{f\"ur jedes}{tue}{Ende}%ForEach | ||
2054 | -\SetKwFor{FuerAlle}{f\"ur alle}{tue}{Ende}%ForAll | ||
2055 | -\SetKwFor{Solange}{solange}{tue}{Ende}%While | ||
2056 | -% | ||
2057 | -% --- Portuguese | ||
2058 | -% | ||
2059 | -\SetKwIF{gSe}{gSenaoSe}{gSenao}{se}{ent\~{a}o}{sen\~{a}o se}{sen\~{a}o}{fim}% | ||
2060 | -\SetKwIF{Se}{SenaoSe}{Senao}{se}{ent\~{a}o}{sen\~{a}o se}{sen\~{a}o}{fim}% | ||
2061 | -\SetKwSwitch{Selec}{Caso}{Outro}{selecione}{fa\c{c}a}{caso}{sen\~{a}o}{fim}% | ||
2062 | -\SetKwFor{Para}{para}{fa\c{c}a}{fim}% | ||
2063 | -\SetKwFor{ParaPar}{para}{fa\c{c}a em paralelo}{fim} | ||
2064 | -\SetKwFor{ParaCada}{para cada}{fa\c{c}a}{fim}% | ||
2065 | -\SetKwFor{ParaTodo}{para todo}{fa\c{c}a}{fim}% | ||
2066 | -\SetKwFor{Enqto}{enquanto}{fa\c{c}a}{fim}% | ||
2067 | -} | ||
2068 | -% | ||
2069 | -% | ||
2070 | -\newcommand{\algocf@defaults@noend}{% | ||
2071 | -\renewcommand{\a@block}[2]{\a@group{##1}} | ||
2072 | -\algocf@defaults@common | ||
2073 | -\SetKwIF{gSi}{gSinonSi}{gSinon}{si}{alors}{sinon si}{sinon}{}% | ||
2074 | -\SetKwIF{Si}{SinonSi}{Sinon}{si}{alors}{sinon si}{sinon}{}% | ||
2075 | -\SetKwSwitch{Suivant}{Cas}{Autre}{suivant}{faire}{cas où}{autres cas}{}% | ||
2076 | -\SetKwFor{Pour}{pour}{faire}{}% | ||
2077 | -\SetKwFor{PourPar}{pour}{faire en parallèle}{}% | ||
2078 | -\SetKwFor{PourCh}{pour chaque}{faire}{}% | ||
2079 | -\SetKwFor{PourTous}{pour tous les}{faire}{}% | ||
2080 | -\SetKwFor{Tq}{tant que}{faire}{}% | ||
2081 | -% | ||
2082 | -\SetKwIF{gIf}{gElsIf}{gElse}{if}{then}{else if}{else}{}% | ||
2083 | -\SetKwIF{If}{ElsIf}{Else}{if}{then}{else if}{else}{}% | ||
2084 | -\SetKwSwitch{Switch}{Case}{Other}{switch}{do}{case}{otherwise}{}% | ||
2085 | -\SetKwFor{For}{for}{do}{}% | ||
2086 | -\SetKwFor{ForPar}{for}{do in parallel}{} | ||
2087 | -\SetKwFor{ForEach}{foreach}{do}{}% | ||
2088 | -\SetKwFor{ForAll}{forall}{do}{}% | ||
2089 | -\SetKwFor{While}{while}{do}{}% | ||
2090 | -% --- German for noend | ||
2091 | -\SetKwIF{gWenn}{gSonstWenn}{gSonst}{wenn}{dann}{sonst wenn}{sonst}{}%gIf | ||
2092 | -\SetKwIF{Wenn}{SonstWenn}{Sonst}{wenn}{dann}{sonst wenn}{sonst}{}%gIf | ||
2093 | -\SetKwSwitch{Unterscheide}{Fall}{Anderes}{unterscheide}{tue}{Fall}{sonst}{}%Switch | ||
2094 | -\SetKwFor{Fuer}{f\"ur}{tue}{}%For | ||
2095 | -\SetKwFor{FuerPar}{f\"ur}{tue gleichzeitig}{}%ForPar | ||
2096 | -\SetKwFor{FuerJedes}{f\"ur jedes}{tue}{}%ForEach | ||
2097 | -\SetKwFor{FuerAlle}{f\"ur alle}{tue}{}%ForAll | ||
2098 | -\SetKwFor{Solange}{solange}{tue}{}%While | ||
2099 | -% --- Portuguese | ||
2100 | -\SetKwIF{gSe}{gSenaoSe}{gSenao}{se}{ent\~{a}o}{sen\~{a}o se}{sen\~{a}o}{}% | ||
2101 | -\SetKwIF{Se}{SenaoSe}{Senao}{se}{ent\~{a}o}{sen\~{a}o se}{sen\~{a}o}{}% | ||
2102 | -\SetKwSwitch{Selec}{Caso}{Outro}{selecione}{fa\c{c}a}{caso}{sen\~{a}o}{}% | ||
2103 | -\SetKwFor{Para}{para}{fa\c{c}a}{}% | ||
2104 | -\SetKwFor{ParaPar}{para}{fa\c{c}a em paralelo}{} | ||
2105 | -\SetKwFor{ParaCada}{para cada}{fa\c{c}a}{}% | ||
2106 | -\SetKwFor{ParaTodo}{para todo}{fa\c{c}a}{}% | ||
2107 | -\SetKwFor{Enqto}{enquanto}{fa\c{c}a}{}% | ||
2108 | -} | ||
2109 | -% | ||
2110 | -%% | ||
2111 | -%% | ||
2112 | -%% | ||
2113 | -% | ||
2114 | -% default macros are: | ||
2115 | -\defaultsmacros@algo | ||
2116 | -\SetNoline | ||
2117 | -% | ||
2118 | -% | ||
2119 | -% | ||
2120 | -%% | ||
2121 | -%%% | ||
2122 | -%%%% END | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
doc/bioinfo.cls
deleted
100644 → 0
1 | -\newcommand\classname{bioinfo} | ||
2 | -\newcommand\lastmodifieddate{2003/02/08} | ||
3 | -\newcommand\versionnumber{0.1} | ||
4 | - | ||
5 | -% Are we printing crop marks? | ||
6 | -\newif\if@cropmarkson \@cropmarksontrue | ||
7 | - | ||
8 | -\NeedsTeXFormat{LaTeX2e}[2001/06/01] | ||
9 | -\ProvidesClass{\classname}[\lastmodifieddate\space\versionnumber] | ||
10 | - | ||
11 | -\setlength{\paperheight}{11truein} | ||
12 | -\setlength{\paperwidth}{8.5truein} | ||
13 | - | ||
14 | -\newif\if@final | ||
15 | - | ||
16 | -\DeclareOption{draft}{\PassOptionsToPackage{draft}{graphicx}} | ||
17 | -\DeclareOption{b4paper}{\PassOptionsToPackage{b4}{crop}} | ||
18 | -\DeclareOption{centre}{\PassOptionsToPackage{center}{crop}} | ||
19 | -\DeclareOption{crop}{\PassOptionsToPackage{cam}{crop}\global\@cropmarksontrue} | ||
20 | -\DeclareOption{nocrop}{\PassOptionsToPackage{off}{crop}\global\@cropmarksonfalse} | ||
21 | -\DeclareOption{info}{\PassOptionsToPackage{info}{crop}} | ||
22 | -\DeclareOption{noinfo}{\PassOptionsToPackage{noinfo}{crop}} | ||
23 | -\DeclareOption{final}{\global\@finaltrue} | ||
24 | - | ||
25 | -\ExecuteOptions{b4paper,crop,centre,info} | ||
26 | - | ||
27 | -\ProcessOptions | ||
28 | - | ||
29 | -% Load all necessary packages | ||
30 | -\RequirePackage{inputenc,crop,graphicx,amsmath,array,color,amssymb,flushend,stfloats,amsthm,chngpage,times} | ||
31 | -\RequirePackage[LY1]{fontenc} | ||
32 | - | ||
33 | -\renewcommand{\rmdefault}{ptm} | ||
34 | -\renewcommand{\sfdefault}{phb} | ||
35 | -\renewcommand{\ttdefault}{pcr} | ||
36 | - | ||
37 | -%\RequirePackage[LY1,mtbold]{mathtime} | ||
38 | -\def\helvetica{\fontfamily{phv}\selectfont} | ||
39 | -\def\helveticaitalic{\fontfamily{phv}\itshape\selectfont} | ||
40 | -\def\helveticabold{\fontfamily{phv}\bfseries\selectfont} | ||
41 | -\def\helveticabolditalic{\fontfamily{phv}\bfseries\itshape\selectfont} | ||
42 | -\def\helveticacn{\fontfamily{phv}\fontseries{mc}\fontshape{n}\selectfont} | ||
43 | -\def\helveticacnitalic{\fontfamily{phv}\fontseries{mc}\fontshape{sl}\selectfont} | ||
44 | -\def\helveticacnbold{\fontfamily{phv}\fontseries{bc}\fontshape{n}\selectfont} | ||
45 | -\def\helveticacnbolditalic{\fontfamily{phv}\fontseries{bc}\fontshape{sl}\selectfont} | ||
46 | - | ||
47 | -% Not sure if needed. | ||
48 | -\newcommand\@ptsize{0} | ||
49 | - | ||
50 | -% Set twoside printing | ||
51 | -\@twosidetrue | ||
52 | - | ||
53 | -% Marginal notes are on the outside edge | ||
54 | -\@mparswitchfalse | ||
55 | - | ||
56 | -\reversemarginpar | ||
57 | - | ||
58 | -\renewcommand\normalsize{% | ||
59 | - \@setfontsize\normalsize{8}{11}% | ||
60 | - \abovedisplayskip 11\p@ \@plus2\p@ \@minus5\p@ | ||
61 | - \abovedisplayshortskip \z@ \@plus3\p@ | ||
62 | - \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@ | ||
63 | - \belowdisplayskip \abovedisplayskip | ||
64 | - \let\@listi\@listI} | ||
65 | -\normalsize | ||
66 | -\let\@bls\baselineskip | ||
67 | - | ||
68 | -\newcommand\small{% | ||
69 | - \@setfontsize\small{7}{10}% | ||
70 | - \abovedisplayskip 10\p@ minus 3\p@ | ||
71 | - \belowdisplayskip \abovedisplayskip | ||
72 | - \abovedisplayshortskip \z@ plus 2\p@ | ||
73 | - \belowdisplayshortskip 4\p@ plus 2\p@ minus2\p@ | ||
74 | - \def\@listi{\topsep 4.5\p@ plus 2\p@ minus 1\p@ | ||
75 | - \itemsep \parsep | ||
76 | - \topsep 4\p@ plus 2\p@ minus 2\p@}} | ||
77 | - | ||
78 | -\newcommand\footnotesize{% | ||
79 | - \@setfontsize\footnotesize{8}{10}% | ||
80 | - \abovedisplayskip 6\p@ minus 3\p@ | ||
81 | - \belowdisplayskip\abovedisplayskip | ||
82 | - \abovedisplayshortskip \z@ plus 3\p@ | ||
83 | - \belowdisplayshortskip 6\p@ plus 3\p@ minus 3\p@ | ||
84 | - \def\@listi{\topsep 3\p@ plus 1\p@ minus 1\p@ | ||
85 | - \parsep 2\p@ plus 1\p@ minus 1\p@\itemsep \parsep}} | ||
86 | - | ||
87 | -\def\scriptsize{\@setfontsize\scriptsize{6.5pt}{9.5pt}} | ||
88 | -\def\tiny{\@setfontsize\tiny{5pt}{7pt}} | ||
89 | -\def\large{\@setfontsize\large{11.5pt}{12pt}} | ||
90 | -\def\Large{\@setfontsize\Large{14pt}{16}} | ||
91 | -\def\LARGE{\@setfontsize\LARGE{15pt}{17pt}} | ||
92 | -\def\huge{\@setfontsize\huge{22pt}{22pt}} | ||
93 | -\def\Huge{\@setfontsize\Huge{30pt}{30pt}} | ||
94 | - | ||
95 | -\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm} | ||
96 | -\DeclareOldFontCommand{\sf}{\normalfont\helvetica}{\mathsf} | ||
97 | -\DeclareOldFontCommand{\sfit}{\normalfont\sffamily\itshape}{\mathsf} | ||
98 | -\DeclareOldFontCommand{\sfb}{\normalfont\helveticabold}{\mathsf} | ||
99 | -\DeclareOldFontCommand{\sfbi}{\normalfont\sffamily\bfseries\itshape}{\mathsf} | ||
100 | -\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt} | ||
101 | -\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf} | ||
102 | -\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit} | ||
103 | -\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl} | ||
104 | -\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc} | ||
105 | - | ||
106 | -% Line spacing | ||
107 | -\setlength\lineskip{1\p@} | ||
108 | -\setlength\normallineskip{1\p@} | ||
109 | -\renewcommand\baselinestretch{} | ||
110 | - | ||
111 | -% Paragraph dimensions and inter-para spacing | ||
112 | -\setlength\parskip{0\p@} | ||
113 | -\setlength\parindent{12pt} | ||
114 | - | ||
115 | -% Set inter-para skips | ||
116 | -\setlength\smallskipamount{3\p@ \@plus 1\p@ \@minus 1\p@} | ||
117 | -\setlength\medskipamount{6\p@ \@plus 2\p@} | ||
118 | -\setlength\bigskipamount{12\p@ \@plus 4\p@ \@minus 4\p@} | ||
119 | - | ||
120 | -% Page break penalties | ||
121 | -\@lowpenalty 51 | ||
122 | -\@medpenalty 151 | ||
123 | -\@highpenalty 301 | ||
124 | - | ||
125 | -% Disallow widows and orphans | ||
126 | -\clubpenalty 10000 | ||
127 | -\widowpenalty 10000 | ||
128 | - | ||
129 | -% Disable page breaks before equations, allow pagebreaks after | ||
130 | -% equations and discourage widow lines before equations. | ||
131 | -\displaywidowpenalty 100 | ||
132 | -\predisplaypenalty 10000 | ||
133 | -\postdisplaypenalty 2500 | ||
134 | - | ||
135 | -% Allow breaking the page in the middle of a paragraph | ||
136 | -\interlinepenalty 0 | ||
137 | - | ||
138 | -% Disallow breaking the page after a hyphenated line | ||
139 | -\brokenpenalty 10000 | ||
140 | - | ||
141 | -% Hyphenation; don't split words into less than three characters | ||
142 | -\lefthyphenmin=3 | ||
143 | -\righthyphenmin=3 | ||
144 | - | ||
145 | -% | ||
146 | -% Set page layout dimensions | ||
147 | -% | ||
148 | -\setlength\headheight{16\p@} % height of running head | ||
149 | -\setlength\topmargin{2.5pc} % head margin | ||
150 | -\addtolength\topmargin{-1in} % subtract out the 1 inch driver margin | ||
151 | - | ||
152 | -\setlength\topskip{10\p@} % height of first line of text | ||
153 | -\setlength\headsep{8\p@} % space below running head -- | ||
154 | - | ||
155 | -\setlength\footskip{10\p@} % space above footer line | ||
156 | -\setlength\maxdepth{.5\topskip} % pages can be short or deep by half a line? | ||
157 | - | ||
158 | -\setlength\textwidth{40.5pc} % text measure excluding margins | ||
159 | - | ||
160 | -\setlength\textheight{61\baselineskip} % 54 lines on a full page, | ||
161 | -\addtolength\textheight{\topskip} % including the first | ||
162 | - % line on the page | ||
163 | - | ||
164 | -% Set the margins | ||
165 | -\setlength\marginparsep{3\p@} | ||
166 | -\setlength\marginparpush{3\p@} | ||
167 | -\setlength\marginparwidth{35\p@} | ||
168 | - | ||
169 | -\setlength\oddsidemargin{5.25pc} | ||
170 | -\addtolength\oddsidemargin{-1in} % subtract out the 1 inch driver margin | ||
171 | -\setlength\@tempdima{\paperwidth} | ||
172 | -\addtolength\@tempdima{-\textwidth} | ||
173 | -\addtolength\@tempdima{-5.25pc} | ||
174 | -\setlength\evensidemargin{\@tempdima} | ||
175 | -\addtolength\evensidemargin{-1in} | ||
176 | - | ||
177 | -\setlength\columnsep{1.5pc} % space between columns for double-column text | ||
178 | -\setlength\columnseprule{0\p@} % width of rule between two columns | ||
179 | - | ||
180 | -% Footnotes | ||
181 | -\setlength\footnotesep{9\p@} % space between footnotes | ||
182 | -% space between text and footnote | ||
183 | -\setlength{\skip\footins}{12\p@ \@plus 6\p@ \@minus 1\p@} | ||
184 | - | ||
185 | -% Float placement parameters | ||
186 | - | ||
187 | -% The total number of floats that can be allowed on a page. | ||
188 | -\setcounter{totalnumber}{10} | ||
189 | -% The maximum number of floats at the top and bottom of a page. | ||
190 | -\setcounter{topnumber}{5} | ||
191 | -\setcounter{bottomnumber}{5} | ||
192 | -% The maximum part of the top or bottom of a text page that can be | ||
193 | -% occupied by floats. This is set so that at least four lines of text | ||
194 | -% fit on the page. | ||
195 | -\renewcommand\topfraction{.9} | ||
196 | -\renewcommand\bottomfraction{.9} | ||
197 | -% The minimum amount of a text page that must be occupied by text. | ||
198 | -% This should accomodate four lines of text. | ||
199 | -\renewcommand\textfraction{.06} | ||
200 | -% The minimum amount of a float page that must be occupied by floats. | ||
201 | -\renewcommand\floatpagefraction{.94} | ||
202 | - | ||
203 | -% The same parameters repeated for double column output | ||
204 | -\renewcommand\dbltopfraction{.9} | ||
205 | -\renewcommand\dblfloatpagefraction{.9} | ||
206 | - | ||
207 | -% Space between floats | ||
208 | -\setlength\floatsep {12\p@ \@plus 2\p@ \@minus 2\p@} | ||
209 | -% Space between floats and text | ||
210 | -\setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} | ||
211 | -% Space above and below an inline figure | ||
212 | -\setlength\intextsep {18\p@ \@plus 2\p@ \@minus 2\p@} | ||
213 | - | ||
214 | -% For double column floats | ||
215 | -\setlength\dblfloatsep {12\p@ \@plus 2\p@ \@minus 2\p@} | ||
216 | -\setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} | ||
217 | - | ||
218 | -% Space left at top, bottom and inbetween floats on a float page. | ||
219 | -\setlength\@fptop{0\p@} % no space above float page figures | ||
220 | -\setlength\@fpsep{12\p@ \@plus 1fil} | ||
221 | -\setlength\@fpbot{0\p@} | ||
222 | - | ||
223 | -% The same for double column | ||
224 | -\setlength\@dblfptop{0\p@} | ||
225 | -\setlength\@dblfpsep{12\p@ \@plus 1fil} | ||
226 | -\setlength\@dblfpbot{0\p@} | ||
227 | - | ||
228 | -% Override settings in mathtime back to TeX defaults | ||
229 | -\DeclareMathSizes{5} {5} {5} {5} | ||
230 | -\DeclareMathSizes{6} {6} {5} {5} | ||
231 | -\DeclareMathSizes{7} {7} {5} {5} | ||
232 | -\DeclareMathSizes{8} {8} {6} {5} | ||
233 | -\DeclareMathSizes{9} {9} {6.5} {5} | ||
234 | -\DeclareMathSizes{10} {10} {7.5} {5} | ||
235 | -\DeclareMathSizes{12} {12} {9} {7} | ||
236 | - | ||
237 | -% Page styles | ||
238 | -\def\ps@headings | ||
239 | - {% | ||
240 | -% \def\@oddfoot{\vbox to 12.5\p@{\hbox{\rule{\textwidth}{1\p@}}\vss | ||
241 | -% \hbox to \textwidth{\hfill\helveticabold\small\thepage}% | ||
242 | -% }}% | ||
243 | -% \def\@evenfoot{\vbox to 12.5\p@{\rule{\textwidth}{1\p@}\vss | ||
244 | -% \hbox to \textwidth{\helveticabold\small\thepage\hfill}% | ||
245 | -% }}% | ||
246 | - \let\@oddfoot\@empty% | ||
247 | - \let\@evenfoot\@empty% | ||
248 | - \def\@evenhead{\vbox{\hbox to \textwidth{\fontsize{8}{10}\selectfont | ||
249 | - {\helveticabold{\selectfont\thepage}}\hfill\helveticaitalic{\fontshape{sl}\selectfont | ||
250 | - \strut\leftmark}}\vspace{5\p@}\rule{\textwidth}{1\p@}}}% | ||
251 | - \def\@oddhead{\vbox{\hbox to \textwidth{\fontsize{8}{10}\selectfont | ||
252 | - {\helveticaitalic{\fontshape{it}\selectfont\strut\rightmark}}\hfill{\helveticabold{\thepage}}}% | ||
253 | - \vspace{5\p@}\rule{\textwidth}{1\p@}}}% | ||
254 | - \def\titlemark##1{\markboth{##1}{##1}}% | ||
255 | - \def\authormark##1{\gdef\leftmark{##1}}% | ||
256 | - } | ||
257 | - | ||
258 | -\def\ps@opening | ||
259 | - {% | ||
260 | - \def\@oddfoot{{ | ||
261 | - \hbox to \textwidth{\helvetica | ||
262 | - \fontsize{7}{9}\fontshape{n}\selectfont \copyright\space The Author \@copyrightyear. Published by Oxford University Press. All rights reserved. For permissions, please e-mail: journals.permissions@oup.com% | ||
263 | - \hfill\small\helveticabold\thepage}% | ||
264 | - }}% | ||
265 | - \def\@evenfoot{{ | ||
266 | - \hbox to \textwidth{\helvetica\thepage\hfill | ||
267 | - \fontsize{7}{9}\fontshape{n}\selectfont The Author \@copyrightyear. Published by Oxford University Press. All rights reserved. For permissions, please e-mail: journals.permissions@oup.com}% | ||
268 | - }}% | ||
269 | - \let\@evenhead\relax | ||
270 | - \let\@oddhead\relax} | ||
271 | - | ||
272 | -% Page range | ||
273 | -\newif\iflastpagegiven \lastpagegivenfalse | ||
274 | -\newcommand\firstpage[1]{% | ||
275 | - \gdef\@firstpage{#1}% | ||
276 | - \ifnum\@firstpage>\c@page | ||
277 | - \setcounter{page}{#1}% | ||
278 | - \ClassWarning{BIO}{Increasing pagenumber to \@firstpage}% | ||
279 | - \else \ifnum\@firstpage<\c@page | ||
280 | - \ClassWarning{BIO}{Firstpage lower than pagenumber}\fi\fi | ||
281 | - \xdef\@firstpage{\the\c@page}% | ||
282 | - } | ||
283 | -\def\@firstpage{1} | ||
284 | -\def\pagenumbering#1{% | ||
285 | - \global\c@page \@ne | ||
286 | - \gdef\thepage{\csname @#1\endcsname \c@page}% | ||
287 | - \gdef\thefirstpage{% | ||
288 | - \csname @#1\endcsname \@firstpage}% | ||
289 | - \gdef\thelastpage{% | ||
290 | - \csname @#1\endcsname \@lastpage}% | ||
291 | - } | ||
292 | - | ||
293 | -\newcommand\lastpage[1]{\xdef\@lastpage{#1}% | ||
294 | - \global\lastpagegiventrue} | ||
295 | -\def\@lastpage{0} | ||
296 | -\def\setlastpage{\iflastpagegiven\else | ||
297 | - \edef\@tempa{@lastpage@}% | ||
298 | - \expandafter | ||
299 | - \ifx \csname \@tempa \endcsname \relax | ||
300 | - \gdef\@lastpage{0}% | ||
301 | - \else | ||
302 | - \xdef\@lastpage{\@nameuse{@lastpage@}}% | ||
303 | - \fi | ||
304 | - \fi } | ||
305 | -\def\writelastpage{% | ||
306 | - \iflastpagegiven \else | ||
307 | - \immediate\write\@auxout% | ||
308 | - {\string\global\string\@namedef{@lastpage@}{\the\c@page}}% | ||
309 | - \fi | ||
310 | - } | ||
311 | -\def\thepagerange{% | ||
312 | - \ifnum\@lastpage =0 {\ \bf ???} \else | ||
313 | - \ifnum\@lastpage = \@firstpage \ \thefirstpage\else | ||
314 | - \thefirstpage--\thelastpage \fi\fi} | ||
315 | - | ||
316 | -\AtBeginDocument{\setlastpage | ||
317 | - \pagenumbering{arabic}% | ||
318 | - } | ||
319 | -\AtEndDocument{% | ||
320 | - \writelastpage | ||
321 | - \if@final | ||
322 | - \clearemptydoublepage | ||
323 | - \else | ||
324 | - \clearpage | ||
325 | - \fi} | ||
326 | - | ||
327 | -% | ||
328 | -% Sectional units | ||
329 | -% | ||
330 | - | ||
331 | -% Counters | ||
332 | -\newcounter{section} | ||
333 | -\newcounter{subsection}[section] | ||
334 | -\newcounter{subsubsection}[subsection] | ||
335 | -\newcounter{paragraph}[subsubsection] | ||
336 | -\newcounter{subparagraph}[paragraph] | ||
337 | -\newcounter{figure} | ||
338 | -\newcounter{table} | ||
339 | - | ||
340 | -% Form of the numbers | ||
341 | -\newcommand\thepage{\arabic{page}} | ||
342 | -\renewcommand\thesection{\arabic{section}} | ||
343 | -\renewcommand\thesubsection{{\thesection.\arabic{subsection}}} | ||
344 | -\renewcommand\thesubsubsection{{\thesubsection.\arabic{subsubsection}}} | ||
345 | -\renewcommand\theparagraph{\thesubsubsection.\arabic{paragraph}} | ||
346 | -\renewcommand\thesubparagraph{\theparagraph.\arabic{subparagraph}} | ||
347 | -\renewcommand\theequation{\arabic{equation}} | ||
348 | - | ||
349 | -% Form of the words | ||
350 | -\newcommand\contentsname{Contents} | ||
351 | -\newcommand\listfigurename{List of Figures} | ||
352 | -\newcommand\listtablename{List of Tables} | ||
353 | -\newcommand\partname{Part} | ||
354 | -\newcommand\appendixname{Appendix} | ||
355 | -\newcommand\abstractname{Abstract} | ||
356 | -\newcommand\refname{References} | ||
357 | -\newcommand\bibname{References} | ||
358 | -\newcommand\indexname{Index} | ||
359 | -\newcommand\figurename{Fig.} | ||
360 | -\newcommand\tablename{Table} | ||
361 | - | ||
362 | -% Clearemptydoublepage should really clear the running heads too | ||
363 | -\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}\cleardoublepage}} | ||
364 | - | ||
365 | -% Frontmatter, mainmatter and backmatter | ||
366 | - | ||
367 | -\newif\if@mainmatter \@mainmattertrue | ||
368 | - | ||
369 | -\newcommand\frontmatter{% | ||
370 | - \clearpage | ||
371 | - \@mainmatterfalse | ||
372 | - \pagenumbering{roman}} | ||
373 | - | ||
374 | -\newcommand\mainmatter{% | ||
375 | - \clearpage | ||
376 | - \@mainmattertrue | ||
377 | - \pagenumbering{arabic}} | ||
378 | - | ||
379 | -\newcommand\backmatter{% | ||
380 | - \clearpage | ||
381 | - \@mainmatterfalse} | ||
382 | - | ||
383 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TITLE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
384 | -\newlength{\dropfromtop} | ||
385 | -\setlength{\dropfromtop}{\z@} | ||
386 | - | ||
387 | -% Application Notes | ||
388 | -\newif\if@appnotes | ||
389 | -\newcommand{\application}{% | ||
390 | -% \setlength{\dropfromtop}{-2.25pc}% | ||
391 | - \global\@appnotestrue} | ||
392 | - | ||
393 | -\long\def\title{\@ifnextchar[{\short@title}{\@@title}} | ||
394 | -\def\short@title[#1]{\titlemark{#1}\@@@title} | ||
395 | -\def\@@title#1{\authormark{#1}\@@@title{#1}} | ||
396 | -\long\def\@@@title#1{\gdef\@title{#1}} | ||
397 | -\long\def\subtitle#1{\gdef\@subtitle{#1}} | ||
398 | -\subtitle{Genome analysis} | ||
399 | - | ||
400 | -\long\def\author{\@ifnextchar[{\short@uthor}{\@uthor}} | ||
401 | -\def\short@uthor[#1]{\authormark{#1}\@@author} | ||
402 | -\def\@uthor#1{\authormark{#1}\@@author{#1}} | ||
403 | -\long\def\@@author#1{\gdef\@author{#1}} | ||
404 | - | ||
405 | -\def\vol#1{\global\def\@vol{#1}} | ||
406 | -\def\issue#1{\global\def\@issue{#1}} | ||
407 | -\def\address#1{\global\def\@issue{#1}} | ||
408 | -\def\history#1{\global\def\@history{#1}} | ||
409 | -\def\abstract#1{\global\def\@abstract{#1}} | ||
410 | -\def\editor#1{\global\def\@editor{#1}} | ||
411 | -\def\pubyear#1{\global\def\@pubyear{#1}} | ||
412 | -\def\copyrightyear#1{\global\def\@copyrightyear{#1}} | ||
413 | -\def\address#1{\global\def\@address{#1}} | ||
414 | -\def\corresp#1{\global\def\@corresp{#1}} | ||
415 | -\def\DOI#1{\global\def\@DOI{#1}} | ||
416 | - | ||
417 | -\definecolor{gray}{cmyk}{0, 0, 0, 0.15} | ||
418 | -\definecolor{grayfifty}{cmyk}{0, 0, 0, 0.5} | ||
419 | -\definecolor{graysixtyfive}{cmyk}{0, 0, 0, 0.65} | ||
420 | -\newlength{\extraspace} | ||
421 | -\setlength{\extraspace}{\z@} | ||
422 | - | ||
423 | -\newcommand\maketitle{\par | ||
424 | - \begingroup | ||
425 | - \renewcommand\thefootnote{\@fnsymbol\c@footnote}% | ||
426 | - \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}% | ||
427 | - \long\def\@makefntext##1{\parindent 3mm\noindent | ||
428 | -% \@textsuperscript{\normalfont\@thefnmark}\raggedright##1}% | ||
429 | - \@textsuperscript{\normalfont\@thefnmark}##1}% | ||
430 | - \if@twocolumn | ||
431 | - \ifnum \col@number=\@ne | ||
432 | - \@maketitle | ||
433 | - \else | ||
434 | - \twocolumn[\@maketitle]% | ||
435 | - \fi | ||
436 | - \else | ||
437 | - \newpage\enlargethispage{-23pt} | ||
438 | - \global\@topnum\z@ % Prevents figures from going at top of page. | ||
439 | - \@maketitle | ||
440 | - \fi | ||
441 | - \thispagestyle{opening}\@thanks | ||
442 | - \endgroup | ||
443 | - \setcounter{footnote}{0}% | ||
444 | - \global\let\thanks\relax | ||
445 | - \global\let\maketitle\relax | ||
446 | - \global\let\@maketitle\relax | ||
447 | - \global\let\@address\@empty | ||
448 | - \global\let\@corresp\@empty | ||
449 | - \global\let\@history\@empty | ||
450 | - \global\let\@editor\@empty | ||
451 | - \global\let\@thanks\@empty | ||
452 | - \global\let\@author\@empty | ||
453 | - \global\let\@date\@empty | ||
454 | - \global\let\@subtitle\@empty | ||
455 | - \global\let\@title\@empty | ||
456 | - \global\let\@pubyear\@empty | ||
457 | - \global\let\address\relax | ||
458 | - \global\let\history\relax | ||
459 | - \global\let\editor\relax | ||
460 | - \global\let\title\relax | ||
461 | - \global\let\author\relax | ||
462 | - \global\let\date\relax | ||
463 | - \global\let\pubyear\relax | ||
464 | - \global\let\@copyrightline\@empty | ||
465 | - \global\let\and\relax | ||
466 | - \@afterindentfalse\@afterheading | ||
467 | -\enlargethispage{-23pt}} | ||
468 | - | ||
469 | -\newlength{\aboveskipchk}%for checking oddpage or evenpage top skip | ||
470 | -\setlength{\aboveskipchk}{\z@}% | ||
471 | - | ||
472 | -\def\access#1{\gdef\@access{#1}} | ||
473 | -\access{Advance Access Publication Date: 2 April 2015} | ||
474 | - | ||
475 | -\def\appnotes#1{\gdef\@appnotes{#1}} | ||
476 | -\appnotes{Applications Note} | ||
477 | - | ||
478 | -\def\@maketitle{% | ||
479 | - \let\footnote\thanks | ||
480 | - \clearemptydoublepage | ||
481 | - \checkoddpage\ifcpoddpage\setlength{\aboveskipchk}{-16pt}\else\setlength{\aboveskipchk}{-16pt}\fi%for checking oddpage or evenpage top skip%% | ||
482 | - \vspace*{\aboveskipchk}% | ||
483 | - \vspace{\dropfromtop}% | ||
484 | - \hbox to \textwidth{\raisebox{5pt}[0pt]{% | ||
485 | - \parbox[b]{415pt}{\raggedleft{\helveticacnitalic\fontsize{8}{12}\selectfont {Bioinformatics}}\\[1pt] | ||
486 | - {\helveticacn doi.10.1093/bioinformatics/xxxxxx}\\[1pt] | ||
487 | - {\ifx\@access\@empty | ||
488 | - \else | ||
489 | - {\helveticacn \@access}\fi} | ||
490 | - \vskip1pt | ||
491 | - {\ifx\@appnotes\@empty | ||
492 | - \else | ||
493 | - {\helveticacn \@appnotes}\fi} | ||
494 | - }}% | ||
495 | -%\enskip \parbox[b]{11.3pc}{% | ||
496 | -% \helvetica | ||
497 | -% \flushright\fontsize{8}{10}\fontshape{it}\selectfont | ||
498 | -% Vol. 00\ no. 00 \@pubyear\\ | ||
499 | -% \hfill Pages \thepagerange | ||
500 | -% } | ||
501 | - \hfill\includegraphics{OUP_First_SBk_Bot_8401.eps}} | ||
502 | - \vskip2pt | ||
503 | - \rule{415pt}{2\p@}\par% | ||
504 | - \helvetica | ||
505 | - \hbox to \textwidth{% | ||
506 | - \parbox[t]{36.5pc}{% | ||
507 | - \vspace*{3pt} | ||
508 | - \ifx\@subtitle\@empty | ||
509 | - \else | ||
510 | - {\helveticacn\fontsize{14}{21}\selectfont\raggedright \@subtitle \par}% | ||
511 | - \vspace{7.5\p@} | ||
512 | - \fi | ||
513 | - {\helveticabold\fontsize{18}{23}\selectfont\raggedright \@title \par}% | ||
514 | - \vspace{8.8\p@} | ||
515 | - {\helveticabold\boldmath\fontsize{12}{15}\selectfont\raggedright \@author \par}% | ||
516 | - \vspace{9\p@} | ||
517 | - {\helveticacn\fontsize{9}{12}\selectfont\raggedright \@address \par}% | ||
518 | - \vspace{6\p@} | ||
519 | - {\helveticacn\fontsize{8.5}{12}\selectfont\raggedright \@corresp \par}% | ||
520 | - \vspace{2\p@} | ||
521 | - {\helvetica\fontsize{8.5}{12}\selectfont\raggedright \@editor \par} | ||
522 | - \vspace{4\p@} | ||
523 | - {\helvetica\fontsize{7}{12}\selectfont\raggedright \@history \par} | ||
524 | - \vspace{14\p@} | ||
525 | - { | ||
526 | - \let\section\absection | ||
527 | - {\helvetica\fontsize{10}{12}\bfseries\selectfont Abstract}\par} | ||
528 | - \vskip5pt | ||
529 | - \begingroup\begin{minipage}[t]{415pt}\parindent=0pt | ||
530 | - {\helvetica\fontsize{9}{12}\selectfont \@abstract\par} | ||
531 | - \end{minipage} | ||
532 | - \endgroup | ||
533 | - %\vspace{20\p@} | ||
534 | - }% | ||
535 | - } | ||
536 | - \vspace{13.5\p@}% | ||
537 | - \rule{415pt}{2\p@}% | ||
538 | - \vspace{12\p@ plus 6\p@ minus 6\p@}% | ||
539 | - \vspace{\extraspace} | ||
540 | - } | ||
541 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
542 | - | ||
543 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%% Abstract %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
544 | -\newcommand{\absection}[1]{% | ||
545 | - \par\noindent{\bfseries #1}\space\ignorespaces} | ||
546 | - | ||
547 | -%\newenvironment{abstract}{% | ||
548 | -% \begingroup | ||
549 | -% \let\section\absection | ||
550 | -% \fontfamily{\sfdefault}\fontsize{10}{12}\sffamily\selectfont | ||
551 | -% {\fontseries{b}\selectfont Abstract}\par} | ||
552 | -%{\endgroup\bigskip\@afterheading\@afterindentfalse\vskip 12pt plus 3pt minus 1pt} | ||
553 | - | ||
554 | -% Section macros | ||
555 | - | ||
556 | -% Lowest level heading that takes a number by default | ||
557 | -\setcounter{secnumdepth}{3} | ||
558 | - | ||
559 | -\renewcommand{\@seccntformat}[1]{\csname the#1\endcsname\space} | ||
560 | - | ||
561 | -\def\section{% | ||
562 | - \@startsection{section}{1}{\z@} | ||
563 | - {-22\p@ plus -3\p@}{4\p@} | ||
564 | - {\reset@font\raggedright\helveticabold\fontsize{10}{12}\selectfont}} | ||
565 | - | ||
566 | -\def\subsection{% | ||
567 | - \@startsection{subsection}{2}{\z@} | ||
568 | - {-11\p@ plus -2\p@}{4\p@} | ||
569 | - {\reset@font\raggedright\helvetica\fontsize{9}{12}\selectfont}} | ||
570 | - | ||
571 | -\def\subsubsection{% | ||
572 | - \@startsection{subsubsection}{3}{\z@} | ||
573 | - {-11\p@ plus -1\p@}{0.001em} | ||
574 | - {\reset@font\normalfont\mathversion{bold}\normalsize\bfseries}} | ||
575 | - | ||
576 | -\def\textcolon{\text{\rm :}} | ||
577 | - | ||
578 | - \def\paragraph{% | ||
579 | - \@startsection{paragraph}{4}{\z@} | ||
580 | - {-6\p@} | ||
581 | - {-.4em} | ||
582 | - {\reset@font\itshape}} | ||
583 | - | ||
584 | -% ******************** | ||
585 | -% Figures and tables * | ||
586 | -% ******************** | ||
587 | - | ||
588 | -% Table and array parameters | ||
589 | -\setlength\arraycolsep{.5em} | ||
590 | -\setlength\tabcolsep{.5em} | ||
591 | -\setlength\arrayrulewidth{.5pt} | ||
592 | -\setlength\doublerulesep{2.5pt} | ||
593 | -\setlength\extrarowheight{\z@} | ||
594 | -\renewcommand\arraystretch{1} | ||
595 | - | ||
596 | -\newlength{\abovecaptionskip} | ||
597 | -\newlength{\belowcaptionskip} | ||
598 | -\setlength{\abovecaptionskip}{13pt} | ||
599 | -\setlength{\belowcaptionskip}{2pt} | ||
600 | - | ||
601 | -\long\def\@makecaption#1#2{\vspace{\abovecaptionskip}% | ||
602 | - \begingroup | ||
603 | - \scriptsize\sffamily | ||
604 | - \text{\sfb #1.}\space{#2}\par | ||
605 | - \endgroup} | ||
606 | - | ||
607 | -\long\def\@tablecaption#1#2{% | ||
608 | - \begingroup | ||
609 | - \fontsize{7.5pt}{10.5pt}\sffamily\selectfont | ||
610 | - \textbf{#1.}\space{#2\strut\par} | ||
611 | - \endgroup\vspace{\belowcaptionskip}} | ||
612 | - | ||
613 | -% Table rules | ||
614 | -\def\toprule{\noalign{\ifnum0=`}\fi\hrule \@height 0.5pt \hrule \@height 4pt \@width 0pt \futurelet | ||
615 | - \@tempa\@xhline} | ||
616 | -\def\midrule{\noalign{\ifnum0=`}\fi \hrule \@height 3pt \@width 0pt \hrule \@height 0.5pt | ||
617 | - \hrule \@height 4pt \@width 0pt \futurelet \@tempa\@xhline} | ||
618 | -\def\botrule{\noalign{\ifnum0=`}\fi \hrule \@height 3.75pt \@width 0pt \hrule \@height 0.5pt \futurelet | ||
619 | - \@tempa\@xhline} | ||
620 | -\def\hrulefill{\leavevmode\leaders\hrule height .5pt\hfill\kern\z@} | ||
621 | - | ||
622 | -\def\thefigure{\@arabic\c@figure} | ||
623 | -\def\fps@figure{tbp} | ||
624 | -\def\ftype@figure{1} | ||
625 | -\def\ext@figure{lof} | ||
626 | -\def\fnum@figure{\figurename~\thefigure} | ||
627 | -\def\figure{\@float{figure}} | ||
628 | -\let\endfigure\end@float | ||
629 | -\@namedef{figure*}{\@dblfloat{figure}} | ||
630 | -\@namedef{endfigure*}{\end@dblfloat} | ||
631 | -\def\thetable{\@arabic\c@table} | ||
632 | -\def\fps@table{tbp} | ||
633 | -\def\ftype@table{2} | ||
634 | -\def\ext@table{lot} | ||
635 | -\def\fnum@table{Table~\thetable} | ||
636 | -\def\table{\let\@makecaption\@tablecaption\let\source\tablesource\@float{table}} | ||
637 | -\def\endtable{\end@float} | ||
638 | -\@namedef{table*}{\let\@makecaption\@tablecaption\@dblfloat{table}} | ||
639 | -\@namedef{endtable*}{\end@dblfloat} | ||
640 | - | ||
641 | -\newif\if@rotate \@rotatefalse | ||
642 | -\newif\if@rotatecenter \@rotatecenterfalse | ||
643 | -\def\rotatecenter{\global\@rotatecentertrue} | ||
644 | -\def\rotateendcenter{\global\@rotatecenterfalse} | ||
645 | -\def\rotate{\global\@rotatetrue} | ||
646 | -\def\endrotate{\global\@rotatefalse} | ||
647 | -\newdimen\rotdimen | ||
648 | -\def\rotstart#1{\special{ps: gsave currentpoint currentpoint translate | ||
649 | - #1 neg exch neg exch translate}} | ||
650 | -\def\rotfinish{\special{ps: currentpoint grestore moveto}} | ||
651 | -\def\rotl#1{\rotdimen=\ht#1\advance\rotdimen by \dp#1 | ||
652 | - \hbox to \rotdimen{\vbox to\wd#1{\vskip \wd#1 | ||
653 | - \rotstart{270 rotate}\box #1\vss}\hss}\rotfinish} | ||
654 | -\def\rotr#1{\rotdimen=\ht #1\advance\rotdimen by \dp#1 | ||
655 | - \hbox to \rotdimen{\vbox to \wd#1{\vskip \wd#1 | ||
656 | - \rotstart{90 rotate}\box #1\vss}\hss}\rotfinish} | ||
657 | - | ||
658 | -\newdimen\tempdime | ||
659 | -\newbox\temptbox | ||
660 | - | ||
661 | -% From ifmtarg.sty | ||
662 | -% Copyright Peter Wilson and Donald Arseneau, 2000 | ||
663 | -\begingroup | ||
664 | -\catcode`\Q=3 | ||
665 | -\long\gdef\@ifmtarg#1{\@xifmtarg#1QQ\@secondoftwo\@firstoftwo\@nil} | ||
666 | -\long\gdef\@xifmtarg#1#2Q#3#4#5\@nil{#4} | ||
667 | -\long\gdef\@ifnotmtarg#1{\@xifmtarg#1QQ\@firstofone\@gobble\@nil} | ||
668 | -\endgroup | ||
669 | - | ||
670 | -\def\tablesize{\@setfontsize\tablesize{7.5\p@}{10\p@}} | ||
671 | - | ||
672 | -\newenvironment{processtable}[3]{\setbox\temptbox=\hbox{{\tablesize #2}}% | ||
673 | -\tempdime\wd\temptbox\@processtable{#1}{#2}{#3}{\tempdime}} | ||
674 | -{\relax} | ||
675 | - | ||
676 | -\newcommand{\@processtable}[4]{% | ||
677 | -\if@rotate | ||
678 | -\setbox4=\vbox to \hsize{\vss\hbox to \textheight{% | ||
679 | -\begin{minipage}{#4}% | ||
680 | -\@ifmtarg{#1}{}{\caption{#1}}{\tablesize #2}% | ||
681 | -\vskip7\p@\noindent | ||
682 | -\parbox{#4}{\fontsize{7}{9}\selectfont #3\par}% | ||
683 | -\end{minipage}}\vss}% | ||
684 | -\rotr{4} | ||
685 | -\else | ||
686 | -\hbox to \hsize{\hss\begin{minipage}[t]{#4}% | ||
687 | -\vskip2.9pt | ||
688 | -\@ifmtarg{#1}{}{\caption{#1}}{\tablesize #2}% | ||
689 | -\vskip6\p@\parindent=12pt | ||
690 | -\parbox{#4}{\fontsize{7}{9}\selectfont #3\par}% | ||
691 | -\end{minipage}\hss}\fi}% | ||
692 | - | ||
693 | -\newcolumntype{P}[1]{>{\raggedright\let\\\@arraycr\hangindent1em}p{#1}} | ||
694 | - | ||
695 | -% ****************************** | ||
696 | -% List numbering and lettering * | ||
697 | -% ****************************** | ||
698 | -\def\labelenumi{{\rm\arabic{enumi}.}} | ||
699 | -\def\theenumi{\arabic{enumi}} | ||
700 | -\def\labelenumii{{\rm\alph{enumii}.}} | ||
701 | -\def\theenumii{\alph{enumii}} | ||
702 | -\def\p@enumii{\theenumi} | ||
703 | -\def\labelenumiii{{\rm(\arabic{enumiii})}} | ||
704 | -\def\theenumiii{\roman{enumiii}} | ||
705 | -\def\p@enumiii{\theenumi(\theenumii)} | ||
706 | -\def\labelenumiv{{\rm(\arabic{enumiv})}} | ||
707 | -\def\theenumiv{\Alph{enumiv}} | ||
708 | -\def\p@enumiv{\p@enumiii\theenumiii} | ||
709 | -\def\labelitemi{{\small$\bullet$}} | ||
710 | -\def\labelitemii{{\small$\bullet$}} | ||
711 | -\def\labelitemiii{{\small$\bullet$}} | ||
712 | -\def\labelitemiv{{\small$\bullet$}} | ||
713 | - | ||
714 | -\def\@listI{\leftmargin\leftmargini \topsep\medskipamount} | ||
715 | -\let\@listi\@listI | ||
716 | -\@listi | ||
717 | -\def\@listii{\topsep\z@\leftmargin\leftmarginii} | ||
718 | -\def\@listiii{\leftmargin\leftmarginiii \topsep\z@} | ||
719 | -\def\@listiv{\leftmargin\leftmarginiv \topsep\z@} | ||
720 | -\def\@listv{\leftmargin\leftmarginv \topsep\z@} | ||
721 | -\def\@listvi{\leftmargin\leftmarginvi \topsep\z@} | ||
722 | - | ||
723 | -\setlength{\leftmargini}{3mm} | ||
724 | -\setlength{\leftmarginii}{\z@} | ||
725 | -\setlength{\leftmarginiii}{\z@} | ||
726 | -\setlength{\leftmarginiv}{\z@} | ||
727 | - | ||
728 | -% Changes to the list parameters for enumerate | ||
729 | -\def\enumargs{% | ||
730 | - \partopsep \z@ | ||
731 | - \itemsep \z@ | ||
732 | - \parsep \z@ | ||
733 | - \labelsep 1em | ||
734 | - \listparindent \parindent | ||
735 | - \itemindent \z@ | ||
736 | - \topsep 7\p@ | ||
737 | -} | ||
738 | - | ||
739 | -\def\enumerate{% | ||
740 | - \@ifnextchar[{\@numerate}{\@numerate[0]}} | ||
741 | - | ||
742 | -\def\@numerate[#1]{% | ||
743 | - \ifnum \@enumdepth >3 \@toodeep\else | ||
744 | - \advance\@enumdepth \@ne | ||
745 | - \edef\@enumctr{enum\romannumeral\the\@enumdepth} | ||
746 | - \list{\csname label\@enumctr\endcsname}{% | ||
747 | - \enumargs | ||
748 | - \setlength{\leftmargin}{\csname leftmargin\romannumeral\the\@enumdepth\endcsname} | ||
749 | - \usecounter{\@enumctr} | ||
750 | - \settowidth\labelwidth{#1} | ||
751 | - \addtolength{\leftmargin}{\labelwidth} | ||
752 | - \addtolength{\leftmargin}{2pt} | ||
753 | - \def\makelabel##1{\hss \llap{##1}}}% | ||
754 | - \fi | ||
755 | - } | ||
756 | -\let\endenumerate\endlist | ||
757 | - | ||
758 | -% Changes to the list parameters for itemize | ||
759 | -\def\itemargs{% | ||
760 | - \partopsep \z@ | ||
761 | - \itemsep 0\p@ | ||
762 | - \parsep \z@ | ||
763 | - \labelsep 1em | ||
764 | - \rightmargin \z@ | ||
765 | - \listparindent \parindent | ||
766 | - \itemindent \z@ | ||
767 | - \topsep7\p@ | ||
768 | -} | ||
769 | - | ||
770 | -\def\itemize{% | ||
771 | - \@ifnextchar[{\@itemize}{\@itemize[$\bullet$]}} | ||
772 | - | ||
773 | -\def\@itemize[#1]{% | ||
774 | - \ifnum \@itemdepth >3 \@toodeep\else | ||
775 | - \advance\@itemdepth \@ne | ||
776 | - \edef\@itemctr{item\romannumeral\the\@itemdepth} | ||
777 | - \list{\csname label\@itemctr\endcsname}{% | ||
778 | - \itemargs | ||
779 | - \setlength{\leftmargin}{\csname leftmargin\romannumeral\the\@itemdepth\endcsname} | ||
780 | - \settowidth\labelwidth{#1} | ||
781 | - \addtolength{\leftmargin}{\labelwidth} | ||
782 | - %\addtolength{\leftmargin}{\labelsep} | ||
783 | - \def\makelabel##1{\hss \llap{##1}}}% | ||
784 | - \fi | ||
785 | - } | ||
786 | -\let\enditemize\endlist | ||
787 | - | ||
788 | -\newenvironment{unlist}{% | ||
789 | - \begin{list}{}% | ||
790 | - {\setlength{\labelwidth}{\z@}% | ||
791 | - \setlength{\labelsep}{\z@}% | ||
792 | - \setlength{\topsep}{\medskipamount}% | ||
793 | - \setlength{\itemsep}{3\p@}% | ||
794 | - \setlength{\leftmargin}{2em}% | ||
795 | - \setlength{\itemindent}{-2em}}} | ||
796 | -{\end{list}} | ||
797 | - | ||
798 | - | ||
799 | -% *********************** | ||
800 | -% Quotes and Quotations * | ||
801 | -% *********************** | ||
802 | -\def\quotation{\par\begin{list}{}{ | ||
803 | - \setlength{\topsep}{\medskipamount} | ||
804 | - \setlength{\leftmargin}{2em}% | ||
805 | - \setlength{\rightmargin}{\z@}% | ||
806 | - \setlength\labelwidth{0pt}% | ||
807 | - \setlength\labelsep{0pt}% | ||
808 | - \listparindent\parindent}% | ||
809 | - \item[]} | ||
810 | -\def\endquotation{\end{list}} | ||
811 | -\let\quote\quotation | ||
812 | -\let\endquote\endquotation | ||
813 | - | ||
814 | -\skip\@mpfootins = \skip\footins | ||
815 | -\fboxsep=6\p@ | ||
816 | -\fboxrule=1\p@ | ||
817 | - | ||
818 | -% ******************* | ||
819 | -% Table of contents * | ||
820 | -% ******************* | ||
821 | -\newcommand\@pnumwidth{4em} | ||
822 | -\newcommand\@tocrmarg{2.55em plus 1fil} | ||
823 | -\newcommand\@dotsep{1000} | ||
824 | -\setcounter{tocdepth}{4} | ||
825 | - | ||
826 | -\def\numberline#1{\hbox to \@tempdima{{#1}}} | ||
827 | - | ||
828 | -\def\@authortocline#1#2#3#4#5{% | ||
829 | - \vskip 1.5\p@ | ||
830 | - \ifnum #1>\c@tocdepth \else | ||
831 | - {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip | ||
832 | - \parindent #2\relax\@afterindenttrue | ||
833 | - \interlinepenalty\@M | ||
834 | - \leavevmode | ||
835 | - \@tempdima #3\relax | ||
836 | - \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip | ||
837 | - {\itshape #4}\nobreak | ||
838 | - \leaders\hbox{$\m@th | ||
839 | - \mkern \@dotsep mu\hbox{.}\mkern \@dotsep | ||
840 | - mu$}\hfill | ||
841 | - \nobreak | ||
842 | - \hb@xt@\@pnumwidth{\hfil}% | ||
843 | - \par}% | ||
844 | - \fi} | ||
845 | - | ||
846 | -\newcommand*\l@author{\@authortocline{2}{0pt}{30pt}} | ||
847 | -\newcommand*\l@section{\@dottedtocline{3}{11pt}{20pt}} | ||
848 | -\newcommand*\l@subsection{\@dottedtocline{4}{31pt}{29pt}} | ||
849 | -\newcommand*\l@subsubsection[2]{} | ||
850 | - | ||
851 | - | ||
852 | - | ||
853 | -% *********** | ||
854 | -% Footnotes * | ||
855 | -% *********** | ||
856 | - | ||
857 | -\def\footnoterule{\noindent\rule{\columnwidth}{0.5pt}} | ||
858 | -\def\@makefnmark{\@textsuperscript{\normalfont\@thefnmark}}% | ||
859 | -\newcommand\@makefntext[1]{\noindent{\@makefnmark}\enskip#1} | ||
860 | - | ||
861 | -% *********** | ||
862 | -% References * | ||
863 | -% *********** | ||
864 | - | ||
865 | -\providecommand{\newblock}{} | ||
866 | -\newenvironment{thebibliography}{% | ||
867 | - \section{\bibname}% | ||
868 | - \begingroup | ||
869 | - \small | ||
870 | - \begin{list}{}{% | ||
871 | - \setlength{\topsep}{\z@}% | ||
872 | - \setlength{\labelsep}{\z@}% | ||
873 | - \settowidth{\labelwidth}{\z@}% | ||
874 | - \setlength{\leftmargin}{4mm}% | ||
875 | - \setlength{\itemindent}{-4mm}}\small} | ||
876 | -{\end{list}\endgroup} | ||
877 | - | ||
878 | -\RequirePackage{natbib} | ||
879 | - | ||
880 | -% ********** | ||
881 | -% Appendix * | ||
882 | -% ********** | ||
883 | -\newif\ifappend % Are we in the Appendix? | ||
884 | -\def\appendix{\par | ||
885 | - \setcounter{section}{0} | ||
886 | - \setcounter{subsection}{0} | ||
887 | - \appendtrue | ||
888 | -} | ||
889 | - | ||
890 | -%Math parameters | ||
891 | - | ||
892 | -\setlength{\jot}{5\p@} | ||
893 | -\mathchardef\@m=1500 % adapted value | ||
894 | - | ||
895 | -\def\frenchspacing{\sfcode`\.\@m \sfcode`\?\@m \sfcode`\!\@m | ||
896 | - \sfcode`\:\@m \sfcode`\;\@m \sfcode`\,\@m} | ||
897 | - | ||
898 | -% Theorems | ||
899 | -\def\th@plain{% | ||
900 | -%% \let\thm@indent\noindent % no indent | ||
901 | -\thm@headfont{\quad\scshape}% heading font is bold | ||
902 | -\thm@notefont{\upshape\mdseries}% same as heading font | ||
903 | -\thm@headpunct{.}% no period after heading | ||
904 | -\thm@headsep 5\p@ plus\p@ minus\p@\relax | ||
905 | -%% \let\thm@swap\@gobble | ||
906 | -%% \thm@preskip\topsep | ||
907 | -%% \thm@postskip\theorempreskipamount | ||
908 | -\itshape % body font | ||
909 | -} | ||
910 | - | ||
911 | -\vbadness=9999 | ||
912 | -\tolerance=9999 | ||
913 | -\doublehyphendemerits=10000 | ||
914 | -\doublehyphendemerits 640000 % corresponds to badness 800 | ||
915 | -\finalhyphendemerits 1000000 % corresponds to badness 1000 | ||
916 | - | ||
917 | -\flushbottom | ||
918 | -\frenchspacing | ||
919 | -\ps@headings | ||
920 | -\twocolumn | ||
921 | - | ||
922 | -% Screen PDF compatability | ||
923 | -\newcommand{\medline}[1]{% | ||
924 | - \unskip\unskip\ignorespaces} | ||
925 | - | ||
926 | - | ||
927 | -%%%%for smaller size text | ||
928 | -\newenvironment{methods}{% | ||
929 | - \begingroup | ||
930 | -\def\section{% | ||
931 | - \@startsection{section}{1}{\z@} | ||
932 | - {-24\p@ plus -3\p@}{4\p@} | ||
933 | - {\reset@font\raggedright\helveticabold\fontsize{10}{12}\selectfont}} | ||
934 | - \def\subsection{% | ||
935 | - \@startsection{subsection}{2}{\z@} | ||
936 | - {-11\p@ plus -2\p@}{4\p@} | ||
937 | - {\reset@font\raggedright\helvetica\fontsize{9}{12}\selectfont}} | ||
938 | -\def\subsubsection{% | ||
939 | - \@startsection{subsubsection}{3}{\z@} | ||
940 | - {-11\p@ plus -1\p@}{0.001em} | ||
941 | - {\reset@font\normalfont\mathversion{bold}\normalsize\bfseries}} | ||
942 | -\normalsize | ||
943 | - \par} | ||
944 | -{\par\endgroup\bigskip\@afterheading\@afterindentfalse} | ||
945 | - | ||
946 | - | ||
947 | - | ||
948 | -\graphicspath{{g:/artwork/oup/bioinfo/}} | ||
949 | - | ||
950 | -\language=2 | ||
951 | - | ||
952 | -\hyphenation{Figure Table Figures Tables} | ||
953 | - | ||
954 | -\newcommand{\href}[2]{#2} | ||
955 | - | ||
956 | -\renewenvironment{proof}[1][\proofname]{\par | ||
957 | - \normalfont \topsep6\p@\@plus6\p@\relax | ||
958 | - \labelsep 0.5em | ||
959 | - \trivlist | ||
960 | - \item[\hskip\labelsep\hskip1em\textsc{#1}.]\ignorespaces | ||
961 | -}{\endtrivlist\@endpefalse} | ||
962 | - | ||
963 | -%%Different Bonds | ||
964 | - | ||
965 | -\def\sbond{\ensuremath{\raise.25ex\hbox{${-}\!\!\!\!{-}$}}\kern -.9pt} | ||
966 | -\def\dbond{\ensuremath{\raise.25ex\hbox{=$\!$=}}} | ||
967 | -\def\tbond{\ensuremath{\raise.20ex\hbox{${\equiv}\!\!\!{\equiv}$}}} | ||
968 | - | ||
969 | -% Author queries | ||
970 | -%\fboxsep=4\p@ | ||
971 | -%\fboxrule=0.5\p@ | ||
972 | -\newcommand{\query}[2][0pt]{}% | ||
973 | -% \marginpar{\vspace*{#1}% | ||
974 | -% {\parbox{\marginparwidth}{% | ||
975 | -% \raggedright\fontsize{6}{8}\selectfont | ||
976 | -% #2}}}} | ||
977 | - | ||
978 | -\renewcommand{\dag}{{\mathversion{normal}$^{\dagger}$}} | ||
979 | - | ||
980 | -\endinput | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
doc/fig/Benchmark_avg.jpg
deleted
100644 → 0
217 KB
doc/fig/MOIP_subopt.jpg
deleted
100644 → 0
94 KB
doc/fig/RNA_SSE.png
deleted
100644 → 0
32.4 KB
doc/fig/kernels_B.png
deleted
100644 → 0
56.6 KB
doc/fig/kernels_C.png
deleted
100644 → 0
43.3 KB
doc/fig/kernels_D.png
deleted
100644 → 0
42 KB
doc/fig/pseudoknots.png
deleted
100644 → 0
62.9 KB
doc/graph_abstract.jpg
deleted
100644 → 0
181 KB
doc/kernels_A.jpg
deleted
100644 → 0
123 KB
doc/main_bioinformatics.tex
deleted
100644 → 0
1 | -\documentclass{bioinfo} | ||
2 | -\copyrightyear{2019} \pubyear{2019} | ||
3 | - | ||
4 | -\access{Advance Access Publication Date: Day Month Year} | ||
5 | -\appnotes{Manuscript Category} | ||
6 | - | ||
7 | -\usepackage[ruled,vlined]{algorithm2e} | ||
8 | -\usepackage{xcolor} | ||
9 | - | ||
10 | -\begin{document} | ||
11 | -\firstpage{1} | ||
12 | - | ||
13 | -\subtitle{Subject Section} | ||
14 | - | ||
15 | -\title[BiORSEO]{BiORSEO: A bi-objective method to predict RNA secondary structures with pseudoknots using RNA 3D modules} | ||
16 | -\author[Becquey \textit{et~al}.]{Louis Becquey\,$^{\text{\sfb 1,}*}$, Eric Angel\,$^{\text{\sfb 1}}$ and Fariza Tahi\,$^{\text{\sfb 1}*}$} | ||
17 | -\address{$^{\text{\sf 1}}$IBISC, Univ Evry, Universite Paris-Saclay, 91025, Evry, France} | ||
18 | - | ||
19 | -\corresp{$^\ast$To whom correspondence should be addressed.} | ||
20 | - | ||
21 | -\history{Received on XXXXX; revised on XXXXX; accepted on XXXXX} | ||
22 | - | ||
23 | -\editor{Associate Editor: XXXXXXX} | ||
24 | - | ||
25 | -\abstract{\textbf{Motivation:} RNA loops have been modelled and clustered from solved 3D structures into ordered collections of recurrent non-canonical interactions called "RNA modules", available in databases. This work explores what information from such modules can be used to improve secondary structure prediction. | ||
26 | -We propose a bi-objective method for predicting RNA secondary structures by minimizing both an energy-based and a knowledge-based potential. The tool, called \textsc{BiORSEO}, outputs secondary structures corresponding to the optimal solutions from the Pareto set.\\ | ||
27 | -\textbf{Results:} We compare several approaches to predict secondary structures using inserted RNA modules information: two module data sources, Rna3Dmotif and The RNA 3D Motif Atlas, and different ways to score the module insertions: module size, module complexity, or module probability according to models like JAR3D and BayesPairing. We benchmark them against a large set of known secondary structures, \textcolor{red}{including some state-of-the-art tools, and comment on the usefulness of the half physics-based, half data-based approach}.\\ % Some of the tested methods present a good performance, especially on structures containing pseudoknots. They are compared to state of the art tools for secondary structure prediction.\\ | ||
28 | -\textbf{Availability:} The software \textcolor{red}{is} available for download on the \href{https://evryrna.ibisc.univ-evry.fr/evryrna/BiORSEO/}{EvryRNA website}, as well as the datasets.\\ | ||
29 | -\textbf{Contact:} \href{louis.becquey@univ-evry.fr}{louis.becquey@univ-evry.fr}, \href{fariza.tahi@univ-evry.fr}{fariza.tahi@univ-evry.fr}\\ | ||
30 | -\textbf{Supplementary information:} Supplementary sections are available at \textit{Bioinformatics} | ||
31 | -online.} | ||
32 | - | ||
33 | -\maketitle | ||
34 | - | ||
35 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
36 | -\section{Introduction} | ||
37 | -Ribonucleic acid (RNA) is a macromolecule which is often single-stranded. Therefore, the strand has the ability to fold in space in more complex ways than DNA, that we mostly know to form double-stranded stems. A stem is a succession of basepairs called Watson-Crick basepairs, or "canonical", stacked on top of each other. As this can still happen with RNA, we also observe several other ways for a nucleotide to interact with another. For example, Leontis and Westhof proposed a classification of 12 non-canonical basepairs~(\citealp{leontis2001geometric}). Some of the nucleotides can also interact with the 2'OH of a ribose, or with a phosphate, or even not interact at all and bulge out the RNA structure. | ||
38 | - | ||
39 | -\paragraph{Modelling RNA structures as graphs} ~ | ||
40 | -For modelling purposes, researchers working on computational problems involving RNA represent them with graphs. A recent article~(\citealp{schlick2018adventures}) details the different graph models of RNAs and their respective advantages. | ||
41 | -We are particularly interested in the secondary structure graph of the RNA, i.e. a graph where the nucleotides are nodes, and backbone bonds and canonical basepairs are edges. In this kind of graph, the non-canonical interactions do not appear. | ||
42 | -As the problem of predicting the 3D structure of an RNA from sequence has been too computationally expensive for years, and is still difficult, a common first step has been to predict this secondary structure (2D) graph, by computing what regions will form stems and what regions will \textcolor{red}{not be Watson-Crick basepaired}, forming so-called loops. | ||
43 | -In many cases, the solution to the 2D folding problem is not unique, and RNAs have the ability to switch between several metastable conformations. Most approaches use dynamic programming schemes to compute the RNA partition function and/or canonical pairing probabilities, i.e. the probability for each nucleotide to form a canonical base-pair with every other nucleotide, or to remain unpaired~(\citealp{mccaskill1990equilibrium}). Once the partition function is computed, several models exist to rebuild one or several best structure(s): we can choose the Minimum Free Energy (MFE) structure, the one that maximizes expected accuracy (MEA), or the centroid of the ensemble. The most used implementations are some low complexity implementations such as \texttt{RNAFold} and \texttt{Fold}~(\citealp{lorenz2011viennarna}, \citealp{mathews2004using}). An important limitation of these algorithms is their inability to model so-called \textit{pseudoknotted} structures, i.e. structures with basepairs $(i,j)$ and $(k,l)$ when $i<k<j<l$. | ||
44 | -Later, some variants taking pseudoknots into account were developped, e.g. in the NUPACK package~(\citealp{dirksAlgorithmComputingNucleic2004}) or \texttt{ProbKnot} from the RNAstructure package~(\citealp{bellaousov2010probknot}). | ||
45 | -We can also cite Biokop (\citealp{legendre_bi-objective_2018}), a recent tool that uses both MFE and MEA criterions in a bi-objective framework, and returns optimal and suboptimal structures including pseudoknots. | ||
46 | - | ||
47 | -RNAs can be seen as an assembly of stems and loops. To move from the planar 2D graph to 3D, one usually predicts the 3D structure of stems and loops separately. Stems are relatively easy to tackle because of the isostericity of the Watson-Crick basepairs; their structure has been widely observed and features low variability. On the other hand, to accurately model loops in 3D, one needs to take the non-canonical interactions into account. In many cases, two hairpin loops can even form new canonical basepairs to form \textit{kissing hairpins}, a particular pseudoknot type (called HHH) which is hard to predict because it involves a distant basepair between two unpaired loop regions. More nomenclature details about loops and pseudoknots are provided in Supplementary Section~A. | ||
48 | - | ||
49 | -\paragraph{\textcolor{red}{Modelling loops as modules}} ~ Several works have gathered 3D crystal structures involving RNA chains, extracted the loops from those RNA chains and annotated the base contacts using MC-Annotate (\citealp{gendron2001quantitative}), FR3D (\citealp{sarver_fr3d:_2008}) or DSSR (\citealp{lu_dssr:_2015}). | ||
50 | -They model the loops with more detailed graphs describing non-canonical contacts on their edges. | ||
51 | -The graphs can then be clustered with respect to a similarity or isomorphism measure, and the sequence variations over the nucleotides of the loop can be modeled. | ||
52 | -Those models are called RNA \textit{modules}, i.e. an ordered collection of non-canonical basepairs or stacking interactions, leading to a conserved 3D shape in different RNA molecules. | ||
53 | -We can cite the work from (\citealp{djelloul_automated_2008}) with Rna3Dmotif, a pipeline that extracts terminal hairpin loops (HL), internal loops (IL), and multiple loops (ML) from structures annotated by FR3D, and can cluster them using a graph similarity metric. | ||
54 | -Another one is the RNA 3D Motif Atlas~(\citealp{petrov_automated_2013}), which does not support multiple loops, but clusters the loops using all sequence information, nucleotide contacts and shape information, which leads to loop module models with tolerance in sequence and length variations. | ||
55 | -\textcolor{red}{More recent ones are RNAMotifClusters (\citealp{ge2018novo}), and also} CaRNAval (\citealp{reinharz2018mining}), an approach that enables to model a wide variety of structural features such as multipairs, multi-stranded loops, and pseudoknots. | ||
56 | -To be exhaustive, we also can cite RNA Bricks 2 (\citealp{chojnowski2014rna}), which has the particularity to also study contacts with protein chains. | ||
57 | - | ||
58 | -\textcolor{red}{Further work has been done to help researchers detecting if some RNA sequence folds following some known module model, user-provided, or searched in a database.} | ||
59 | -For example, JAR3D (\citealp{zirbel_identifying_2015}) can score the modules from the RNA 3D Motif Atlas against a query \textcolor{red}{loop} sequence. | ||
60 | -\textcolor{red}{With RMDetect~(\citealp{cruz2011sequence}), the authors proposed to build bayesian networks from any RNA module's graph to summarize all the observed sequence variants of the module. | ||
61 | -The metaRNAmodules pipeline (\citealp{theis2013automated}) can then be used to build bayesian networks for Djelloul \& Denise's modules and detect them in aligned RNA sequences. | ||
62 | -The recent BayesPairing tool (\citealp{sarrazin2019automated}) can do the same for modules from several databases, and allows to detect them in single RNA sequences.} | ||
63 | - | ||
64 | -\paragraph{\textcolor{red}{Secondary structure prediction using RNA modules}} ~ In this paper, \textcolor{red}{we want to test if the knowledge that a subsequence matches well some module model helps identifying a loop in the RNA, when predicting the secondary structure.} | ||
65 | -In other words, we do not use the 3D data to \textcolor{red}{propose 3D conformations for the loops}, but we use it to score 2D conformations. | ||
66 | -A first attempt \textcolor{red}{to use modules to guide RNA 2D structure predictions} is RNA-MoIP~(\citealp{reinharz_towards_2012}). | ||
67 | -The tool \textcolor{red}{inserts modules from Rna3Dmotif in a set of candidate solutions} (often given by a simple tool like RNAsubopt~(\citealp{lorenz2011viennarna})) to \textcolor{red}{return a single} 2D structure with non-canonical base-pairs included, \textcolor{red}{which is then a better input} to give to the 3D reconstruction tool MC-Sym~(\citealp{parisien2008mc}), resulting in better prediction of 3D structures. | ||
68 | -\textcolor{red}{Another example is the use of JAR3D and metaRNAmodules by (\citealp{theis2015rna}) to predict secondary structures at genome-wide scale, using an alignment of 13 genomes. | ||
69 | -This last study shows the use of modules lowers the false discovery rate of secondary structure elements. | ||
70 | -This is encouraging, but as we focus more on short, unaligned single RNA sequences, we compare ourselves to RNA-MoIP in this study. | ||
71 | -Going further than metaRNAmodules, BayesPairing allows to detect modules from more databases and without sequence alignments, so we are rather considering it in this work.} | ||
72 | - | ||
73 | -\textcolor{red}{When inserting modules into secondary structures, RNA-MoIP sometimes has to break basepairs. | ||
74 | -It tries to find a compromise between staying close to the initial structure, and insert more modules. Unfortunately, }it cannot distinguish important base-pairs from less important ones, and might break some of the ones stabilizing a whole stem while inserting a module, resulting in less probable structures as output. \textcolor{red}{Evidence is provided in Supplementary Section B.} | ||
75 | -To \textcolor{red}{overcome this problem}, we design a method which builds a 2D structure by simultaneously placing base-pairs and modules in a single step, taking into account two objectives: the expected accuracy of the structure in the equilibrium ensemble fold, and a custom function that reflects the number and quality of inserted modules (several models are studied). | ||
76 | -This method leads to our new tool BiORSEO (Bi-Objective RNA Structure Efficient Optimizer). | ||
77 | -Our approach avoids using a weighted linear combination of the objectives as done in RNA-MoIP (which can miss interesting \textcolor{red}{so-called \textit{non-supported} solutions}). In this paper, we use a bi-objective Pareto-based approach, i.e. we identify all the non-dominated structures (the structures for which no other structure scores better on the two objectives).\\ | ||
78 | - | ||
79 | -The paper is organized as follows. In the next section, we present the module models sources, the insertion models and some objective functions, and the procedure to compare them. Then we present a benchmark of all those variants against reference tools in Section \ref{sec:results}, using two reference datasets. \textcolor{red}{We also discuss on the usefulness of the module criteria.} | ||
80 | - | ||
81 | -\begin{figure*}[t] | ||
82 | - \includegraphics[width=\textwidth]{graph_abstract.jpg} | ||
83 | - \caption{The information flow in our method. The inputs are the RNA sequence and module models from a database. First, we compute the pairing probabilities based on~(\citealp{dirksAlgorithmComputingNucleic2004}) and the probable insertion sites using 3 different methods listed in Section \ref{sec:models}. Then, we can define two objectives and linear constraints to compute the Pareto set of secondary structures for the input sequence, by solving a bi-objective integer linear program (ILP).} | ||
84 | - \label{fig:pipeline} | ||
85 | -\end{figure*} | ||
86 | - | ||
87 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
88 | -\begin{methods} | ||
89 | -\section{Methods}\label{sec:methods} | ||
90 | -We compare two databases of modules: (1) the module data-set used by RNA-MoIP ~(\citealp{reinharz_towards_2012}), in the DESC file format of Rna3Dmotif~(\citealp{djelloul_automated_2008}); (2) modules from the RNA 3D Motif Atlas v3.2, as provided on the BGSU website, see~(\citealp{petrov_automated_2013}) for more information. Our main procedure is the following: | ||
91 | -\begin{itemize} | ||
92 | -\item \textbf{Pattern-matching step:} Find all possible occurrences of known RNA modules in the query sequence, by finding subsequences of the query that score well with the probabilistic models of the modules (several models are compared). | ||
93 | -\item \textbf{Constraints definition step:} Define constraints on the secondary structure imposed by modules if they would be included (in this case, \textcolor{red}{the closing basepairs of the module are mandatory}). | ||
94 | - \item \textbf{Optimization step:} Find a secondary structure that satisfies as much as possible both the expected accuracy of the structure and a criterion taking into account module inclusions, by solving a bi-objective integer linear programming (ILP) problem, using the constraints defined in the previous step. | ||
95 | -\end{itemize} | ||
96 | - | ||
97 | -The ILP framework used to define the constraints and solve the resulting optimization problem is similar to previous works like IPknot (\citealp{sato_ipknot:_2011}), RNA-MoIP~(\citealp{reinharz_towards_2012}) or Biokop (\citealp{legendre_bi-objective_2018}). | ||
98 | -We chose the ILP approach because it has proven its outperformance with IPknot and Biokop when it comes to pseudoknot prediction, see (\citealp{legendre_bi-objective_2018}). In particular, any type of pseudoknot can be predicted. | ||
99 | - | ||
100 | -Figure \ref{fig:pipeline} summarizes the \textcolor{red}{whole} procedure on a graphical pipeline. | ||
101 | - | ||
102 | -\subsection{Pattern matching step}\label{sec:models} | ||
103 | -Several methods have been proposed to determine if a sequence (or a part of it) is likely to fold following a given module. \textcolor{red}{We benchmarked the following ones:} | ||
104 | - | ||
105 | -\paragraph{Direct pattern matching} ~ The simplest approach when no statistical model is available is to use a regular expression and direct pattern matching against the input sequence. This is the approach used by RNA-MoIP. We used it with the Rna3Dmotif data as presented in RNA-MoIP's article ~(\citealp{reinharz_towards_2012}), dealing with special cases in the same way (very short components, wildcards). | ||
106 | - | ||
107 | -\paragraph{JAR3D} ~ For each motif group in the RNA 3D Motif Atlas, \textcolor{red}{~(\citealp{zirbel_identifying_2015}) built} a probabilistic model for sequence variability. | ||
108 | -Their implementation, called JAR3D, takes user-provided loop sub-sequences in input and outputs a score for every motif of the Atlas on every provided loop. This method has the advantage to allow variations in sequence length compared to the module model. Unfortunately, it can only be used for hairpin and internal loops. Another major drawback is that it requires the computation of the pairing probabilities to first locate \textit{where} the most probable loops are, to give them as input to JAR3D. We therefore use RNAsubopt first to get the positions of the probable loops. JAR3D has been developed for modules from the RNA 3D Motif Atlas and can only be tested with them. | ||
109 | - | ||
110 | -\paragraph{\textcolor{red}{BayesPairing's sequence probability distributions}} ~ When we have data for several instances of a module, we can estimate a probabilistic distribution of the nucleotides over the module nodes. A first intuitive approach is to use the base frequencies. But as paired nucleotides are not independent at all, it is more rigorous to model those dependencies. An approach proposed in ~(\citealp{cruz2011sequence}) is to transform the module's graph into a Bayesian network, which models the dependencies between nucleotide probabilities at every node of the graph. | ||
111 | -\textcolor{red}{BayesPairing~(\citealp{sarrazin2019automated}) automates the building of bayesian networks for every module.} | ||
112 | -A large number of sequences are sampled using the Bayesian network, and they are pattern-matched against the query to find occurrences. | ||
113 | -An additional step compares the free energy of the structure with and without the constraint of each matched module, and selects only the candidate sites that do not deteriorate too much the energy. | ||
114 | -This last step is \textcolor{red}{not required here}, first because it \textcolor{red}{repeats the calculation} of the partition function, and then because we would try to insert modules \textcolor{red}{with BiORSEO} that were pre-selected \textcolor{red}{by BayesPairing} to be appropriate. | ||
115 | -Therefore we chose to ignore this last step and let our optimizer select the pertinent modules in the candidates. BayesPairing can be used for both data sources. | ||
116 | - | ||
117 | - | ||
118 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
119 | -\subsection{Constraints definition step and IP model} \label{sec:ip} | ||
120 | -The full list of variables we used to model the problem in an integer linear program and the linear formulation of each constraint are detailed in Supplementary Section C. Here we propose different objective functions to score the candidate module insertions. %, whose performances are compared in section \ref{sec:results}. | ||
121 | - | ||
122 | -\paragraph{Notations} ~ We call \textit{component} a piece of strand which forms an unpaired portion of a module. A HL has one, an IL or bulge has two, and a ML has more (see Supplementary Section A). Components of a module are linked together by canonical base-pairs at their extremities to form a loop. Let $x$ be a module which could be inserted at some defined position in the sequence. Let $\|x\|$ be the number of components of this module, and $k_{x,i}$ the nucleotide count of the $i$th component of $x$. When a scoring model is used (JAR3D or BayesPairing), we denote $p(x)$ the score value of $x$ inserted at the defined position. Let $p_{uv}$ be the probability for nucleotides $u$ and $v$ (with $v>u+3$) to form a canonical base-pair. We use NUPACK's dynamic programming scheme~(\citealp{dirksAlgorithmComputingNucleic2004}), which supports pseudoknots, to compute such probabilities. We denote $y^u_v$ the binary decision variable indicating that these nucleotides do form a canonical base pair, and $C^x_1$ the decision binary variable indicating whether the module $x$ will be inserted or not. The resolution of the ILP outputs solutions by fixing definitive values for the different $y^u_v$ and $C^x_1$. | ||
123 | - | ||
124 | -\paragraph{Objective functions} ~ The more modules that are included, the more information about set and unset base-pairs, and eventually about tertiary folds of the loops in space. | ||
125 | -So maximizing the number of modules could be a valid criteria. But, a disadvantage of such a criteria is that it penalizes MLs with large $\|x\|$, because the insertion of a ML forbids at the same time the insertion of several ILs or bulges in place. | ||
126 | -RNA-MoIP uses the sum of the squared nucleotide count over the components to try to encourage large modules~(\citealp{reinharz_towards_2012}). This is our first benchmarked criteria $f_{1A}$. | ||
127 | -Conversely, we could also try to maximize the number of components $\|x\|$ in the module. | ||
128 | -Then, we \textcolor{red}{also could} penalize a module insertion by the logarithm of the number of nucleotides involved in the looped zone (sum of the $k_{x,i}$) to avoid very long unpaired zones. | ||
129 | -We introduce such a penalty in criteria $f_{1B}$. We also define two more criteria, $f_{1C}$ which uses only the score returned by JAR3D or BayesPairing, and $f_{1D}$ which includes all the presented terms. | ||
130 | -Let $X$ be the set of all our decision variables, then the different objective functions to maximize are: | ||
131 | -\begin{equation}f_{1A}(X) = \sum_{x} \sum_{i=1}^{\|x\|} k_{x,i}^2 \times C^x_1\label{eq:A}\end{equation} | ||
132 | -\begin{equation}f_{1B}(X) = \sum_{x} \left[ \frac{\|x\|}{\log_2(\sum_{i=1}^{\|x\|}k_{x,i})} \times C^x_1 \right] \label{eq:B}\end{equation} | ||
133 | -\begin{equation}f_{1C}(X) = \sum_{x} p(x) \times C^x_1 \label{eq:C}\end{equation} | ||
134 | -\begin{equation}f_{1D}(X) = \sum_{x} \left[ \frac{\|x\|}{\log_2(\sum_{i=1}^{\|x\|}k_{x,i})} \times p(x) \times C^x_1 \right]\label{eq:D}\end{equation} \\ | ||
135 | -Regarding the second objective, aimed at maximizing the expected accuracy of the structures, we use $f_2(X) = \sum y^u_v \times p_{uv} \times I[p_{uv}>\theta]$. As first proposed by~(\citealp{sato_ipknot:_2011}), $f_2$ uses a parameter $\theta = 0.001$ to ignore very unlikely base-pairs. This prevents the explosion of the number of variables and allows a fast resolution of the IP problem. | ||
136 | - | ||
137 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
138 | -\subsection{Optimization step} | ||
139 | -We use a simple dichotomic search algorithm (presented in Figure \ref{fig:findP}) to find the Pareto set of the bi-objective problem. On the first pass of the dichotomy, it solves iteratively a mono-objective problem with a constraint on the second objective, requiring it to be in an interval $[\lambda_{min}, \lambda_{max}]$. For example, if we decide to maximize objective 1; every-time a new non-dominated solution is found, $\lambda_{min}$ is set just above the new solution's objective 2 value. We then search and find another solution with a worse objective 1 value but a higher objective 2 value than previously found solutions. The second pass of the dichotomy searches below newly found solutions. In fact, it is required to search for superposed solutions to Pareto optimal ones. This is important when the criteria used to rank inserted modules is not able to separate them very well; many solutions therefore get the same $f_1$ score. This algorithm is implemented in C++ using the CPLEX solver concert technology (\href{https://www.ibm.com/analytics/optimization-modeling-interfaces}{ILOG CPLEX Optimizer 12.8}). | ||
140 | -\begin{figure}[!tbp] | ||
141 | -\begin{algorithm}[H] | ||
142 | -F:= $\emptyset$\; | ||
143 | -\tcp{find the extrema of the Pareto front:} | ||
144 | -L1:= maximize($f_1$, $-\infty$, $+\infty$, F)\; | ||
145 | -L2:= maximize($f_2$, $-\infty$, $+\infty$, F)\; | ||
146 | -\tcp{Add L1 to the results:} | ||
147 | -\textit{R} := $\{$L1$\}$\; | ||
148 | -\tcp{search on top of L1:} | ||
149 | -search\_between($f_2(\text{L1}) + \epsilon$, $f_2(\text{L2})$)\; | ||
150 | -\tcp{search if solutions superposed to L1 exist:} | ||
151 | -search\_between($-\infty$, $f_2(\text{L1})$)\; | ||
152 | -\Return{R}\; | ||
153 | -\caption{FindParetoSet()} | ||
154 | -\end{algorithm} | ||
155 | - | ||
156 | -\begin{algorithm}[H] | ||
157 | -$s$:= maximize($f_1$, $\lambda_{min}$, $\lambda_{max}$, F)\; | ||
158 | -\If{$s \neq \emptyset$}{ | ||
159 | - F:= F $\cup \{s\}$\; | ||
160 | - \If{$\nexists x \in R$ \textcolor{red}{such that} $x>s$}{ | ||
161 | - \tcp{solution is undominated, add it to \textit{R}} | ||
162 | - \textit{R} := \textit{R} $\cup \{s\}$\; | ||
163 | - \While{$\exists x \in R$ \textcolor{red}{such that} $s>x$}{ | ||
164 | - \tcp{remove dominated solutions} | ||
165 | - \textit{R} := \textit{R}$\setminus \{x\}$\; | ||
166 | - } | ||
167 | - \tcp{search on top of $s$} | ||
168 | - search\_between($f_2(s) + \epsilon$, $\lambda_{max}$)\; | ||
169 | - \If{$\lambda_{max} - \lambda_{min} > \epsilon$}{ | ||
170 | - \tcp{search if another solution superposed to $s$ exists} | ||
171 | - search\_between($\lambda_{min}$, $f_2(s)$)\; | ||
172 | - } | ||
173 | - } | ||
174 | -} | ||
175 | -\caption{search\_between($\lambda_{min}$, $\lambda_{max}$)} | ||
176 | -\end{algorithm} | ||
177 | - | ||
178 | -\caption{The dichotomic search algorithm to find the Pareto set. F is the ensemble of already-found structures which grows over time, and that we forbid the solver to find again. R is the set of Pareto-optimal solutions. L1 and L2 are the best solutions to the mono-objective problems regarding $f1$ and $f2$. $\mathbf{maximize}$($f$, $\lambda_{min}$, $\lambda_{max}$, F) is a procedure that \textcolor{red}{maximizes} the function $f$ (mono-objective IP problem) under the constraint that the other one has to be in interval $[\lambda_{min}$, $\lambda_{max}]$, and with the solutions in F forbidden. The inequality sign $a>b$ between two solutions denotes that solution $a$ dominates solution $b$.}\label{fig:findP} | ||
179 | -\end{figure} | ||
180 | -\end{methods} | ||
181 | - | ||
182 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
183 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
184 | -\section{Results}\label{sec:results} | ||
185 | -\begin{figure*}[!tbp] | ||
186 | - \includegraphics[width=\textwidth]{Benchmark_unconstrained.jpg} | ||
187 | - \caption{\textcolor{red}{First, second and third quartiles of the max MCC for each RNA, for all tools and BiORSEO variants.} | ||
188 | - (A); Results of the methods that cannot find pseudoknots on the RNA-Strand dataset: RNAsubopt, RNA-MoIP, and the 14 variants of BiORSEO's bi-objective methods with a constraint that explicitly forbids pseudoknots. | ||
189 | - (B); Results of the methods which allow pseudoknot predictions on the RNA-Strand dataset: Biokop, and the 14 BiORSEO variants without the no-pseudoknot constraint. | ||
190 | - (C); Results of every method on the Pseudobase dataset. | ||
191 | - \textcolor{red}{Due to the combinatorial issues commented in section \ref{sec:mat}, we counted only RNAs that could be predicted with every method: 287/344 in (A), 281/344 in (B), and 236/264 in (C).}} | ||
192 | - \label{fig:benchmark} | ||
193 | -\end{figure*} | ||
194 | -All the method \textcolor{red}{variants} introduced return an ensemble of possible secondary structures \textcolor{red}{(the Pareto set)} for a given input sequence. | ||
195 | -We compare them in a benchmark. \textcolor{red}{A small case study on three well known RNAs can be found in Supplementary Section D.} | ||
196 | -\subsection{Benchmark protocol} \label{sec:bench} | ||
197 | - | ||
198 | -\paragraph{Benchmark data sources} \label{sec:data} | ||
199 | -A first dataset of RNA secondary structures was extracted from the RNA-Strand database ~(\citealp{andronescu2008rna}). We selected the RNAs for which experimental proof of the structure exists, with size varying between 10 and 100 nucleotides. Sequences containing modified nucleotides were discarded. The resulting set contains 344 secondary structures of various RNA families, 74 of them containing pseudoknots. We repeated the experiments twice: first, by forbidding explicitly the formation of pseudoknots with additional constraints (for fair comparison with RNA-MoIP). | ||
200 | -Then, a second experiment without such limitation, to reach maximum performance. In addition, to explicitly assess the performance on pseudoknotted RNAs, methods were tested on a second collection of 264 pseudoknotted-only RNAs from the Pseudobase database~(\citealp{van2000pseudobase}), covering all pseudoknot families, and of the same length range. | ||
201 | - | ||
202 | -\paragraph{Reference comparison methods} | ||
203 | -To study the usefulness of the module data sources, objective functions, and module placement methods, we added state-of-the art tools to the comparison. | ||
204 | -The same RNA sequences were submitted to RNAsubopt + RNA-MoIP for direct performance comparison. | ||
205 | -\textcolor{red}{In 'one by one' mode, RNA-MoIP inserts modules in every solution from RNAsubopt one by one, and we select the best solution ourselves like we do with BiORSEO (see the following paragraph \textit{Metrics}). In 'chunk' mode, RNA-MoIP takes all the RNAsubopt predictions at once and returns only one solution, supposed to be the best in the input set according to its own objective function.} | ||
206 | -We used RNAsubopt as a reference method without pseudoknot support, because it is fast, widely used, easy to understand and returns several solutions \textcolor{red}{that are in an energy range from the MFE (default parameter used)}. | ||
207 | -We used Biokop, \textcolor{red}{another} bi-objective ILP framework, as a reference method for prediction of secondary structures with pseudoknots. | ||
208 | -Both tools \textcolor{red}{RNAsubopt and Biokop out-perform} other state-of-the-art tools in their respective categories \textcolor{red}{(see (\citealp{lorenz2011viennarna}) and (\citealp{legendre_bi-objective_2018})} for more benchmarks against other tools\textcolor{red}{)}. | ||
209 | - | ||
210 | -\paragraph{Metrics} ~ We compute the Matthews correlation coefficient (MCC) between the real secondary structure and every proposed structure. | ||
211 | -The coefficient is defined as: | ||
212 | -{\small | ||
213 | -\begin{equation} | ||
214 | - MCC = \frac{TP. TN - FP. FN}{\sqrt{(TP+FP)(TP+FN)(TN+FP)(TN+FN)}}. \label{eq:MCC} | ||
215 | -\end{equation} | ||
216 | -}\noindent | ||
217 | -where TP, TN, FP and FN are the number of true/false positive and negative predicted base pairs. | ||
218 | -\textcolor{red}{The choice of MCC over accuracy or F1 score is justified by the large difference between the size of the classes: in any secondary structure, there exist much more pairs of nucleotides that do not interact than pairs that do. | ||
219 | -Here, we wonder if the "true" structure (which is only a possible state that has been observed and reported in a database) can be found in the Pareto set. | ||
220 | -Therefore, we chose to keep the maximum MCC value found over the set of proposed structures as a metric of the method's performance, showing that a solution is close or not to this "true" structure. This is, to our knowledge, the best way to relate if the reference structure is part of our ensemble of solutions.} For comprehensiveness, results with average MCC are also provided in Supplementary Section E. | ||
221 | - | ||
222 | - | ||
223 | -\subsection{Benchmark results} | ||
224 | -Performance results under the form of \textcolor{red}{maximum} MCC are summarized in Figure \ref{fig:benchmark}. No data source, nor objective function taken alone performs significantly better than the other ones. | ||
225 | -Without pseudoknots, RNAsubopt out-performs the other tools (see Figure \ref{fig:benchmark}(A)). The second most performing model is \textcolor{red}{BiORSEO, using Rna3Dmotifs modules, placed by regular expression searches only, and scored with module size ($f_{1A}$). } With pseudoknots support, most of the RNAs are predicted with small pseudoknots as the method allows it. As Figure \ref{fig:benchmark}(B) shows, the methods \textcolor{red}{are still all very close in terms of performance, including Biokop} which performs \textcolor{red}{as well} without module information. \textcolor{red}{The best BiORSEO variant is the same, and it out-performs Biokop for 60 RNAs, which is only 17\% of the cases. } | ||
226 | -The results on the dataset of pseudoknotted-only structures are presented on Figure~\ref{fig:benchmark}(C). | ||
227 | -\textcolor{red}{Again}, the 14 variants are very close and no module source, pattern-matching method nor objective function distinguishes itself. \textcolor{red}{But this time, Biokop performs better in average.} | ||
228 | - | ||
229 | -\paragraph{\textcolor{red}{Number of solutions}} ~ \textcolor{red}{As shown in Figure~\ref{fig:nsol}}, \textcolor{red}{all the BiORSEO models} return very small sets of unique secondary structures, some of them being one optimal solution sometimes for example when using JAR3D. Meanwhile, RNAsubopt returns from one to \textcolor{red}{tens} of solutions (with \textcolor{red}{default energy gap} settings)\textcolor{red}{, and Biokop even more. The RNA-MoIP goal is conserved here with our approach: identify a secondary structure among the MEA suboptimals (or a few, but rarely more than 5) based on its compatibility with known modules. Note that the selection of the max MCC solution in the results set naturally favors RNAsubopt and Biokop in our benchmark since they return way more solutions.} | ||
230 | -\begin{figure}[!tbp] | ||
231 | - \includegraphics[width=\linewidth]{Nsol.jpg} | ||
232 | - \caption{\textcolor{red}{Number of unique secondary structures in the Pareto set or returned ensemble. Data is from the RNAStrand dataset. Pseudoknots are allowed. Note that this is not the size of the Pareto set, one unique secondary structure can often be found several times in the Pareto set, with different module combinations inserted in. The default RNA-MoIP usage, labelled "chunk" here, always returns only one solution selected by itself.}} | ||
233 | - \label{fig:nsol} | ||
234 | -\end{figure} | ||
235 | -\begin{figure}[!tbp] | ||
236 | - \includegraphics[width=\linewidth]{Nmotifs.jpg} | ||
237 | - \caption{\textcolor{red}{(A) Maximum number of modules inserted in a solution of the set. (B) Ratio of the number of modules inserted in the solution which is closest to the true structure (i.e. the max MCC solution) and the maximum number of inserted modules in a solution. Only RNAs for which the Pareto set contains more than one solution are counted (the count is given under the distribution). Data is from the RNAStrand dataset. Pseudoknots are allowed.}} | ||
238 | - \label{fig:info} | ||
239 | -\end{figure} | ||
240 | -\begin{figure*}[!tbp] | ||
241 | - \includegraphics[width=\linewidth]{kernels_A.jpg} | ||
242 | - \caption{\textcolor{red}{Position of the best solution in the Pareto set for 4 variants using objective $f_{1A}$, after normalization on both axis. Computed on the RNA-Strand dataset with pseudoknots allowed. RNAs for which the Pareto set is a single optimal solution, or a set of solutions with the same secondary structure but different modules inserted into it, are ignored. The final number of considered RNAs is given on the figure.}} | ||
243 | - \label{fig:pareto} | ||
244 | -\end{figure*} | ||
245 | -\textcolor{red}{ | ||
246 | -\subsection{Usefulness of the two objectives} | ||
247 | -To further study the RNA modules criteria usefulness, we looked at the maximum number of inserted modules over the Pareto solutions proposed for each RNA (Figure~\ref{fig:info}(A)), and the ratio between the number of inserted modules in the best prediction in the Pareto set (the max MCC solution) and this maximum number (Figure~\ref{fig:info}(B)). | ||
248 | -When this ratio is 1, the best solution is the one with the most modules detected in (or one of the solutions with the most modules). The results show that in large majority, this ratio is 1. | ||
249 | -In particular, the variants which use direct pattern matching can insert more modules in average (up to 12) and this ratio is always at one. This is encouraging, showing that the best solutions do contain a lot of modules inserted.\\ | ||
250 | -Then, we display a solution space plot where we report the position of the best solution in the Pareto set after a normalization step, to directly observe where the best solutions are located in the MEA and RNA modules bi-objective plane. Variants which use $f_{1A}$ are presented on Figure \ref{fig:pareto}, plots for the other criteria are available in Supplementary Section F, they are close to what happens with $f_{1A}$. We only consider Pareto sets for which there exist more than one secondary structure solution in. | ||
251 | -First, we observe that the more Pareto sets we eliminate for this reason, the more the criteria are correlated, resulting in a single optimal solution. For example, we can say that $f_{1A}$ when used with JAR3D is correlated to MEA because in 312 cases on 344 an optimal secondary structure is found (most right plot on Figure~\ref{fig:pareto}). The eight variants which use BayesPairing are the less correlated with MEA, resulting in well spread positions of the best solution across the solution space. | ||
252 | -But the most interesting variant is Rna3Dmotifs + direct pattern-matching + $f_{1A}$, which performs the best. When several secondary structures are proposed, the best one is more often on the module criteria side than the MEA (most left plot on Figure~\ref{fig:pareto}; most of the best solutions have an abscissa of 1.0 or close). Therefore in this variant's case, when the criteria are not perfectly correlated, $f_{1A}$ is able to select the good solutions which are not the best on MEA. | ||
253 | -} | ||
254 | - | ||
255 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
256 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
257 | -\section{Discussion} | ||
258 | -\paragraph{Comparison to RNA-MoIP} ~ An interesting point is the improvement between RNA-MoIP and our bi-objective variant which uses direct-pattern matching to spot insertion sites and $f_{1A}$ to score the insertions. This variant only differs from RNA-MoIP because it is bi-objective. | ||
259 | -Then, the Pareto approach really improves the structure prediction by itself. This result supports our hypothesis about RNA-MoIP breaking important basepairs. | ||
260 | - | ||
261 | -\paragraph{\textcolor{red}{About pseudoknots predictions}} ~ | ||
262 | -The support of pseudoknots \textcolor{red}{and a lower number of solutions returned are the real interesting features} about BiORSEO. \textcolor{red}{It returns several} solutions, some with pseudoknots, and some without. As we are looking at the max MCC here, the appropriate solution is selected for each RNA. \textcolor{red}{Fortunately, the number of solutions returned is always smaller than the state-of-the-art tools. This makes the use of the maximum MCC acceptable as a metric.} | ||
263 | -However, pseudoknot prediction quality is still difficult to assess with a metric like MCC, because a pseudoknot could be involving only a few base-pairs. Finding them or not does not alter much the MCC even if the structure is much more right or wrong from a biological point of view. Unfortunately, no automated verification method exists yet to our knowledge. \textcolor{red}{We illustrate this issue with the G riboswitch pseudoknot example in Supplementary Sections D2 and D3. The pseudoknot is sometimes found, but not with the exact same list of basepairs, which is penalized by the MCC.} | ||
264 | -\paragraph{\textcolor{red}{About RNA modules}} | ||
265 | -\textcolor{red}{ | ||
266 | -On one side, the state-of-the-art~(\citealp{reinharz_towards_2012, theis2015rna}), the number of inserted modules in the best solutions (Figure \ref{fig:info}), and the position of the best solutions in the Pareto sets (Figure \ref{fig:pareto}) argue that criteria related to known modules are relevant. They should bring information from data to assist the theoretical model. But on the other side, Biokop is \textit{in fine} equal or above BiORSEO in terms of performance, while Biokop does not use modules. The simplest explanation is that the MFE criterion it uses is important, and we lost information when we replaced it by a module criterion in BiORSEO. | ||
267 | -} | ||
268 | - | ||
269 | -\paragraph{On the objective functions} ~ | ||
270 | -Regarding objective functions to include modules, the different criteria proposed seem to give comparable results at first sight regarding the average performance and the dispersion. However, an important difference between $f_{1A}$, $f_{1B}$ on one side, and $f_{1C}$, $f_{1D}$ on the other side, is about the computation time. As $f_{1A}$, $f_{1B}$ do not use a score to rank potential module insertion sites, every module of the same size can be equally inserted. When the RNA presents several loops, the combinatorial possibilities grow fast with the number of modules in the dataset. Therefore, the number of undominated solutions can reach several hundreds or thousands even for short sequences. Such large Pareto sets are not informative for our application, because they consist \textcolor{red}{of} very redundant secondary structures with different module references, which are counted only for one secondary structure solution at the end. On the other hand, $f_{1C}$ and $f_{1D}$ require the run of an additional tool (JAR3D or BayesPairing) to score the insertion sites. Given an RNA, a compromise must be found according to its length and amount of loops. | ||
271 | - | ||
272 | -\paragraph{The bias with JAR3D} ~ One should keep in mind that JAR3D takes as input the sequences of RNA loops to score modules against them. We detect the loops in the RNA sequence with RNAsubopt. This use of JAR3D is biased, since we score modules on sequence portions that we already know likely to form loops and unlikely to form stems, so the information brought by a module insertion is low. \textcolor{red}{This is why we find it correlated to MEA.} | ||
273 | - | ||
274 | -\paragraph{About BayesPairing} ~ Please remind that we skipped BayesPairing's last step which checks if the insertion of a module would deteriorate too much the energy. We did so because our bi-objective framework was supposed to be able to do it itself. The low performance of BayesPairing in the benchmark is not an argument against it when used in its intended purpose. | ||
275 | - | ||
276 | -\paragraph{Computation times and material limits} \label{sec:mat}~ | ||
277 | -As evocated in Figure \ref{fig:benchmark}, the methods were not all able to fold all the sequences. The missing ones often are from a combination of direct pattern-matching or JAR3D with $f_{1A}$ or $f_{1B}$. \textcolor{red}{On the other hand, direct-pattern matching with $f_{1B}$ and in particular $f_{1A}$ also are the fastest methods. Computation time examples are provided in the case study in Supplementary Section D.} | ||
278 | -The RAM, not the time, typically limits the size of the RNAs the methods can process. RNAs up to 230 bases are fine \textcolor{red}{on our workstation with 16GB of RAM}. A prediction typically takes a few seconds, sometimes minutes. The time required grows with both the nucleotide count, the number of similar loops, and the number of similar modules insertible on those similar loops. The objective functions $f_{1A}$ and $f_{1B}$, which are not sequence-dependant, were sometimes not discriminative enough and equally ranked a large number of combinatorial ordering variations of the same modules on the same loops. For that reason, we had to arbitrarily stop the jobs exceeding 500 structures in the Pareto set, because they would require several hours to complete, leading to incomplete dataset predictions. | ||
279 | - | ||
280 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
281 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
282 | -\vspace{-0.5cm} | ||
283 | -\section{Conclusion} | ||
284 | -We developed a general bi-objective method to benchmark different sources of RNA modules models (the RNA 3D Motif Atlas and Rna3Dmotif), different methods to place them in sequences (direct pattern matching, BayesPairing, and JAR3D), and different scoring functions. The bi-objective method uses \textcolor{red}{a theoretical criterion,} the expected accuracy of the structure, and \textcolor{red}{a data-based criterion, one of} the previous scoring functions, to select relevant secondary structures. | ||
285 | - | ||
286 | -Our models \textcolor{red}{out-perform} RNA-MoIP, a previous attempt to predict better secondary structures using module information and a linear combination of two objectives into a scoring function. Our simplest best-performing new method \textcolor{red}{uses Rna3Dmotifs placed in sequences by regular expression searches and scored by module size. It} could be interpreted as an upgraded RNA-MoIP with a real bi-objective framework, which predicts the base pairs and the module insertions in a row, preventing the insertion to break important base-pairs. \textcolor{red}{However, no module model distinguishes itself from the other. Regarding module detection methods, JAR3D seems biased and results in correlated criteria. The use of direct pattern matching is simple and efficient but leads to combinatorial issues on some RNAs, because we cannot score the insertion sites so that one beats the other candidates. Even if no variant of the method has a better predictive performance than Biokop in average (which performs the same or better using MFE but no module information), the module criterion improves the prediction in 17\% of the cases.} \textcolor{red}{In a future work, we should then develop a tri-objective optimization program including MFE as another criterion.} | ||
287 | - | ||
288 | -Improvement perspectives relies on the hope newer databases like CaRNAval~(\citealp{reinharz2018mining}) that contain more recent and more diverse module models \textcolor{red}{including real pseudoknotted interaction networks}, | ||
289 | -bring more information to assist the energy criteria. | ||
290 | - | ||
291 | -\begin{thebibliography}{25} | ||
292 | - \bibitem[Andronescu {\em et~al.}(2008)Andronescu, Bereg, Hoos, and | ||
293 | - Condon]{andronescu2008rna} | ||
294 | - Andronescu, M., Bereg, V., Hoos, H.~H., and Condon, A. (2008). | ||
295 | - \newblock Rna strand: the {RNA} secondary structure and statistical analysis | ||
296 | - database. | ||
297 | - \newblock {\em BMC bioinformatics\/}, {\bf 9}(1), 340. | ||
298 | - | ||
299 | - \bibitem[Bellaousov and Mathews(2010)Bellaousov and | ||
300 | - Mathews]{bellaousov2010probknot} | ||
301 | - Bellaousov, S. and Mathews, D.~H. (2010). | ||
302 | - \newblock Probknot: fast prediction of {RNA} secondary structure including | ||
303 | - pseudoknots. | ||
304 | - \newblock {\em RNA\/}, {\bf 16}(10), 1870--1880. | ||
305 | - | ||
306 | - \bibitem[Chojnowski {\em et~al.}(2014)Chojnowski, Wale{\'n}, and | ||
307 | - Bujnicki]{chojnowski2014rna} | ||
308 | - Chojnowski, G., Wale{\'n}, T., and Bujnicki, J.~M. (2014). | ||
309 | - \newblock Rna bricks-a database of {RNA} 3d motifs and their interactions. | ||
310 | - \newblock {\em Nucleic acids research\/}, {\bf 42}(D1), D123--D131. | ||
311 | - | ||
312 | - \bibitem[Cruz and Westhof(2011)Cruz and Westhof]{cruz2011sequence} | ||
313 | - Cruz, J.~A. and Westhof, E. (2011). | ||
314 | - \newblock Sequence-based identification of 3d structural modules in {RNA} with | ||
315 | - rmdetect. | ||
316 | - \newblock {\em Nature methods\/}, {\bf 8}(6), 513. | ||
317 | - | ||
318 | - \bibitem[Dirks and Pierce(2004)Dirks and | ||
319 | - Pierce]{dirksAlgorithmComputingNucleic2004} | ||
320 | - Dirks, R.~M. and Pierce, N.~A. (2004). | ||
321 | - \newblock An algorithm for computing nucleic acid base-pairing probabilities | ||
322 | - including pseudoknots. | ||
323 | - \newblock {\em Journal of Computational Chemistry\/}, {\bf 25}(10), 1295--1304. | ||
324 | - | ||
325 | - \bibitem[Djelloul and Denise(2008)Djelloul and Denise]{djelloul_automated_2008} | ||
326 | - Djelloul, M. and Denise, A. (2008). | ||
327 | - \newblock Automated motif extraction and classification in {RNA} tertiary | ||
328 | - structures. | ||
329 | - \newblock {\em RNA\/}, {\bf 14}(12), 2489--2497. | ||
330 | - | ||
331 | - \bibitem[Ge {\em et~al.}(2018)Ge, Islam, Zhong and Zhang]{ge2018novo} | ||
332 | - Ge, P., Islam, S., Zhong, C., and Zhang, S. (2018). | ||
333 | - \newblock De novo discovery of structural motifs in RNA 3D structures through clustering. | ||
334 | - \newblock {\em Nucleic acids research\/}, {\bf 46}(9), 4783--4793. | ||
335 | - | ||
336 | - \bibitem[Gendron {\em et~al.}(2001)Gendron, Lemieux, and | ||
337 | - Major]{gendron2001quantitative} | ||
338 | - Gendron, P., Lemieux, S., and Major, F. (2001). | ||
339 | - \newblock Quantitative analysis of nucleic acid three-dimensional structures. | ||
340 | - \newblock {\em Journal of molecular biology\/}, {\bf 308}(5), 919--936. | ||
341 | - | ||
342 | - \bibitem[Legendre {\em et~al.}(2018)Legendre, Angel, and | ||
343 | - Tahi]{legendre_bi-objective_2018} | ||
344 | - Legendre, A., Angel, E., and Tahi, F. (2018). | ||
345 | - \newblock Bi-objective integer programming for {RNA} secondary structure | ||
346 | - prediction with pseudoknots. | ||
347 | - \newblock {\em BMC Bioinformatics\/}, {\bf 19}(1), 13. | ||
348 | - | ||
349 | - \bibitem[Leontis and Westhof(2001)Leontis and Westhof]{leontis2001geometric} | ||
350 | - Leontis, N.~B. and Westhof, E. (2001). | ||
351 | - \newblock Geometric nomenclature and classification of {RNA} base pairs. | ||
352 | - \newblock {\em RNA\/}, {\bf 7}(4), 499--512. | ||
353 | - | ||
354 | - \bibitem[Lorenz {\em et~al.}(2011b)Lorenz, Bernhart, Zu~Siederdissen, Tafer, | ||
355 | - Flamm, Stadler, and Hofacker]{lorenz2011viennarna} | ||
356 | - Lorenz, R., Bernhart, S.~H., Zu~Siederdissen, C.~H., Tafer, H., Flamm, C., | ||
357 | - Stadler, P.~F., and Hofacker, I.~L. (2011b). | ||
358 | - \newblock ViennaRNA Package 2.0. | ||
359 | - \newblock {\em Algorithms for Molecular Biology\/}, {\bf 6}(1), 26. | ||
360 | - | ||
361 | - \bibitem[Lu {\em et~al.}(2015)Lu, Bussemaker, and Olson]{lu_dssr:_2015} | ||
362 | - Lu, X.-J., Bussemaker, H.~J., and Olson, W.~K. (2015). | ||
363 | - \newblock {DSSR}: an integrated software tool for dissecting the spatial | ||
364 | - structure of {RNA}. | ||
365 | - \newblock {\em Nucleic Acids Research\/}, {\bf 43}(21), e142--e142. | ||
366 | - | ||
367 | - \bibitem[Mathews(2004)Mathews]{mathews2004using} | ||
368 | - Mathews, D.~H. (2004). | ||
369 | - \newblock Using an {RNA} secondary structure partition function to determine | ||
370 | - confidence in base pairs predicted by free energy minimization. | ||
371 | - \newblock {\em RNA\/}, {\bf 10}(8), 1178--1190. | ||
372 | - | ||
373 | - \bibitem[McCaskill(1990)McCaskill]{mccaskill1990equilibrium} | ||
374 | - McCaskill, J.~S. (1990). | ||
375 | - \newblock The equilibrium partition function and base pair binding | ||
376 | - probabilities for {RNA} secondary structure. | ||
377 | - \newblock {\em Biopolymers: Original Research on Biomolecules\/}, {\bf | ||
378 | - 29}(6-7), 1105--1119. | ||
379 | - | ||
380 | - \bibitem[Parisien and Major(2008)Parisien and Major]{parisien2008mc} | ||
381 | - Parisien, M. and Major, F. (2008). | ||
382 | - \newblock The mc-fold and mc-sym pipeline infers {RNA} structure from sequence | ||
383 | - data. | ||
384 | - \newblock {\em Nature\/}, {\bf 452}(7183), 51. | ||
385 | - | ||
386 | - \bibitem[Petrov {\em et~al.}(2013)Petrov, Zirbel, and | ||
387 | - Leontis]{petrov_automated_2013} | ||
388 | - Petrov, A.~I., Zirbel, C.~L., and Leontis, N.~B. (2013). | ||
389 | - \newblock Automated classification of {RNA} 3d motifs and the {RNA} 3d {Motif} | ||
390 | - {Atlas}. | ||
391 | - \newblock {\em RNA\/}, {\bf 19}(10), 1327--1340. | ||
392 | - | ||
393 | - \bibitem[Reinharz {\em et~al.}(2012)Reinharz, Major, and | ||
394 | - Waldisp{\"u}hl]{reinharz_towards_2012} | ||
395 | - Reinharz, V., Major, F., and Waldisp{\"u}hl, J. (2012). | ||
396 | - \newblock Towards 3d structure prediction of large {RNA} molecules: an integer | ||
397 | - programming framework to insert local 3d motifs in {RNA} secondary structure. | ||
398 | - \newblock {\em Bioinformatics\/}, {\bf 28}(12), i207--i214. | ||
399 | - | ||
400 | - \bibitem[Reinharz {\em et~al.}(2018)Reinharz, Soul{\'e}, Westhof, | ||
401 | - Waldisp{\"u}hl, and Denise]{reinharz2018mining} | ||
402 | - Reinharz, V., Soul{\'e}, A., Westhof, E., Waldisp{\"u}hl, J., and Denise, A. | ||
403 | - (2018). | ||
404 | - \newblock Mining for recurrent long-range interactions in {RNA} structures | ||
405 | - reveals embedded hierarchies in network families. | ||
406 | - \newblock {\em Nucleic Acids Research\/}, {\bf 46}(8), 3841--3851. | ||
407 | - | ||
408 | - \bibitem[Sarrazin-Gendron {\em et~al.}(2019)Sarrazin-Gendron, Reinharz, Oliver, | ||
409 | - Moitessier, and Waldisp{\"u}hl]{sarrazin2019automated} | ||
410 | - Sarrazin-Gendron, R., Reinharz, V., Oliver, C.~G., Moitessier, N., and | ||
411 | - Waldisp{\"u}hl, J. (2019). | ||
412 | - \newblock Automated, customizable and efficient identification of 3d base pair | ||
413 | - modules with bayespairing. | ||
414 | - \newblock {\em Nucleic acids research\/}. | ||
415 | - | ||
416 | - \bibitem[Sarver {\em et~al.}(2008)Sarver, Zirbel, Stombaugh, Mokdad, and | ||
417 | - Leontis]{sarver_fr3d:_2008} | ||
418 | - Sarver, M., Zirbel, C.~L., Stombaugh, J., Mokdad, A., and Leontis, N.~B. | ||
419 | - (2008). | ||
420 | - \newblock {FR}3d: finding local and composite recurrent structural motifs in | ||
421 | - {RNA} 3d structures. | ||
422 | - \newblock {\em Journal of Mathematical Biology\/}, {\bf 56}(1), 215--252. | ||
423 | - | ||
424 | - \bibitem[Sato {\em et~al.}(2011)Sato, Kato, Hamada, Akutsu, and | ||
425 | - Asai]{sato_ipknot:_2011} | ||
426 | - Sato, K., Kato, Y., Hamada, M., Akutsu, T., and Asai, K. (2011). | ||
427 | - \newblock {IPknot}: fast and accurate prediction of {RNA} secondary structures | ||
428 | - with pseudoknots using integer programming. | ||
429 | - \newblock {\em Bioinformatics\/}, {\bf 27}(13), i85--i93. | ||
430 | - | ||
431 | - \bibitem[Schlick(2018)Schlick]{schlick2018adventures} | ||
432 | - Schlick, T. (2018). | ||
433 | - \newblock Adventures with {RNA} graphs. | ||
434 | - \newblock {\em Methods\/}, {\bf 143}, 16--33. | ||
435 | - | ||
436 | - \bibitem[Theis {\em et~al.}(2013)Theis, Zu Siederdissen, Hofacker and Gorodkin]{theis2013automated} | ||
437 | - Theis, C., Zu Siederdissen, C., Hofacker, I. L., and Gorodkin, J. (2013). | ||
438 | - \newblock Automated identification of RNA 3D modules with discriminative power in RNA structural alignments. | ||
439 | - \newblock {\em Nucleic acids research\/}, {\bf 41}(22), 9999--10009. | ||
440 | - | ||
441 | - \bibitem[Theis {\em et~al.}(2015)Theis, Zirbel, Zu Siederdisse, Anthon, Hofacker, Nielsen and Gorodkin]{theis2015rna} | ||
442 | - Theis, C., Zirbel, C. L., Zu Siederdissen, C. H., Anthon, C., Hofacker, I. L., Nielsen, H., and Gorodkin, J. (2015). | ||
443 | - \newblock RNA 3D modules in genome-wide predictions of RNA 2D structure. | ||
444 | - \newblock {\em PloS One}, {\bf 10}(10), e0139900. | ||
445 | - | ||
446 | - \bibitem[Van~Batenburg {\em et~al.}(2000)Van~Batenburg, Gultyaev, Pleij, Ng, | ||
447 | - and Oliehoek]{van2000pseudobase} | ||
448 | - Van~Batenburg, F., Gultyaev, A.~P., Pleij, C., Ng, J., and Oliehoek, J. (2000). | ||
449 | - \newblock Pseudobase: a database with rna pseudoknots. | ||
450 | - \newblock {\em Nucleic Acids Research\/}, {\bf 28}(1), 201--204. | ||
451 | - | ||
452 | - \bibitem[Zirbel {\em et~al.}(2015)Zirbel, Roll, Sweeney, Petrov, Pirrung, and | ||
453 | - Leontis]{zirbel_identifying_2015} | ||
454 | - Zirbel, C.~L., Roll, J., Sweeney, B.~A., Petrov, A.~I., Pirrung, M., and | ||
455 | - Leontis, N.~B. (2015). | ||
456 | - \newblock Identifying novel sequence variants of {RNA} 3d motifs. | ||
457 | - \newblock {\em Nucleic Acids Research\/}, {\bf 43}(15), 7504--7520. | ||
458 | - | ||
459 | - \end{thebibliography} | ||
460 | - | ||
461 | - | ||
462 | -\end{document} |
doc/supplementary_materials.tex
deleted
100644 → 0
1 | -\documentclass{article} | ||
2 | -\usepackage[utf8]{inputenc} | ||
3 | -\usepackage{graphicx} | ||
4 | -\usepackage{amsmath} | ||
5 | -\usepackage{stmaryrd} % llbracket, rrbracket | ||
6 | -\usepackage{siunitx} % SI units | ||
7 | -\usepackage{geometry} | ||
8 | -\usepackage{charter} % betterfont | ||
9 | - | ||
10 | -\geometry{top=1.5cm,bottom=1.5cm, left=2cm, right=2cm} | ||
11 | - | ||
12 | -\begin{document} | ||
13 | - | ||
14 | -\appendix | ||
15 | -\section{Secondary structure elements of an RNA} | ||
16 | -RNA secondary structure elements can be classified in stems and loops. Stems are stacks of canonical interactions. They consist in double-stranded regions which stabilize the molecule. \\ | ||
17 | -Loops are unpaired portions (unpaired in terms of \textit{canonical} pairings) which are often more flexible, and can interact with distant portions of the molecule (forming canonical or non-canonical pseudoknots) or with another molecule, providing a function to the RNA. | ||
18 | - | ||
19 | -\begin{center}\includegraphics[width=0.5\linewidth]{fig/RNA_SSE.png}\end{center} | ||
20 | -\textit{\scriptsize Figure extracted from Dr. Xiang-Jun Lu's 3DNA website (\texttt{https://x3dna.org/articles/exterior-loop-in-rna-secondary-structure}), June 2019}\\ | ||
21 | - | ||
22 | -Loops can be further classified according to their number of strands, sometimes called "components" in this article. A \textit{Hairpin Loop} (HL) is composed of only one strand joining the two strands of only one stem. An \textit{Internal Loop} (IL) is composed of two strands linking together two stems. Note that a particular case of IL, called the \textit{bulge}, has one strand of length zero. Loops with more than 2 stems are called \textit{Multibranch Loops} (ML), and sometimes referred as $k$-way junctions for $k$ stems. | ||
23 | - | ||
24 | -The different strands of the loops which link stems together do not necessarily belong to the same RNA molecule, the same vocabulary can be used to describe RNA complexes. For example, if one cuts the top Hairpin Loop on this figure, the bottom Internal Loop remains an Internal Loop, but uses two different RNA molecules. There is no difference from a structural point of view. | ||
25 | - | ||
26 | -\begin{center} | ||
27 | - \includegraphics[width=0.8\linewidth]{fig/pseudoknots.png} | ||
28 | -\end{center} | ||
29 | -Pseudoknots families describe how they can be formed. The HHH type happens when 2 hairpin loops form a new stem together (squared in blue), forming a third hairpin loop. The H type is a simple strand forming a new stem with an HL, forming a new HL. If there is a IL or ML formed instead of a HL, because of a stem+loop already present, we call it a HLin (Hairpin Loop inside the loop). If a strand forms a new stem not with a HL, but with an IL, forming a new HL, we call it a HLout (Hairpin Loop pointing out). If an IL or ML is formed instead of a HL, it is called an LL pseudoknot. | ||
30 | - | ||
31 | -\newpage | ||
32 | - | ||
33 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
34 | -\section{RNA-MoIP can break important base-pairs} | ||
35 | -We justify our Pareto-based bi-objective approach by the fact that a linear combination of two objectives (what RNA-MoIP does) always have several defects: | ||
36 | -\begin{itemize} | ||
37 | - \item It can miss solutions when the Pareto set is not perfectly convex, | ||
38 | - \item It requires weights on every term of the sum. If these weights are not finely tuned, the compromise between including modules and not breaking important basepairs is missed. We believe this is the case and illustrate this with the following plots: | ||
39 | -\end{itemize} | ||
40 | - | ||
41 | -\begin{figure}[h] | ||
42 | -\includegraphics[width=\linewidth]{fig/MOIP_subopt.jpg} | ||
43 | -\end{figure} | ||
44 | - | ||
45 | -Here we compare the prediction performance of: | ||
46 | -\begin{itemize} | ||
47 | - \item RNAsubopt (which predicts a list of sub-optimal secondary structures without pseudoknots, that are then fed forward into RNA-MoIP), | ||
48 | - \item RNA-MoIP "chunk", which is the default running mode of RNA-MoIP, which selects only one solution from the list of sub-optimals based on a linear combination of two objectives: the possibility to insert modules with $f_{1A}$ on one side, and not breaking too much basepairs from the input structure on the other side, | ||
49 | - \item RNA-MoIP 'one by one', a different use of RNA-MoIP where we give it every sub-optimal solution one by one and let it modify it to insert modules. Then we manually select the best solution according to max MCC (like we do for RNAsubopt). | ||
50 | -\end{itemize} | ||
51 | - | ||
52 | -First on the left figure (a), the max MCC found across the set of solutions is reported for each of the 344 RNAs of the RNA-Strand dataset. RNAs are sorted by RNA-MoIP 'chunk' performance. We can see that the two RNA-MoIP series do not differ a lot, which means RNA-MoIP efficiently selects the best solution in the set after the solutions have been modified to insert modules. But, on the other side, we can see that one of the input RNAsubopt solutions often was better than the solutions transformed by RNA-MoIP: it breaks important basepairs in the inputs.\\ | ||
53 | -The right figure (b) quantifies the differences. The performance difference between the two RNA-MoIP usages is almost always null, meaning RNA-MoIP is good at selecting its best solution in the set. But when compared to RNAsubopt, the performance decreases more often than it increases. | ||
54 | - | ||
55 | -We think "breaking" base-pairs in an input is not the best way to do, so we chose to build the solutions taking into account the two criteria simultaneously in a bi-objective optimisation program. | ||
56 | - | ||
57 | -\newpage | ||
58 | - | ||
59 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
60 | -\section{Linear constraints to model RNA Structures in an integer linear program} | ||
61 | -We present here the linear constraints we used to model our problem and solve it with a regular integer-linear-programming solver. The constraints have been written by us, but are inspired by works like (Sato \textit{et al.}, 2011), (Reinharz \textit{et al.}, 2012) and (Legendre \textit{et al.}, 2018). | ||
62 | - | ||
63 | -\paragraph{Extended notations} ~ \\ | ||
64 | -Let $n$ be the number of nucleotides in the query RNA sequence $s$.\\ | ||
65 | -Let $M$ be the set of modules that could be inserted in $s$.\\ | ||
66 | -Let $x$ be a module of $M$, $\|x\|$ be the number of distinct components of $x$, and $p(x)$ the associated score of insertion given by JAR3D or BayesPairing for that motif inserted at a particular position.\\ | ||
67 | -Let $P_{x,i}$ be the position in $s$ where we can insert the $i$th component of module $x$.\\ | ||
68 | -As the same module model can be inserted several times in $s$, several different $x$ modules in $M$ may refer to the same theoretical module, but inserted at different positions.\\ | ||
69 | -Let $k_{x,i}$ be the size in nucleotides of that $i$th component of $x$.\\ | ||
70 | -Let $y^u_v$ be the \textbf{decision boolean variable} indicating that $s[u]$ and $s[v]$ form a canonical base pairing. According to the standard loop model, we always have $v > u + 3$.\\ | ||
71 | -Let $C^x_i$ be the \textbf{decision boolean variable} indicating that we do insert the $i$th component of module $x$ at position $P_{x,i}$. | ||
72 | - | ||
73 | - | ||
74 | -Note that a base pair $y^u_v$ is possible if and only if $v>u+3$, and that we do not need to use two variables $y^u_v$ and $y^v_u$ for the same pair. | ||
75 | -Then, we have $\sum_{i=4}^n (n-i)$ decision variables ($\approx \frac{1}{2}n^2$ decision variables) of the form $y^u_v$. | ||
76 | -Regarding the $C^x_i$, if we have an average insertion of $\nu$ motifs by RNA sequence, the motifs having in average $\mu$ components, components that can be inserted in average at $\pi$ different positions in $s$, | ||
77 | -then we need to add, in average, $\nu \times \mu \times \pi$ decision variables $C^x_i$. | ||
78 | - | ||
79 | -Then, we expect having around $\frac{1}{2}n^2+\nu \mu \pi$ decision variables. | ||
80 | - | ||
81 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
82 | -\paragraph{Constraint to ensure there only is 0 or 1 canonical pairing by nucleotide} ~ | ||
83 | -\begin{equation} \label{constraint:1} | ||
84 | - \sum_{v<u} y^v_u + \sum_{v>u} y^u_v \leq 1 \qquad\qquad \forall u \in \llbracket 1,n \rrbracket | ||
85 | -\end{equation} | ||
86 | - | ||
87 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
88 | -\paragraph{Constraints to forbid lonely base pairs} ~ | ||
89 | -% \begin{equation} \label{constraint:2} | ||
90 | -% \sum_{v=u}^n y^{u-1}_v - \sum_{v=u+1}^n y^u_v + \sum_{v=u+2}^n y^{u+1}_v \geq 0 \qquad \qquad \forall u \in \llbracket 1,n\rrbracket | ||
91 | -% \end{equation} | ||
92 | -% \begin{equation} \label{constraint:3} | ||
93 | -% \sum_{u=1}^{v-2} y^u_{v-1} - \sum_{u=1}^{v-1} y^u_v + \sum_{u=1}^{v} y^u_{v+1} \geq 0 \qquad \qquad \forall v \in \llbracket 1,n\rrbracket | ||
94 | -% \end{equation} | ||
95 | -% These conditions ensure that if a base pair exists with $s[i]$, | ||
96 | -% one of the adjacent bases is paired too. | ||
97 | -% Equation \ref{constraint:2} is useful if $s[u]$ is paired with $s[v>u]$ (a nucleotide later in the sequence), | ||
98 | -% and equation \ref{constraint:3} if $s[v]$ is paired with $s[u<v]$ (a nucleotide earlier in the sequence). | ||
99 | -\begin{equation} \label{constraint:2} | ||
100 | - y^{u-1}_{v+1} - y^u_v + y^{u+1}_{v-1} \geq 0 \qquad \qquad \forall (u,v) \in \{ (u,v) \in \llbracket 1,n\rrbracket^2 \; | \; u + 3 <v \} | ||
101 | -\end{equation} | ||
102 | -A basepair should be accompanied by one of its neighbours, forming a stable structure stabilized by stacking energies. In theory, this might add up to \( \frac{1}{2}n^2\) constraints, but in practice, this number is very reasonable as | ||
103 | -the only decision variables kept are those with probability above a $\theta$ threshold. | ||
104 | -Then, this condition sets to zero "lonely decision variables" who have no neighbour basepair variable allowed. | ||
105 | - | ||
106 | - | ||
107 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
108 | -% \paragraph{Constraint to forbid pairings inside a module component} ~ | ||
109 | -% \begin{equation} \label{constraint:4} | ||
110 | -% (k_{x,i}-2) \; C^x_i + \sum_{u=P_{x,i}+1}^{P_{x,i}+k_{x,i}-2}\left[ \sum_{v>u} y^u_v + \sum_{v<u} y^v_u \right] \leq (k_{x,i} - 2) | ||
111 | -% \qquad \qquad \forall x \in M, i \in \llbracket 1,\|x\| \rrbracket | ||
112 | -% \end{equation} | ||
113 | -% If $C^x_i$ is set to 1, then the sum has to be zero. Obviously, this constraint prevents the program to correctly detect pseudoknots of HHH (kissing hairpins) and LL types (kissing higher-order loops), which is a limit of the approach. | ||
114 | - | ||
115 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
116 | -\paragraph{Constraints to forbid components to overlap} ~ | ||
117 | -\begin{equation} \label{constraint:5} | ||
118 | - \sum_{x \in M} \sum_{i=1}^{\|x\|} C^x_i \times I(P_{x,i}<u<P_{x,i}+k_{x,i}-1) \leq 1 \qquad \qquad \forall u \in \llbracket 1,n \rrbracket | ||
119 | -\end{equation} | ||
120 | -$I(P_{x,i}<u<P_{x,i}+k_{x,i}-1)$ is a boolean value depending on the condition's truth. Then, whatever the nucleotide $u$, it can be part of a module component only once. | ||
121 | - | ||
122 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
123 | -\paragraph{Constraints to respect the structure of large motifs ($\{ x\in M \; | \; \|x\| \geq 2\}$)} ~ | ||
124 | - | ||
125 | -These constraints ensure that none or all the components of a motif are inserted. | ||
126 | -\begin{equation}\label{constraint:6} | ||
127 | - \sum_{i=2}^{\|x\|} C^x_i = (\|x\| - 1) \times C^{x}_{1} \qquad \qquad \forall x \in \{ x\in M \; | \; \|x\| \geq 2\} | ||
128 | -\end{equation} | ||
129 | - | ||
130 | -And then, we force the base pairs between the end of a component and the beginning of the next one, so that the module $x$ has all its closing basepairs: | ||
131 | -\begin{equation}\label{constraint:7} | ||
132 | - C^x_1 \leq y^{P_{x,1}}_{P_{x,\|x\|}+k_{x,\|x\|}-1} \qquad \qquad \forall x \in \{ x\in M \; | \; \|x\| \geq 2\} | ||
133 | -\end{equation} | ||
134 | -\begin{equation}\label{constraint:8} | ||
135 | - C^x_j \leq y^{P_{x,j}+k_{x,j}-1}_{P_{x,j+1}} \qquad \qquad \forall x \in \{ x\in M \; | \; \|x\| \geq 2\}, \forall j \in \llbracket 1,\|x\| \llbracket | ||
136 | -\end{equation} | ||
137 | - | ||
138 | -Constraint (\ref{constraint:7}) binds the first nucleotide of first component to the last one of the last component. | ||
139 | -Constraint (\ref{constraint:8}) binds the last nucleotide of component $j$ to the first of component $j+1$. | ||
140 | - | ||
141 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
142 | -\paragraph{Facultative constraints to forbid pseudoknots} ~ | ||
143 | -\begin{equation}\label{constraint:9} | ||
144 | - y^u_v + y^k_l \leq 1 \qquad \qquad \forall u,v,k,l \text{ such as } 1\leq u<k<v<l\leq n | ||
145 | -\end{equation} | ||
146 | - | ||
147 | -To limit the number of constraints added, we obviously define the condition for allowed basepairs only ($u + 3 <v$, $k + 3 <l$, $p_{uv} > \theta$, $p_{kl} > \theta$). | ||
148 | - | ||
149 | - | ||
150 | - | ||
151 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
152 | -\paragraph{Constraints to forbid previously found solutions} ~ | ||
153 | - | ||
154 | -As several solutions may result in the same values of the two objectives, and as we want to get all the solutions, we can't forbid the algorithm to search twice the same region of the objective space. | ||
155 | -We have to explicitly forbid to find again every found solution.\\ | ||
156 | -We do it by adding iteratively, for every structure $s^*$ found, the following condition: | ||
157 | -\begin{equation}\label{constraint:10} | ||
158 | - \sum_{y^u_v \in \{ y^u_v | y^u_v = 1 \text{ in } s^* \}} (1 - y^u_v) + \sum_{y^u_v \in \{ y^u_v | y^u_v = 0 \text{ in } s^* \}} y^u_v + | ||
159 | - \sum_{C^x_i \in \{ C^x_i | C^x_i = 1 \text{ in } s^* \}} (1 - C^x_i) + \sum_{C^x_i \in \{ C^x_i |C^x_i = 0 \text{ in } s^* \}} C^x_i \geq 1 | ||
160 | -\end{equation} | ||
161 | - | ||
162 | -It ensures that at least one of the decision variables differs from $s^*$. | ||
163 | - | ||
164 | -\newpage | ||
165 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
166 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
167 | -\section{Case study} | ||
168 | - | ||
169 | -To complete the large benchmark, we have a deeper look at well-known structures to check if some methods are able to predict them correctly. We used a Gln tRNA from E. coli (RNA-Strand code PDB\_00376), a Guanine riboswitch (RNA-Strand code PDB\_01023), and the pseudoknot of the human telomerase (PDB\_00857). The tRNA is unpseudoknotted, the G riboswitch contains a hard-to-predict HHH type pseudoknot, and the telomerase pseudoknot is a simple H type pseudoknot. | ||
170 | - | ||
171 | -%\begin{table}[h] | ||
172 | -%\footnotesize{ | ||
173 | -% \begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}lllllll} | ||
174 | -% \hline | ||
175 | -% & RNAsubopt & RNA-MoIP & BiokoP & \multicolumn{4}{c}{BiORSEO}\\ | ||
176 | -% & & & & Rna3Dmotif & Rna3Dmotif & 3D Motif Atlas & 3D Motif Atlas\\ | ||
177 | -% & & & & + Direct P.M. & + BayesPairing & + JAR3D & + BayesPairing \\ | ||
178 | -% \hline | ||
179 | -% tRNA Gln & 0.68 & 0.67 & 0.67 & 0.64 (A,B) & 0.64 (B,C,D), 0.60 (A) & 0.64 (B,C,D), 0.63 (B) & 0.64 %(\textit{all}) \\ | ||
180 | -% G riboswitch & 0.86 & 0.84, 0.68 & 0.76 & 0.72 (A), 0.15(B) & 0.39 (C,D), 0.15 (A,B) & 0.28 %(\textit{all}) & 0.63 (C,D), 0.57 (A), 0.14 (B)\\ | ||
181 | -% Telomerase PK & 0.77 & 0.77, 0.7 & 1.0 & 1.0 & 1.0 (B,C,D), 0.66 (A) & 0.97 (\textit{all}), & 1.0 %(\textit{all})\\ | ||
182 | -% \hline | ||
183 | -% \end{tabular*} | ||
184 | -% } | ||
185 | -% \end{table} | ||
186 | -%The table just above reports the value of the max MCC value found across the Pareto set. Pseudoknots %are allowed. The best structure is often the same across the different objective functions $f_{1A}, %f_{1B}, f_{1C}, f_{1D}$, but the rest of the sets can still differ in number of solutions and diversity. %Detailed results including structures, number of solutions and computation times are provided below. | ||
187 | - | ||
188 | -The results are consistent with the general benchmark: BiORSEO variants perform slightly worse than Biokop or RNAsubopt. | ||
189 | -The tRNA is an example of structure where all methods that support pseudoknots predict some in the loops. On the other hand, the telomerase pseudoknot is correctly predicted by both BiORSEO and Biokop, that support pseudoknots. | ||
190 | - | ||
191 | -Detailed results are given below for each RNA. The number of unique solutions and computation times are also reported. Note that these cases are small RNAs, resulting in both small number of solutions and small times. The times are the "real" time spent, therefore you should use a 4-thread CPU to reproduce them, because there are several multi-threaded parts in the process. When several tools are required, the times are split by tool (for example, BayesPairing + BiORSEO, or RNAsubopt + JAR3D + BiORSEO). They also are very dependant on the I/O delays. Especially with methods reading modules from disk, you may want to use a very fast storage device (e.g. NVMe SSD NAND storage) to increase the speed. | ||
192 | - | ||
193 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
194 | -\subsection{E. coli's Gln tRNA} | ||
195 | - | ||
196 | -\paragraph{Referenced "true" structure in RNA-Strand (PDB 00376)} ~ | ||
197 | - | ||
198 | -\texttt{GGGGUAUCGCCAAGCGGUAAGGCACCGGAUUCUGAUUCCGGAGGUCGAGGUUCGAAUCCUCGUACCCCAGCCA} | ||
199 | - | ||
200 | -\texttt{((((((..(((.........)))((((((((...))))))))...(((((.......))))))))))).....} | ||
201 | - | ||
202 | -\paragraph{Best prediction results} ~ | ||
203 | - | ||
204 | -{\scriptsize | ||
205 | -\begin{tabular}{rlccl} | ||
206 | -Method & Best secondary structure & max MCC & N solutions & time (s)\\ | ||
207 | -\hline | ||
208 | -Reference & \texttt{((((((..(((.........)))((((((((...))))))))...(((((.......))))))))))).....} & & & \\ | ||
209 | -RNAsubopt & \texttt{(((((((.(((....)))..(((.(((((.......)))))..)))((((.......))))))))))).....} & 0.68 & 4 & 0.0\\ | ||
210 | -Biokop & \texttt{[[[[[[((((...))))...(((.((((([[[....)))))....(((((...]]].)))))]]]]]].))).} & 0.67 & 30 & 634.6\\ | ||
211 | -RNA-MoIP (1by1) & \texttt{((((((..((......))...((.(((((.......)))))..))..((.........))..)))))).....} & 0.67 & 4 & 0.0+9.7\\ | ||
212 | -RNA-MoIP (chunk) & \texttt{((((((..((......))...((.(((((.......)))))..))..((.........))..)))))).....} & 0.67 & 1 & 0.0+7.8\\ | ||
213 | -DESC-Direct P.M.-A & \texttt{((((((((((...))))...[[[.((((([[[.[[.)))))....(((((]].]]].))))))))))).]]].} & 0.64 & 1 & 9.1\\ | ||
214 | -DESC-Direct P.M.-B & \texttt{((((((((((...))))...[[[.((((([[[.[[.)))))....(((((]].]]].))))))))))).]]].} & 0.64 & 3 & 30.1\\ | ||
215 | -DESC-BPairing-A & \texttt{((((((((((...)))....((..((((([[[.[[.))))).{{))((((]].]]].)))))))))))..}}.} & 0.60 & 1 & 103.0-8.9\\ | ||
216 | -DESC-BPairing-B & \texttt{((((((((((...))))...[[[.((((([[[.[[.)))))....(((((]].]]].))))))))))).]]].} & 0.64 & 12 & 103.0-18.6\\ | ||
217 | -DESC-BPairing-C & \texttt{((((((((((...))))...[[[.((((([[[.[[.)))))....(((((]].]]].))))))))))).]]].} & 0.64 & 4 & 103.0-11.1\\ | ||
218 | -DESC-BPairing-D & \texttt{((((((((((...))))...[[[.((((([[[.[[.)))))....(((((]].]]].))))))))))).]]].} & 0.64 & 4 & 103.0+10.6\\ | ||
219 | -BGSU-BPairing-A & \texttt{((((((((((...))))...[[[.((((([[[.[[.)))))....(((((]].]]].))))))))))).]]].} & 0.64 & 5 & 110.9+10.9\\ | ||
220 | -BGSU-BPairing-B & \texttt{((((((((((...))))...[[[.((((([[[.[[.)))))....(((((]].]]].))))))))))).]]].} & 0.64 & 7 & 110.9+10.4\\ | ||
221 | -BGSU-BPairing-C & \texttt{((((((((((...))))...[[[.((((([[[.[[.)))))....(((((]].]]].))))))))))).]]].} & 0.64 & 2 & 110.9+9.5\\ | ||
222 | -BGSU-BPairing-D & \texttt{((((((((((...))))...[[[.((((([[[.[[.)))))....(((((]].]]].))))))))))).]]].} & 0.64 & 2 & 110.9+9.3\\ | ||
223 | -BGSU-Jar3d-A & \texttt{(((((((((((....)))..[[[.((((([[[.[[.))))).)).(((((]].]]].))))))))))).]]].} & 0.63 & 1 & 0.0+1.9+10.3\\ | ||
224 | -BGSU-Jar3d-B & \texttt{((((((((((...))))...[[[.((((([[[.[[.)))))....(((((]].]]].))))))))))).]]].} & 0.64 & 1 & 0.0+1.9+9.8\\ | ||
225 | -BGSU-Jar3d-C & \texttt{((((((((((...))))...[[[.((((([[[.[[.)))))....(((((]].]]].))))))))))).]]].} & 0.64 & 2 & 0.0+1.9+10.4\\ | ||
226 | -BGSU-Jar3d-D & \texttt{((((((((((...))))...[[[.((((([[[.[[.)))))....(((((]].]]].))))))))))).]]].} & 0.64 & 2 & 0.0+1.9+10.5\\ | ||
227 | -\end{tabular}} | ||
228 | - | ||
229 | -\paragraph{Notes} ~ | ||
230 | - | ||
231 | -Note that both BiORSEO and BiokoP insert a false-positive pseudoknot. If we look at our recommended method, Rna3Dmotifs + Direct Pattern-matching + $f_{1A}$, here is an example of difference in the number of solutions : Biorseo returns 1 solution in 9.1s, while others return more solution in longer times, without doing better. | ||
232 | - | ||
233 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
234 | -\subsection{G Riboswitch} | ||
235 | - | ||
236 | -\paragraph{Referenced "true" structure in RNA-Strand (PDB 01023)} ~ | ||
237 | - | ||
238 | -\texttt{GGACAUACAAUCGCGUGGAUAUGGCACGCAAGUUUCUGCCGGGCACCGUAAAUGUCCGACUAUGUCCA} | ||
239 | - | ||
240 | -\texttt{(((((((...(((((((.[[..[[)))))))........((((((]]...]]))))))..))))))).} | ||
241 | - | ||
242 | -\paragraph{Best prediction results} ~ | ||
243 | - | ||
244 | -{\scriptsize | ||
245 | -\begin{tabular}{rlccl} | ||
246 | -Method & Best secondary structure & max MCC & N solutions & time (s)\\ | ||
247 | -\hline | ||
248 | -Reference &\texttt{(((((((...(((((((.[[..[[)))))))........((((((]]...]]))))))..))))))).} & & & \\ | ||
249 | -RNAsubopt &\texttt{(((((((.....(((((.......)))))..........((((((.......))))))..))))))).} & 0.86 & 3 & 0.0 \\ | ||
250 | -Biokop &\texttt{(((((((.[[(([[[[[))(((((]]]]]..((]]..))[[[[[[)))))..]]]]]]..))))))).} & 0.76 & 14 & 330.9\\ | ||
251 | -RNA-MoIP (1by1) &\texttt{(((((((.....(((((.......)))))..........(((((.........)))))..))))))).} & 0.84 & 3& 0.0+4.6\\ | ||
252 | -RNA-MoIP (chunk) &\texttt{(((((((........((.......)).....((....)).((((.........))))...))))))).} & 0.68 & 1& 0.0+3.3\\ | ||
253 | -DESC-Direct P.M.-A &\texttt{((((((((....(((((.....[[)))))..((....))[[[[[[..))...]]]]]].]])))))).} & 0.72 & 1 & 6.5\\ | ||
254 | -DESC-Direct P.M.-B &\texttt{((((((......(((([[[[[[[[.))))..((((.[[[.))))...]]].))))))..]]]]]]]].} & 0.15 & 7 & 8.4\\ | ||
255 | -DESC-BPairing-A &\texttt{((((((((.((.(((([[[[[[[[.))))..))((.[[[.))]]]..))..))))))..]]]]]]]].} & 0.15 & 2 & 91.2+5.6\\ | ||
256 | -DESC-BPairing-B &\texttt{((((((((.((.(((([[[[[[[[.))))..))((.[[[.))]]]..))..))))))..]]]]]]]].} & 0.15 & 2 & 91.2+5.8\\ | ||
257 | -DESC-BPairing-C &\texttt{(((([[((....((....{{..[[.[[))..]]...((([[[)))..))....))]]].]]]]}})).} & 0.39 & 7 & 91.2+8.6\\ | ||
258 | -DESC-BPairing-D &\texttt{(((([[((....((....{{..[[.[[))..]]...((([[[)))..))....))]]].]]]]}})).} & 0.39 & 7 & 91.2+8.5\\ | ||
259 | -BGSU-BPairing-A &\texttt{((..(((((((..((((.[[..[[))))[[.)))..]].[[[[[[..))...]]]]]].]]))]])).} & 0.57 & 1 & 102.3+6.6\\ | ||
260 | -BGSU-BPairing-B &\texttt{(((((((((((.(((([[[[[[[[.))))..)))..(((.[[)))]]))..))))))..]]]]]]]].} & 0.14 & 2 & 102.3+6.2\\ | ||
261 | -BGSU-BPairing-C &\texttt{((..((((....(((((.[[..[[)))))..((....))[[[[[[..))...]]]]]].]]))]])).} & 0.63 & 3 & 102.3+14.0\\ | ||
262 | -BGSU-BPairing-D &\texttt{((..((((....(((((.[[..[[)))))..((....))[[[[[[..))...]]]]]].]]))]])).} & 0.63 & 4 & 102.3+7.3\\ | ||
263 | -BGSU-Jar3d-A &\texttt{(((..((.....((((([[[[[[[)))))..((....))(((.[[)))))..]])))..]]]]]]]..} & 0.28 & 5 & 0.0+1.5+25.6\\ | ||
264 | -BGSU-Jar3d-B &\texttt{(((..((.....((((([[[[[[[)))))..((....))(((.[[)))))..]])))..]]]]]]]..} & 0.28 & 5 & 0.0+1.5+30.6\\ | ||
265 | -BGSU-Jar3d-C &\texttt{(((..((.....((((([[[[[[[)))))..((....))(((.[[)))))..]])))..]]]]]]]..} & 0.28 & 6 & 0.0+1.5+7.4\\ | ||
266 | -BGSU-Jar3d-D &\texttt{(((..((.....((((([[[[[[[)))))..((....))(((.[[)))))..]])))..]]]]]]]..} & 0.28 & 6 & 0.0+1.5+7.3\\ | ||
267 | - | ||
268 | -\end{tabular}} | ||
269 | - | ||
270 | -\paragraph{Notes} ~ | ||
271 | - | ||
272 | -Here is a good example showing that MCC does not reflects the correct prediction of pseudoknots. The reference structure contains a small HHH-type knot between the two main hairpin loops, with an additional stem, itself containing an internal loop. Biokop finds it. The BiORSEO variants don't, most of them find other H-type pseudoknots, which all are wrong from a RNA function point of view, but the MCC scores are very diverse even if the structure is wrong, because the basepair lists can share a various amount of positives with the reference even if not located in the same stems. For example, Rna3Dmotifs + Direct Pattern-matching + $f_{1A}$ is at least able to identify the two hairpin loops, its score is much greater than the others (0.72), and the pseudoknot is still wrong. | ||
273 | - | ||
274 | - | ||
275 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
276 | -\subsection{Human telomerase's RNA pseudoknot} | ||
277 | - | ||
278 | -\paragraph{Referenced "true" structure in RNA-Strand (PDB 00857)} ~ | ||
279 | - | ||
280 | -\texttt{GGGCUGUUUUUCUCGCUGACUUUCAGCCCCAAACAAAAAAGUCAGCA} | ||
281 | - | ||
282 | -\texttt{[[[[[[........(((((((((]]]]]]........))))))))).} | ||
283 | - | ||
284 | -\paragraph{Best prediction results} ~ | ||
285 | - | ||
286 | -{\scriptsize | ||
287 | -\begin{tabular}{rlccl} | ||
288 | -Method & Best secondary structure & max MCC & N solutions & time (s)\\ | ||
289 | -\hline | ||
290 | -Reference & \texttt{[[[[[[........(((((((((]]]]]]........))))))))).} & & & \\ | ||
291 | -RNAsubopt & \texttt{..............(((((((((..............))))))))).} & 0.77 & 3 & 0.0 \\ | ||
292 | -Biokop & \texttt{[[[[[[........(((((((((]]]]]]........))))))))).} & 1.00 & 1 & 2.4\\ | ||
293 | -RNA-MoIP (1by1) & \texttt{..............(((((((((..............))))))))).} & 0.77 & 3 & 0.0 + 2.1\\ | ||
294 | -RNA-MoIP (chunk)& \texttt{((..........))(((((((((..............))))))))).} & 0.70 & 1 & 0.0 + 1.0\\ | ||
295 | -DESC-Direct P.M.-A & \texttt{[[[[[[........(((((((((]]]]]]........))))))))).} & 1.00 & 1 & 0.8\\ | ||
296 | -DESC-Direct P.M.-B & \texttt{[[[[[[........(((((((((]]]]]]........))))))))).} & 1.00 & 1 & 0.9\\ | ||
297 | -DESC-BPairing-A & \texttt{[[[[[[........(((((((((]]].]]]......)).))))))).} & 0.66 & 1 & 63.9+0.7\\ | ||
298 | -DESC-BPairing-B & \texttt{[[[[[[........(((((((((]]]]]]........))))))))).} & 1.00 & 2 & 63.9+0.8\\ | ||
299 | -DESC-BPairing-C & \texttt{[[[[[[........(((((((((]]]]]]........))))))))).} & 1.00 & 2 & 63.9+0.7\\ | ||
300 | -DESC-BPairing-D & \texttt{[[[[[[........(((((((((]]]]]]........))))))))).} & 1.00 & 2 & 63.9+0.7\\ | ||
301 | -BGSU-BPairing-A & \texttt{[[[[[[........(((((((((]]]]]]........))))))))).} & 1.00 & 2 & 73.1+0.7\\ | ||
302 | -BGSU-BPairing-B & \texttt{[[[[[[........(((((((((]]]]]]........))))))))).} & 1.00 & 2 & 73.1+0.7\\ | ||
303 | -BGSU-BPairing-C & \texttt{[[[[[[........(((((((((]]]]]]........))))))))).} & 1.00 & 2 & 73.1+0.7\\ | ||
304 | -BGSU-BPairing-D & \texttt{[[[[[[........(((((((((]]]]]]........))))))))).} & 1.00 & 2 & 73.1+0.7\\ | ||
305 | -BGSU-Jar3d-A & \texttt{[[[[[[........((((((((.]]]]]].........)))))))).} & 0.97 & 1 & 0.0+1.7+0.7\\ | ||
306 | -BGSU-Jar3d-B & \texttt{[[[[[[........((((((((.]]]]]].........)))))))).} & 0.97 & 1 & 0.0+1.7+0.8\\ | ||
307 | -BGSU-Jar3d-C & \texttt{[[[[[[........((((((((.]]]]]].........)))))))).} & 0.97 & 1 & 0.0+1.7+0.7\\ | ||
308 | -BGSU-Jar3d-D & \texttt{[[[[[[........((((((((.]]]]]].........)))))))).} & 0.97 & 1 & 0.0+1.7+0.7\\ | ||
309 | -\end{tabular}} | ||
310 | - | ||
311 | - | ||
312 | -\paragraph{Notes} ~ | ||
313 | - | ||
314 | -The methods which support pseudoknots are able to predict it correctly. | ||
315 | - | ||
316 | -\newpage | ||
317 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
318 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
319 | -\section{Average MCC of the method's variants} | ||
320 | -Instead of looking at the max MCC to see if the reference structure has been found in the Pareto set, one can look at the average MCC over the Pareto set. | ||
321 | - | ||
322 | -We provide such results to satisfy the reader's curiosity, but this average is hard to interpret. | ||
323 | -The Pareto set is supposed to propose several solutions that could be several meta-stable states, but there is no reason that these states should be close one to another, nor to be close to the "true" structure that has been observed and saved in the database. | ||
324 | -A possible interpretation is the average distance of the meta-stable states to the "true" structure, if and only if we assume the predictions are correct. | ||
325 | -It also gives the user an idea of how close to a real conformation he is if he chooses a structure randomly in the Pareto set. | ||
326 | - | ||
327 | -\vspace{0.5cm} | ||
328 | -\includegraphics[width=0.95\textwidth]{fig/Benchmark_avg.jpg} | ||
329 | -\vspace{0.5cm} | ||
330 | - | ||
331 | -Average MCC obtained by the different methods considered in our benchmark. On (A), the RNAstrand dataset for methods which do not support pseudoknots (computations succeeded for all methods for 287 RNAs). (B) is the same dataset but with pseudoknot support (281 RNAs), and (C) is the Pseudobase dataset, with 236 RNAs. | ||
332 | - | ||
333 | - | ||
334 | -\newpage | ||
335 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
336 | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
337 | -\section{Positions of the best solutions in Pareto sets} | ||
338 | -Here we report the position of the best solution (the one which has the max MCC with the true structure) in the normalized Pareto set. The normalization consists in dividing the objective functions values of a solution by the maximum value observed in the Pareto set on each axis. Then, 0 on an axis is the value 0 of the objective, and 1 is the maximum value observed. | ||
339 | -The first line is identical to Figure 6. Direct P.M.-$f_{1A}$, Direct P.M.-$f_{1B}$, Jar3d-$f_{1A}$ and Jar3d-$f_{1B}$ are the variants that sometimes result in combinatorial issues. | ||
340 | - | ||
341 | -\begin{figure}[h!] | ||
342 | -\includegraphics[width=\textwidth]{kernels_A.jpg} | ||
343 | -\includegraphics[width=\textwidth]{fig/kernels_B.png} | ||
344 | -\includegraphics[width=\textwidth]{fig/kernels_C.png} | ||
345 | -\includegraphics[width=\textwidth]{fig/kernels_D.png} | ||
346 | -\end{figure} | ||
347 | - | ||
348 | -\end{document} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment