Louis BECQUEY

doc

...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
2 CPLEXDir="/opt/ibm/ILOG/CPLEX_Studio128" 2 CPLEXDir="/opt/ibm/ILOG/CPLEX_Studio128"
3 IEIGEN="/usr/local/include/eigen3" 3 IEIGEN="/usr/local/include/eigen3"
4 INUPACK="/usr/local/include/nupack" 4 INUPACK="/usr/local/include/nupack"
5 -biorseoDir="/nhome/siniac/lbecquey/Software/biorseo" 5 +biorseoDir="/home/persalteas/Software/biorseo"
6 -jar3dexec="/nhome/siniac/lbecquey/Software/jar3dbin/jar3d_2014-12-11.jar" 6 +jar3dexec="/home/persalteas/Software/jar3dbin/jar3d_2014-12-11.jar"
7 -bypdir="/nhome/siniac/lbecquey/Software/BayesPairing/bayespairing/src" 7 +bypdir="/home/persalteas/Software/BayesPairing/bayespairing/src"
......
No preview for this file type
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
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 + \vspace{-2cm}
502 + \hfill\includegraphics{fig/oxford.png}}
503 + \vskip2pt
504 + \rule{415pt}{2\p@}\par%
505 + \helvetica
506 + \hbox to \textwidth{%
507 + \parbox[t]{36.5pc}{%
508 + \vspace*{3pt}
509 + \ifx\@subtitle\@empty
510 + \else
511 + {\helveticacn\fontsize{14}{21}\selectfont\raggedright \@subtitle \par}%
512 + \vspace{7.5\p@}
513 + \fi
514 + {\helveticabold\fontsize{18}{23}\selectfont\raggedright \@title \par}%
515 + \vspace{8.8\p@}
516 + {\helveticabold\boldmath\fontsize{12}{15}\selectfont\raggedright \@author \par}%
517 + \vspace{9\p@}
518 + {\helveticacn\fontsize{9}{12}\selectfont\raggedright \@address \par}%
519 + \vspace{6\p@}
520 + {\helveticacn\fontsize{8.5}{12}\selectfont\raggedright \@corresp \par}%
521 + \vspace{2\p@}
522 + {\helvetica\fontsize{8.5}{12}\selectfont\raggedright \@editor \par}
523 + \vspace{4\p@}
524 + {\helvetica\fontsize{7}{12}\selectfont\raggedright \@history \par}
525 + \vspace{14\p@}
526 + {
527 + \let\section\absection
528 + {\helvetica\fontsize{10}{12}\bfseries\selectfont Abstract}\par}
529 + \vskip5pt
530 + \begingroup\begin{minipage}[t]{415pt}\parindent=0pt
531 + {\helvetica\fontsize{9}{12}\selectfont \@abstract\par}
532 + \end{minipage}
533 + \endgroup
534 + %\vspace{20\p@}
535 + }%
536 + }
537 + \vspace{13.5\p@}%
538 + \rule{415pt}{2\p@}%
539 + \vspace{12\p@ plus 6\p@ minus 6\p@}%
540 + \vspace{\extraspace}
541 + }
542 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
543 +
544 +%%%%%%%%%%%%%%%%%%%%%%%%%%%% Abstract %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
545 +\newcommand{\absection}[1]{%
546 + \par\noindent{\bfseries #1}\space\ignorespaces}
547 +
548 +%\newenvironment{abstract}{%
549 +% \begingroup
550 +% \let\section\absection
551 +% \fontfamily{\sfdefault}\fontsize{10}{12}\sffamily\selectfont
552 +% {\fontseries{b}\selectfont Abstract}\par}
553 +%{\endgroup\bigskip\@afterheading\@afterindentfalse\vskip 12pt plus 3pt minus 1pt}
554 +
555 +% Section macros
556 +
557 +% Lowest level heading that takes a number by default
558 +\setcounter{secnumdepth}{3}
559 +
560 +\renewcommand{\@seccntformat}[1]{\csname the#1\endcsname\space}
561 +
562 +\def\section{%
563 + \@startsection{section}{1}{\z@}
564 + {-22\p@ plus -3\p@}{4\p@}
565 + {\reset@font\raggedright\helveticabold\fontsize{10}{12}\selectfont}}
566 +
567 +\def\subsection{%
568 + \@startsection{subsection}{2}{\z@}
569 + {-11\p@ plus -2\p@}{4\p@}
570 + {\reset@font\raggedright\helvetica\fontsize{9}{12}\selectfont}}
571 +
572 +\def\subsubsection{%
573 + \@startsection{subsubsection}{3}{\z@}
574 + {-11\p@ plus -1\p@}{0.001em}
575 + {\reset@font\normalfont\mathversion{bold}\normalsize\bfseries}}
576 +
577 +\def\textcolon{\text{\rm :}}
578 +
579 + \def\paragraph{%
580 + \@startsection{paragraph}{4}{\z@}
581 + {-6\p@}
582 + {-.4em}
583 + {\reset@font\itshape}}
584 +
585 +% ********************
586 +% Figures and tables *
587 +% ********************
588 +
589 +% Table and array parameters
590 +\setlength\arraycolsep{.5em}
591 +\setlength\tabcolsep{.5em}
592 +\setlength\arrayrulewidth{.5pt}
593 +\setlength\doublerulesep{2.5pt}
594 +\setlength\extrarowheight{\z@}
595 +\renewcommand\arraystretch{1}
596 +
597 +\newlength{\abovecaptionskip}
598 +\newlength{\belowcaptionskip}
599 +\setlength{\abovecaptionskip}{13pt}
600 +\setlength{\belowcaptionskip}{2pt}
601 +
602 +\long\def\@makecaption#1#2{\vspace{\abovecaptionskip}%
603 + \begingroup
604 + \scriptsize\sffamily
605 + \text{\sfb #1.}\space{#2}\par
606 + \endgroup}
607 +
608 +\long\def\@tablecaption#1#2{%
609 + \begingroup
610 + \fontsize{7.5pt}{10.5pt}\sffamily\selectfont
611 + \textbf{#1.}\space{#2\strut\par}
612 + \endgroup\vspace{\belowcaptionskip}}
613 +
614 +% Table rules
615 +\def\toprule{\noalign{\ifnum0=`}\fi\hrule \@height 0.5pt \hrule \@height 4pt \@width 0pt \futurelet
616 + \@tempa\@xhline}
617 +\def\midrule{\noalign{\ifnum0=`}\fi \hrule \@height 3pt \@width 0pt \hrule \@height 0.5pt
618 + \hrule \@height 4pt \@width 0pt \futurelet \@tempa\@xhline}
619 +\def\botrule{\noalign{\ifnum0=`}\fi \hrule \@height 3.75pt \@width 0pt \hrule \@height 0.5pt \futurelet
620 + \@tempa\@xhline}
621 +\def\hrulefill{\leavevmode\leaders\hrule height .5pt\hfill\kern\z@}
622 +
623 +\def\thefigure{\@arabic\c@figure}
624 +\def\fps@figure{tbp}
625 +\def\ftype@figure{1}
626 +\def\ext@figure{lof}
627 +\def\fnum@figure{\figurename~\thefigure}
628 +\def\figure{\@float{figure}}
629 +\let\endfigure\end@float
630 +\@namedef{figure*}{\@dblfloat{figure}}
631 +\@namedef{endfigure*}{\end@dblfloat}
632 +\def\thetable{\@arabic\c@table}
633 +\def\fps@table{tbp}
634 +\def\ftype@table{2}
635 +\def\ext@table{lot}
636 +\def\fnum@table{Table~\thetable}
637 +\def\table{\let\@makecaption\@tablecaption\let\source\tablesource\@float{table}}
638 +\def\endtable{\end@float}
639 +\@namedef{table*}{\let\@makecaption\@tablecaption\@dblfloat{table}}
640 +\@namedef{endtable*}{\end@dblfloat}
641 +
642 +\newif\if@rotate \@rotatefalse
643 +\newif\if@rotatecenter \@rotatecenterfalse
644 +\def\rotatecenter{\global\@rotatecentertrue}
645 +\def\rotateendcenter{\global\@rotatecenterfalse}
646 +\def\rotate{\global\@rotatetrue}
647 +\def\endrotate{\global\@rotatefalse}
648 +\newdimen\rotdimen
649 +\def\rotstart#1{\special{ps: gsave currentpoint currentpoint translate
650 + #1 neg exch neg exch translate}}
651 +\def\rotfinish{\special{ps: currentpoint grestore moveto}}
652 +\def\rotl#1{\rotdimen=\ht#1\advance\rotdimen by \dp#1
653 + \hbox to \rotdimen{\vbox to\wd#1{\vskip \wd#1
654 + \rotstart{270 rotate}\box #1\vss}\hss}\rotfinish}
655 +\def\rotr#1{\rotdimen=\ht #1\advance\rotdimen by \dp#1
656 + \hbox to \rotdimen{\vbox to \wd#1{\vskip \wd#1
657 + \rotstart{90 rotate}\box #1\vss}\hss}\rotfinish}
658 +
659 +\newdimen\tempdime
660 +\newbox\temptbox
661 +
662 +% From ifmtarg.sty
663 +% Copyright Peter Wilson and Donald Arseneau, 2000
664 +\begingroup
665 +\catcode`\Q=3
666 +\long\gdef\@ifmtarg#1{\@xifmtarg#1QQ\@secondoftwo\@firstoftwo\@nil}
667 +\long\gdef\@xifmtarg#1#2Q#3#4#5\@nil{#4}
668 +\long\gdef\@ifnotmtarg#1{\@xifmtarg#1QQ\@firstofone\@gobble\@nil}
669 +\endgroup
670 +
671 +\def\tablesize{\@setfontsize\tablesize{7.5\p@}{10\p@}}
672 +
673 +\newenvironment{processtable}[3]{\setbox\temptbox=\hbox{{\tablesize #2}}%
674 +\tempdime\wd\temptbox\@processtable{#1}{#2}{#3}{\tempdime}}
675 +{\relax}
676 +
677 +\newcommand{\@processtable}[4]{%
678 +\if@rotate
679 +\setbox4=\vbox to \hsize{\vss\hbox to \textheight{%
680 +\begin{minipage}{#4}%
681 +\@ifmtarg{#1}{}{\caption{#1}}{\tablesize #2}%
682 +\vskip7\p@\noindent
683 +\parbox{#4}{\fontsize{7}{9}\selectfont #3\par}%
684 +\end{minipage}}\vss}%
685 +\rotr{4}
686 +\else
687 +\hbox to \hsize{\hss\begin{minipage}[t]{#4}%
688 +\vskip2.9pt
689 +\@ifmtarg{#1}{}{\caption{#1}}{\tablesize #2}%
690 +\vskip6\p@\parindent=12pt
691 +\parbox{#4}{\fontsize{7}{9}\selectfont #3\par}%
692 +\end{minipage}\hss}\fi}%
693 +
694 +\newcolumntype{P}[1]{>{\raggedright\let\\\@arraycr\hangindent1em}p{#1}}
695 +
696 +% ******************************
697 +% List numbering and lettering *
698 +% ******************************
699 +\def\labelenumi{{\rm\arabic{enumi}.}}
700 +\def\theenumi{\arabic{enumi}}
701 +\def\labelenumii{{\rm\alph{enumii}.}}
702 +\def\theenumii{\alph{enumii}}
703 +\def\p@enumii{\theenumi}
704 +\def\labelenumiii{{\rm(\arabic{enumiii})}}
705 +\def\theenumiii{\roman{enumiii}}
706 +\def\p@enumiii{\theenumi(\theenumii)}
707 +\def\labelenumiv{{\rm(\arabic{enumiv})}}
708 +\def\theenumiv{\Alph{enumiv}}
709 +\def\p@enumiv{\p@enumiii\theenumiii}
710 +\def\labelitemi{{\small$\bullet$}}
711 +\def\labelitemii{{\small$\bullet$}}
712 +\def\labelitemiii{{\small$\bullet$}}
713 +\def\labelitemiv{{\small$\bullet$}}
714 +
715 +\def\@listI{\leftmargin\leftmargini \topsep\medskipamount}
716 +\let\@listi\@listI
717 +\@listi
718 +\def\@listii{\topsep\z@\leftmargin\leftmarginii}
719 +\def\@listiii{\leftmargin\leftmarginiii \topsep\z@}
720 +\def\@listiv{\leftmargin\leftmarginiv \topsep\z@}
721 +\def\@listv{\leftmargin\leftmarginv \topsep\z@}
722 +\def\@listvi{\leftmargin\leftmarginvi \topsep\z@}
723 +
724 +\setlength{\leftmargini}{3mm}
725 +\setlength{\leftmarginii}{\z@}
726 +\setlength{\leftmarginiii}{\z@}
727 +\setlength{\leftmarginiv}{\z@}
728 +
729 +% Changes to the list parameters for enumerate
730 +\def\enumargs{%
731 + \partopsep \z@
732 + \itemsep \z@
733 + \parsep \z@
734 + \labelsep 1em
735 + \listparindent \parindent
736 + \itemindent \z@
737 + \topsep 7\p@
738 +}
739 +
740 +\def\enumerate{%
741 + \@ifnextchar[{\@numerate}{\@numerate[0]}}
742 +
743 +\def\@numerate[#1]{%
744 + \ifnum \@enumdepth >3 \@toodeep\else
745 + \advance\@enumdepth \@ne
746 + \edef\@enumctr{enum\romannumeral\the\@enumdepth}
747 + \list{\csname label\@enumctr\endcsname}{%
748 + \enumargs
749 + \setlength{\leftmargin}{\csname leftmargin\romannumeral\the\@enumdepth\endcsname}
750 + \usecounter{\@enumctr}
751 + \settowidth\labelwidth{#1}
752 + \addtolength{\leftmargin}{\labelwidth}
753 + \addtolength{\leftmargin}{2pt}
754 + \def\makelabel##1{\hss \llap{##1}}}%
755 + \fi
756 + }
757 +\let\endenumerate\endlist
758 +
759 +% Changes to the list parameters for itemize
760 +\def\itemargs{%
761 + \partopsep \z@
762 + \itemsep 0\p@
763 + \parsep \z@
764 + \labelsep 1em
765 + \rightmargin \z@
766 + \listparindent \parindent
767 + \itemindent \z@
768 + \topsep7\p@
769 +}
770 +
771 +\def\itemize{%
772 + \@ifnextchar[{\@itemize}{\@itemize[$\bullet$]}}
773 +
774 +\def\@itemize[#1]{%
775 + \ifnum \@itemdepth >3 \@toodeep\else
776 + \advance\@itemdepth \@ne
777 + \edef\@itemctr{item\romannumeral\the\@itemdepth}
778 + \list{\csname label\@itemctr\endcsname}{%
779 + \itemargs
780 + \setlength{\leftmargin}{\csname leftmargin\romannumeral\the\@itemdepth\endcsname}
781 + \settowidth\labelwidth{#1}
782 + \addtolength{\leftmargin}{\labelwidth}
783 + %\addtolength{\leftmargin}{\labelsep}
784 + \def\makelabel##1{\hss \llap{##1}}}%
785 + \fi
786 + }
787 +\let\enditemize\endlist
788 +
789 +\newenvironment{unlist}{%
790 + \begin{list}{}%
791 + {\setlength{\labelwidth}{\z@}%
792 + \setlength{\labelsep}{\z@}%
793 + \setlength{\topsep}{\medskipamount}%
794 + \setlength{\itemsep}{3\p@}%
795 + \setlength{\leftmargin}{2em}%
796 + \setlength{\itemindent}{-2em}}}
797 +{\end{list}}
798 +
799 +
800 +% ***********************
801 +% Quotes and Quotations *
802 +% ***********************
803 +\def\quotation{\par\begin{list}{}{
804 + \setlength{\topsep}{\medskipamount}
805 + \setlength{\leftmargin}{2em}%
806 + \setlength{\rightmargin}{\z@}%
807 + \setlength\labelwidth{0pt}%
808 + \setlength\labelsep{0pt}%
809 + \listparindent\parindent}%
810 + \item[]}
811 +\def\endquotation{\end{list}}
812 +\let\quote\quotation
813 +\let\endquote\endquotation
814 +
815 +\skip\@mpfootins = \skip\footins
816 +\fboxsep=6\p@
817 +\fboxrule=1\p@
818 +
819 +% *******************
820 +% Table of contents *
821 +% *******************
822 +\newcommand\@pnumwidth{4em}
823 +\newcommand\@tocrmarg{2.55em plus 1fil}
824 +\newcommand\@dotsep{1000}
825 +\setcounter{tocdepth}{4}
826 +
827 +\def\numberline#1{\hbox to \@tempdima{{#1}}}
828 +
829 +\def\@authortocline#1#2#3#4#5{%
830 + \vskip 1.5\p@
831 + \ifnum #1>\c@tocdepth \else
832 + {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
833 + \parindent #2\relax\@afterindenttrue
834 + \interlinepenalty\@M
835 + \leavevmode
836 + \@tempdima #3\relax
837 + \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
838 + {\itshape #4}\nobreak
839 + \leaders\hbox{$\m@th
840 + \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
841 + mu$}\hfill
842 + \nobreak
843 + \hb@xt@\@pnumwidth{\hfil}%
844 + \par}%
845 + \fi}
846 +
847 +\newcommand*\l@author{\@authortocline{2}{0pt}{30pt}}
848 +\newcommand*\l@section{\@dottedtocline{3}{11pt}{20pt}}
849 +\newcommand*\l@subsection{\@dottedtocline{4}{31pt}{29pt}}
850 +\newcommand*\l@subsubsection[2]{}
851 +
852 +
853 +
854 +% ***********
855 +% Footnotes *
856 +% ***********
857 +
858 +\def\footnoterule{\noindent\rule{\columnwidth}{0.5pt}}
859 +\def\@makefnmark{\@textsuperscript{\normalfont\@thefnmark}}%
860 +\newcommand\@makefntext[1]{\noindent{\@makefnmark}\enskip#1}
861 +
862 +% ***********
863 +% References *
864 +% ***********
865 +
866 +\providecommand{\newblock}{}
867 +\newenvironment{thebibliography}{%
868 + \section{\bibname}%
869 + \begingroup
870 + \small
871 + \begin{list}{}{%
872 + \setlength{\topsep}{\z@}%
873 + \setlength{\labelsep}{\z@}%
874 + \settowidth{\labelwidth}{\z@}%
875 + \setlength{\leftmargin}{4mm}%
876 + \setlength{\itemindent}{-4mm}}\small}
877 +{\end{list}\endgroup}
878 +
879 +\RequirePackage{natbib}
880 +
881 +% **********
882 +% Appendix *
883 +% **********
884 +\newif\ifappend % Are we in the Appendix?
885 +\def\appendix{\par
886 + \setcounter{section}{0}
887 + \setcounter{subsection}{0}
888 + \appendtrue
889 +}
890 +
891 +%Math parameters
892 +
893 +\setlength{\jot}{5\p@}
894 +\mathchardef\@m=1500 % adapted value
895 +
896 +\def\frenchspacing{\sfcode`\.\@m \sfcode`\?\@m \sfcode`\!\@m
897 + \sfcode`\:\@m \sfcode`\;\@m \sfcode`\,\@m}
898 +
899 +% Theorems
900 +\def\th@plain{%
901 +%% \let\thm@indent\noindent % no indent
902 +\thm@headfont{\quad\scshape}% heading font is bold
903 +\thm@notefont{\upshape\mdseries}% same as heading font
904 +\thm@headpunct{.}% no period after heading
905 +\thm@headsep 5\p@ plus\p@ minus\p@\relax
906 +%% \let\thm@swap\@gobble
907 +%% \thm@preskip\topsep
908 +%% \thm@postskip\theorempreskipamount
909 +\itshape % body font
910 +}
911 +
912 +\vbadness=9999
913 +\tolerance=9999
914 +\doublehyphendemerits=10000
915 +\doublehyphendemerits 640000 % corresponds to badness 800
916 +\finalhyphendemerits 1000000 % corresponds to badness 1000
917 +
918 +\flushbottom
919 +\frenchspacing
920 +\ps@headings
921 +\twocolumn
922 +
923 +% Screen PDF compatability
924 +\newcommand{\medline}[1]{%
925 + \unskip\unskip\ignorespaces}
926 +
927 +
928 +%%%%for smaller size text
929 +\newenvironment{methods}{%
930 + \begingroup
931 +\def\section{%
932 + \@startsection{section}{1}{\z@}
933 + {-24\p@ plus -3\p@}{4\p@}
934 + {\reset@font\raggedright\helveticabold\fontsize{10}{12}\selectfont}}
935 + \def\subsection{%
936 + \@startsection{subsection}{2}{\z@}
937 + {-11\p@ plus -2\p@}{4\p@}
938 + {\reset@font\raggedright\helvetica\fontsize{9}{12}\selectfont}}
939 +\def\subsubsection{%
940 + \@startsection{subsubsection}{3}{\z@}
941 + {-11\p@ plus -1\p@}{0.001em}
942 + {\reset@font\normalfont\mathversion{bold}\normalsize\bfseries}}
943 +\normalsize
944 + \par}
945 +{\par\endgroup\bigskip\@afterheading\@afterindentfalse}
946 +
947 +
948 +
949 +\graphicspath{{g:/artwork/oup/bioinfo/}}
950 +
951 +\language=2
952 +
953 +\hyphenation{Figure Table Figures Tables}
954 +
955 +\newcommand{\href}[2]{#2}
956 +
957 +\renewenvironment{proof}[1][\proofname]{\par
958 + \normalfont \topsep6\p@\@plus6\p@\relax
959 + \labelsep 0.5em
960 + \trivlist
961 + \item[\hskip\labelsep\hskip1em\textsc{#1}.]\ignorespaces
962 +}{\endtrivlist\@endpefalse}
963 +
964 +%%Different Bonds
965 +
966 +\def\sbond{\ensuremath{\raise.25ex\hbox{${-}\!\!\!\!{-}$}}\kern -.9pt}
967 +\def\dbond{\ensuremath{\raise.25ex\hbox{=$\!$=}}}
968 +\def\tbond{\ensuremath{\raise.20ex\hbox{${\equiv}\!\!\!{\equiv}$}}}
969 +
970 +% Author queries
971 +%\fboxsep=4\p@
972 +%\fboxrule=0.5\p@
973 +\newcommand{\query}[2][0pt]{}%
974 +% \marginpar{\vspace*{#1}%
975 +% {\parbox{\marginparwidth}{%
976 +% \raggedright\fontsize{6}{8}\selectfont
977 +% #2}}}}
978 +
979 +\renewcommand{\dag}{{\mathversion{normal}$^{\dagger}$}}
980 +
981 +\endinput
...\ No newline at end of file ...\ No newline at end of file
1 -<?xml version="1.0"?>
2 -<!DOCTYPE ipe SYSTEM "ipe.dtd">
3 -<ipe version="70206" creator="Ipe 7.2.7">
4 -<info created="D:20181019094517" modified="D:20181019094517"/>
5 -<ipestyle name="basic">
6 -<symbol name="arrow/arc(spx)">
7 -<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
8 -0 0 m
9 --1 0.333 l
10 --1 -0.333 l
11 -h
12 -</path>
13 -</symbol>
14 -<symbol name="arrow/farc(spx)">
15 -<path stroke="sym-stroke" fill="white" pen="sym-pen">
16 -0 0 m
17 --1 0.333 l
18 --1 -0.333 l
19 -h
20 -</path>
21 -</symbol>
22 -<symbol name="arrow/ptarc(spx)">
23 -<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
24 -0 0 m
25 --1 0.333 l
26 --0.8 0 l
27 --1 -0.333 l
28 -h
29 -</path>
30 -</symbol>
31 -<symbol name="arrow/fptarc(spx)">
32 -<path stroke="sym-stroke" fill="white" pen="sym-pen">
33 -0 0 m
34 --1 0.333 l
35 --0.8 0 l
36 --1 -0.333 l
37 -h
38 -</path>
39 -</symbol>
40 -<symbol name="mark/circle(sx)" transformations="translations">
41 -<path fill="sym-stroke">
42 -0.6 0 0 0.6 0 0 e
43 -0.4 0 0 0.4 0 0 e
44 -</path>
45 -</symbol>
46 -<symbol name="mark/disk(sx)" transformations="translations">
47 -<path fill="sym-stroke">
48 -0.6 0 0 0.6 0 0 e
49 -</path>
50 -</symbol>
51 -<symbol name="mark/fdisk(sfx)" transformations="translations">
52 -<group>
53 -<path fill="sym-fill">
54 -0.5 0 0 0.5 0 0 e
55 -</path>
56 -<path fill="sym-stroke" fillrule="eofill">
57 -0.6 0 0 0.6 0 0 e
58 -0.4 0 0 0.4 0 0 e
59 -</path>
60 -</group>
61 -</symbol>
62 -<symbol name="mark/box(sx)" transformations="translations">
63 -<path fill="sym-stroke" fillrule="eofill">
64 --0.6 -0.6 m
65 -0.6 -0.6 l
66 -0.6 0.6 l
67 --0.6 0.6 l
68 -h
69 --0.4 -0.4 m
70 -0.4 -0.4 l
71 -0.4 0.4 l
72 --0.4 0.4 l
73 -h
74 -</path>
75 -</symbol>
76 -<symbol name="mark/square(sx)" transformations="translations">
77 -<path fill="sym-stroke">
78 --0.6 -0.6 m
79 -0.6 -0.6 l
80 -0.6 0.6 l
81 --0.6 0.6 l
82 -h
83 -</path>
84 -</symbol>
85 -<symbol name="mark/fsquare(sfx)" transformations="translations">
86 -<group>
87 -<path fill="sym-fill">
88 --0.5 -0.5 m
89 -0.5 -0.5 l
90 -0.5 0.5 l
91 --0.5 0.5 l
92 -h
93 -</path>
94 -<path fill="sym-stroke" fillrule="eofill">
95 --0.6 -0.6 m
96 -0.6 -0.6 l
97 -0.6 0.6 l
98 --0.6 0.6 l
99 -h
100 --0.4 -0.4 m
101 -0.4 -0.4 l
102 -0.4 0.4 l
103 --0.4 0.4 l
104 -h
105 -</path>
106 -</group>
107 -</symbol>
108 -<symbol name="mark/cross(sx)" transformations="translations">
109 -<group>
110 -<path fill="sym-stroke">
111 --0.43 -0.57 m
112 -0.57 0.43 l
113 -0.43 0.57 l
114 --0.57 -0.43 l
115 -h
116 -</path>
117 -<path fill="sym-stroke">
118 --0.43 0.57 m
119 -0.57 -0.43 l
120 -0.43 -0.57 l
121 --0.57 0.43 l
122 -h
123 -</path>
124 -</group>
125 -</symbol>
126 -<symbol name="arrow/fnormal(spx)">
127 -<path stroke="sym-stroke" fill="white" pen="sym-pen">
128 -0 0 m
129 --1 0.333 l
130 --1 -0.333 l
131 -h
132 -</path>
133 -</symbol>
134 -<symbol name="arrow/pointed(spx)">
135 -<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
136 -0 0 m
137 --1 0.333 l
138 --0.8 0 l
139 --1 -0.333 l
140 -h
141 -</path>
142 -</symbol>
143 -<symbol name="arrow/fpointed(spx)">
144 -<path stroke="sym-stroke" fill="white" pen="sym-pen">
145 -0 0 m
146 --1 0.333 l
147 --0.8 0 l
148 --1 -0.333 l
149 -h
150 -</path>
151 -</symbol>
152 -<symbol name="arrow/linear(spx)">
153 -<path stroke="sym-stroke" pen="sym-pen">
154 --1 0.333 m
155 -0 0 l
156 --1 -0.333 l
157 -</path>
158 -</symbol>
159 -<symbol name="arrow/fdouble(spx)">
160 -<path stroke="sym-stroke" fill="white" pen="sym-pen">
161 -0 0 m
162 --1 0.333 l
163 --1 -0.333 l
164 -h
165 --1 0 m
166 --2 0.333 l
167 --2 -0.333 l
168 -h
169 -</path>
170 -</symbol>
171 -<symbol name="arrow/double(spx)">
172 -<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
173 -0 0 m
174 --1 0.333 l
175 --1 -0.333 l
176 -h
177 --1 0 m
178 --2 0.333 l
179 --2 -0.333 l
180 -h
181 -</path>
182 -</symbol>
183 -<pen name="heavier" value="0.8"/>
184 -<pen name="fat" value="1.2"/>
185 -<pen name="ultrafat" value="2"/>
186 -<symbolsize name="large" value="5"/>
187 -<symbolsize name="small" value="2"/>
188 -<symbolsize name="tiny" value="1.1"/>
189 -<arrowsize name="large" value="10"/>
190 -<arrowsize name="small" value="5"/>
191 -<arrowsize name="tiny" value="3"/>
192 -<color name="red" value="1 0 0"/>
193 -<color name="green" value="0 1 0"/>
194 -<color name="blue" value="0 0 1"/>
195 -<color name="yellow" value="1 1 0"/>
196 -<color name="orange" value="1 0.647 0"/>
197 -<color name="gold" value="1 0.843 0"/>
198 -<color name="purple" value="0.627 0.125 0.941"/>
199 -<color name="gray" value="0.745"/>
200 -<color name="brown" value="0.647 0.165 0.165"/>
201 -<color name="navy" value="0 0 0.502"/>
202 -<color name="pink" value="1 0.753 0.796"/>
203 -<color name="seagreen" value="0.18 0.545 0.341"/>
204 -<color name="turquoise" value="0.251 0.878 0.816"/>
205 -<color name="violet" value="0.933 0.51 0.933"/>
206 -<color name="darkblue" value="0 0 0.545"/>
207 -<color name="darkcyan" value="0 0.545 0.545"/>
208 -<color name="darkgray" value="0.663"/>
209 -<color name="darkgreen" value="0 0.392 0"/>
210 -<color name="darkmagenta" value="0.545 0 0.545"/>
211 -<color name="darkorange" value="1 0.549 0"/>
212 -<color name="darkred" value="0.545 0 0"/>
213 -<color name="lightblue" value="0.678 0.847 0.902"/>
214 -<color name="lightcyan" value="0.878 1 1"/>
215 -<color name="lightgray" value="0.827"/>
216 -<color name="lightgreen" value="0.565 0.933 0.565"/>
217 -<color name="lightyellow" value="1 1 0.878"/>
218 -<dashstyle name="dashed" value="[4] 0"/>
219 -<dashstyle name="dotted" value="[1 3] 0"/>
220 -<dashstyle name="dash dotted" value="[4 2 1 2] 0"/>
221 -<dashstyle name="dash dot dotted" value="[4 2 1 2 1 2] 0"/>
222 -<textsize name="large" value="\large"/>
223 -<textsize name="Large" value="\Large"/>
224 -<textsize name="LARGE" value="\LARGE"/>
225 -<textsize name="huge" value="\huge"/>
226 -<textsize name="Huge" value="\Huge"/>
227 -<textsize name="small" value="\small"/>
228 -<textsize name="footnote" value="\footnotesize"/>
229 -<textsize name="tiny" value="\tiny"/>
230 -<textstyle name="center" begin="\begin{center}" end="\end{center}"/>
231 -<textstyle name="itemize" begin="\begin{itemize}" end="\end{itemize}"/>
232 -<textstyle name="item" begin="\begin{itemize}\item{}" end="\end{itemize}"/>
233 -<gridsize name="4 pts" value="4"/>
234 -<gridsize name="8 pts (~3 mm)" value="8"/>
235 -<gridsize name="16 pts (~6 mm)" value="16"/>
236 -<gridsize name="32 pts (~12 mm)" value="32"/>
237 -<gridsize name="10 pts (~3.5 mm)" value="10"/>
238 -<gridsize name="20 pts (~7 mm)" value="20"/>
239 -<gridsize name="14 pts (~5 mm)" value="14"/>
240 -<gridsize name="28 pts (~10 mm)" value="28"/>
241 -<gridsize name="56 pts (~20 mm)" value="56"/>
242 -<anglesize name="90 deg" value="90"/>
243 -<anglesize name="60 deg" value="60"/>
244 -<anglesize name="45 deg" value="45"/>
245 -<anglesize name="30 deg" value="30"/>
246 -<anglesize name="22.5 deg" value="22.5"/>
247 -<opacity name="10%" value="0.1"/>
248 -<opacity name="30%" value="0.3"/>
249 -<opacity name="50%" value="0.5"/>
250 -<opacity name="75%" value="0.75"/>
251 -<tiling name="falling" angle="-60" step="4" width="1"/>
252 -<tiling name="rising" angle="30" step="4" width="1"/>
253 -</ipestyle>
254 -<page>
255 -<layer name="alpha"/>
256 -<view layers="alpha" active="alpha"/>
257 -<path layer="alpha" stroke="black" pen="ultrafat">
258 -64 784 m
259 -416 784 l
260 -</path>
261 -<use name="mark/disk(sx)" pos="80 784" size="large" stroke="black"/>
262 -<use name="mark/disk(sx)" pos="96 784" size="large" stroke="black"/>
263 -<use name="mark/disk(sx)" pos="112 784" size="large" stroke="black"/>
264 -<use name="mark/disk(sx)" pos="128 784" size="large" stroke="black"/>
265 -<use name="mark/disk(sx)" pos="144 784" size="large" stroke="black"/>
266 -<use name="mark/disk(sx)" pos="160 784" size="large" stroke="black"/>
267 -<use name="mark/disk(sx)" pos="176 784" size="large" stroke="black"/>
268 -<use name="mark/disk(sx)" pos="192 784" size="large" stroke="black"/>
269 -<use name="mark/disk(sx)" pos="208 784" size="large" stroke="black"/>
270 -<use name="mark/disk(sx)" pos="224 784" size="large" stroke="black"/>
271 -<use name="mark/disk(sx)" pos="240 784" size="large" stroke="black"/>
272 -<use name="mark/disk(sx)" pos="256 784" size="large" stroke="black"/>
273 -<use name="mark/disk(sx)" pos="272 784" size="large" stroke="black"/>
274 -<use name="mark/disk(sx)" pos="288 784" size="large" stroke="black"/>
275 -<use name="mark/disk(sx)" pos="304 784" size="large" stroke="black"/>
276 -<use name="mark/disk(sx)" pos="320 784" size="large" stroke="black"/>
277 -<use name="mark/disk(sx)" pos="336 784" size="large" stroke="black"/>
278 -<use name="mark/disk(sx)" pos="352 784" size="large" stroke="black"/>
279 -<use name="mark/disk(sx)" pos="368 784" size="large" stroke="black"/>
280 -<use name="mark/disk(sx)" pos="384 784" size="large" stroke="black"/>
281 -<use name="mark/disk(sx)" pos="400 784" size="large" stroke="black"/>
282 -<path stroke="red">
283 -136 792 m
284 -136 776 l
285 -328 776 l
286 -328 792 l
287 -h
288 -</path>
289 -<path matrix="1 0 0 1 0 -48" stroke="black" pen="ultrafat">
290 -64 784 m
291 -416 784 l
292 -</path>
293 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="80 784" size="large" stroke="black"/>
294 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="96 784" size="large" stroke="black"/>
295 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="112 784" size="large" stroke="black"/>
296 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="128 784" size="large" stroke="black"/>
297 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="144 784" size="large" stroke="black"/>
298 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="160 784" size="large" stroke="black"/>
299 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="176 784" size="large" stroke="black"/>
300 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="192 784" size="large" stroke="black"/>
301 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="208 784" size="large" stroke="black"/>
302 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="224 784" size="large" stroke="black"/>
303 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="240 784" size="large" stroke="black"/>
304 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="256 784" size="large" stroke="black"/>
305 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="272 784" size="large" stroke="black"/>
306 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="288 784" size="large" stroke="black"/>
307 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="304 784" size="large" stroke="black"/>
308 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="320 784" size="large" stroke="black"/>
309 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="336 784" size="large" stroke="black"/>
310 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="352 784" size="large" stroke="black"/>
311 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="368 784" size="large" stroke="black"/>
312 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="384 784" size="large" stroke="black"/>
313 -<use matrix="1 0 0 1 0 -48" name="mark/disk(sx)" pos="400 784" size="large" stroke="black"/>
314 -<path matrix="1 0 0 1 0 -48" stroke="red">
315 -136 792 m
316 -136 776 l
317 -328 776 l
318 -328 792 l
319 -h
320 -</path>
321 -<text matrix="1 0 0 1 8 -16" transformations="translations" pos="128 816" stroke="red" type="label" width="19.442" height="6.176" depth="4.09" valign="baseline" size="Large">$p_{x,i}$</text>
322 -<text matrix="1 0 0 1 0 -16" transformations="translations" pos="136 832" stroke="black" type="label" width="11.515" height="8.896" depth="0" valign="baseline" size="huge">$u$</text>
323 -<text matrix="1 0 0 1 8 -64" transformations="translations" pos="128 816" stroke="red" type="label" width="19.442" height="6.176" depth="4.09" valign="baseline" size="Large">$p_{x,i}$</text>
324 -<text matrix="1 0 0 1 60 -16" transformations="translations" pos="324 808" stroke="red" type="label" width="35.903" height="6.225" depth="2.16" valign="baseline" size="small">$k_{x,i} = 12$</text>
325 -<text matrix="1 0 0 1 60 -60" transformations="translations" pos="324 808" stroke="red" type="label" width="35.903" height="6.225" depth="2.16" valign="baseline" size="small" style="math">k_{x,i} = 12</text>
326 -<text matrix="1 0 0 1 180 -116" transformations="translations" pos="136 832" stroke="black" type="label" width="11.515" height="8.896" depth="0" valign="baseline" size="huge" style="math">u</text>
327 -<text matrix="1 0 0 1 -20 -132" transformations="translations" pos="136 832" stroke="black" type="label" width="69.552" height="9.962" depth="4.09" valign="baseline" size="Large" style="math">u-k_{x,i}+1</text>
328 -<path stroke="black" fill="white" arrow="normal/normal">
329 -144 712 m
330 -144 732 l
331 -</path>
332 -</page>
333 -</ipe>
1 -<?xml version="1.0"?>
2 -<!DOCTYPE ipe SYSTEM "ipe.dtd">
3 -<ipe version="70206" creator="Ipe 7.2.7">
4 -<info created="D:20181012182334" modified="D:20181012182334"/>
5 -<ipestyle name="basic">
6 -<symbol name="arrow/arc(spx)">
7 -<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
8 -0 0 m
9 --1 0.333 l
10 --1 -0.333 l
11 -h
12 -</path>
13 -</symbol>
14 -<symbol name="arrow/farc(spx)">
15 -<path stroke="sym-stroke" fill="white" pen="sym-pen">
16 -0 0 m
17 --1 0.333 l
18 --1 -0.333 l
19 -h
20 -</path>
21 -</symbol>
22 -<symbol name="arrow/ptarc(spx)">
23 -<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
24 -0 0 m
25 --1 0.333 l
26 --0.8 0 l
27 --1 -0.333 l
28 -h
29 -</path>
30 -</symbol>
31 -<symbol name="arrow/fptarc(spx)">
32 -<path stroke="sym-stroke" fill="white" pen="sym-pen">
33 -0 0 m
34 --1 0.333 l
35 --0.8 0 l
36 --1 -0.333 l
37 -h
38 -</path>
39 -</symbol>
40 -<symbol name="mark/circle(sx)" transformations="translations">
41 -<path fill="sym-stroke">
42 -0.6 0 0 0.6 0 0 e
43 -0.4 0 0 0.4 0 0 e
44 -</path>
45 -</symbol>
46 -<symbol name="mark/disk(sx)" transformations="translations">
47 -<path fill="sym-stroke">
48 -0.6 0 0 0.6 0 0 e
49 -</path>
50 -</symbol>
51 -<symbol name="mark/fdisk(sfx)" transformations="translations">
52 -<group>
53 -<path fill="sym-fill">
54 -0.5 0 0 0.5 0 0 e
55 -</path>
56 -<path fill="sym-stroke" fillrule="eofill">
57 -0.6 0 0 0.6 0 0 e
58 -0.4 0 0 0.4 0 0 e
59 -</path>
60 -</group>
61 -</symbol>
62 -<symbol name="mark/box(sx)" transformations="translations">
63 -<path fill="sym-stroke" fillrule="eofill">
64 --0.6 -0.6 m
65 -0.6 -0.6 l
66 -0.6 0.6 l
67 --0.6 0.6 l
68 -h
69 --0.4 -0.4 m
70 -0.4 -0.4 l
71 -0.4 0.4 l
72 --0.4 0.4 l
73 -h
74 -</path>
75 -</symbol>
76 -<symbol name="mark/square(sx)" transformations="translations">
77 -<path fill="sym-stroke">
78 --0.6 -0.6 m
79 -0.6 -0.6 l
80 -0.6 0.6 l
81 --0.6 0.6 l
82 -h
83 -</path>
84 -</symbol>
85 -<symbol name="mark/fsquare(sfx)" transformations="translations">
86 -<group>
87 -<path fill="sym-fill">
88 --0.5 -0.5 m
89 -0.5 -0.5 l
90 -0.5 0.5 l
91 --0.5 0.5 l
92 -h
93 -</path>
94 -<path fill="sym-stroke" fillrule="eofill">
95 --0.6 -0.6 m
96 -0.6 -0.6 l
97 -0.6 0.6 l
98 --0.6 0.6 l
99 -h
100 --0.4 -0.4 m
101 -0.4 -0.4 l
102 -0.4 0.4 l
103 --0.4 0.4 l
104 -h
105 -</path>
106 -</group>
107 -</symbol>
108 -<symbol name="mark/cross(sx)" transformations="translations">
109 -<group>
110 -<path fill="sym-stroke">
111 --0.43 -0.57 m
112 -0.57 0.43 l
113 -0.43 0.57 l
114 --0.57 -0.43 l
115 -h
116 -</path>
117 -<path fill="sym-stroke">
118 --0.43 0.57 m
119 -0.57 -0.43 l
120 -0.43 -0.57 l
121 --0.57 0.43 l
122 -h
123 -</path>
124 -</group>
125 -</symbol>
126 -<symbol name="arrow/fnormal(spx)">
127 -<path stroke="sym-stroke" fill="white" pen="sym-pen">
128 -0 0 m
129 --1 0.333 l
130 --1 -0.333 l
131 -h
132 -</path>
133 -</symbol>
134 -<symbol name="arrow/pointed(spx)">
135 -<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
136 -0 0 m
137 --1 0.333 l
138 --0.8 0 l
139 --1 -0.333 l
140 -h
141 -</path>
142 -</symbol>
143 -<symbol name="arrow/fpointed(spx)">
144 -<path stroke="sym-stroke" fill="white" pen="sym-pen">
145 -0 0 m
146 --1 0.333 l
147 --0.8 0 l
148 --1 -0.333 l
149 -h
150 -</path>
151 -</symbol>
152 -<symbol name="arrow/linear(spx)">
153 -<path stroke="sym-stroke" pen="sym-pen">
154 --1 0.333 m
155 -0 0 l
156 --1 -0.333 l
157 -</path>
158 -</symbol>
159 -<symbol name="arrow/fdouble(spx)">
160 -<path stroke="sym-stroke" fill="white" pen="sym-pen">
161 -0 0 m
162 --1 0.333 l
163 --1 -0.333 l
164 -h
165 --1 0 m
166 --2 0.333 l
167 --2 -0.333 l
168 -h
169 -</path>
170 -</symbol>
171 -<symbol name="arrow/double(spx)">
172 -<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
173 -0 0 m
174 --1 0.333 l
175 --1 -0.333 l
176 -h
177 --1 0 m
178 --2 0.333 l
179 --2 -0.333 l
180 -h
181 -</path>
182 -</symbol>
183 -<pen name="heavier" value="0.8"/>
184 -<pen name="fat" value="1.2"/>
185 -<pen name="ultrafat" value="2"/>
186 -<symbolsize name="large" value="5"/>
187 -<symbolsize name="small" value="2"/>
188 -<symbolsize name="tiny" value="1.1"/>
189 -<arrowsize name="large" value="10"/>
190 -<arrowsize name="small" value="5"/>
191 -<arrowsize name="tiny" value="3"/>
192 -<color name="red" value="1 0 0"/>
193 -<color name="green" value="0 1 0"/>
194 -<color name="blue" value="0 0 1"/>
195 -<color name="yellow" value="1 1 0"/>
196 -<color name="orange" value="1 0.647 0"/>
197 -<color name="gold" value="1 0.843 0"/>
198 -<color name="purple" value="0.627 0.125 0.941"/>
199 -<color name="gray" value="0.745"/>
200 -<color name="brown" value="0.647 0.165 0.165"/>
201 -<color name="navy" value="0 0 0.502"/>
202 -<color name="pink" value="1 0.753 0.796"/>
203 -<color name="seagreen" value="0.18 0.545 0.341"/>
204 -<color name="turquoise" value="0.251 0.878 0.816"/>
205 -<color name="violet" value="0.933 0.51 0.933"/>
206 -<color name="darkblue" value="0 0 0.545"/>
207 -<color name="darkcyan" value="0 0.545 0.545"/>
208 -<color name="darkgray" value="0.663"/>
209 -<color name="darkgreen" value="0 0.392 0"/>
210 -<color name="darkmagenta" value="0.545 0 0.545"/>
211 -<color name="darkorange" value="1 0.549 0"/>
212 -<color name="darkred" value="0.545 0 0"/>
213 -<color name="lightblue" value="0.678 0.847 0.902"/>
214 -<color name="lightcyan" value="0.878 1 1"/>
215 -<color name="lightgray" value="0.827"/>
216 -<color name="lightgreen" value="0.565 0.933 0.565"/>
217 -<color name="lightyellow" value="1 1 0.878"/>
218 -<dashstyle name="dashed" value="[4] 0"/>
219 -<dashstyle name="dotted" value="[1 3] 0"/>
220 -<dashstyle name="dash dotted" value="[4 2 1 2] 0"/>
221 -<dashstyle name="dash dot dotted" value="[4 2 1 2 1 2] 0"/>
222 -<textsize name="large" value="\large"/>
223 -<textsize name="Large" value="\Large"/>
224 -<textsize name="LARGE" value="\LARGE"/>
225 -<textsize name="huge" value="\huge"/>
226 -<textsize name="Huge" value="\Huge"/>
227 -<textsize name="small" value="\small"/>
228 -<textsize name="footnote" value="\footnotesize"/>
229 -<textsize name="tiny" value="\tiny"/>
230 -<textstyle name="center" begin="\begin{center}" end="\end{center}"/>
231 -<textstyle name="itemize" begin="\begin{itemize}" end="\end{itemize}"/>
232 -<textstyle name="item" begin="\begin{itemize}\item{}" end="\end{itemize}"/>
233 -<gridsize name="4 pts" value="4"/>
234 -<gridsize name="8 pts (~3 mm)" value="8"/>
235 -<gridsize name="16 pts (~6 mm)" value="16"/>
236 -<gridsize name="32 pts (~12 mm)" value="32"/>
237 -<gridsize name="10 pts (~3.5 mm)" value="10"/>
238 -<gridsize name="20 pts (~7 mm)" value="20"/>
239 -<gridsize name="14 pts (~5 mm)" value="14"/>
240 -<gridsize name="28 pts (~10 mm)" value="28"/>
241 -<gridsize name="56 pts (~20 mm)" value="56"/>
242 -<anglesize name="90 deg" value="90"/>
243 -<anglesize name="60 deg" value="60"/>
244 -<anglesize name="45 deg" value="45"/>
245 -<anglesize name="30 deg" value="30"/>
246 -<anglesize name="22.5 deg" value="22.5"/>
247 -<opacity name="10%" value="0.1"/>
248 -<opacity name="30%" value="0.3"/>
249 -<opacity name="50%" value="0.5"/>
250 -<opacity name="75%" value="0.75"/>
251 -<tiling name="falling" angle="-60" step="4" width="1"/>
252 -<tiling name="rising" angle="30" step="4" width="1"/>
253 -</ipestyle>
254 -<page>
255 -<layer name="alpha"/>
256 -<view layers="alpha" active="alpha"/>
257 -<path layer="alpha" matrix="1 0 0 1 -32 0" stroke="black" pen="ultrafat">
258 -64 704 m
259 -320 704 l
260 -</path>
261 -<path matrix="1 0 0 1 -32 0" stroke="black" pen="ultrafat">
262 -96 704 m
263 -32.249 0 0 -32.249 128 708 160 704 a
264 -</path>
265 -<path matrix="1 0 0 1 -32 0" stroke="black" pen="ultrafat">
266 -208 704 m
267 -25.2982 0 0 -25.2982 232 696 256 704 a
268 -</path>
269 -<path matrix="1 0 0 1 -32 0" stroke="black" pen="ultrafat">
270 -128 704 m
271 -77.746 0 0 -77.746 200 674.667 272 704 a
272 -</path>
273 -<path matrix="1 0 0 1 256 64" stroke="black" pen="ultrafat">
274 -64 704 m
275 -320 704 l
276 -</path>
277 -<path matrix="1 0 0 1 256 64" stroke="black" pen="ultrafat">
278 -208 704 m
279 -25.2982 0 0 -25.2982 232 696 256 704 a
280 -</path>
281 -<path matrix="1 0 0 1 256 64" stroke="black" pen="ultrafat">
282 -128 704 m
283 -77.746 0 0 -77.746 200 674.667 272 704 a
284 -</path>
285 -<path matrix="1 0 0 1 256 -96" stroke="black" pen="ultrafat">
286 -64 704 m
287 -320 704 l
288 -</path>
289 -<path matrix="1 0 0 1 256 -96" stroke="black" pen="ultrafat">
290 -96 704 m
291 -32.249 0 0 -32.249 128 708 160 704 a
292 -</path>
293 -<text matrix="1 0 0 1 0 -16" transformations="translations" pos="64 688" stroke="black" type="label" width="202.242" height="17.213" depth="4.82" valign="baseline" size="Huge">structure $y$ with PK</text>
294 -<path stroke="black" pen="ultrafat" arrow="normal/normal">
295 -256 736 m
296 -304 752 l
297 -</path>
298 -<path stroke="black" pen="ultrafat" arrow="normal/normal">
299 -288 672 m
300 -320 640 l
301 -</path>
302 -<text matrix="1 0 0 1 32 -16" transformations="translations" pos="384 752" stroke="black" type="label" width="60.952" height="16.741" depth="4.02" valign="baseline" size="huge">level $y^1$</text>
303 -<text transformations="translations" pos="416 576" stroke="black" type="label" width="60.952" height="16.741" depth="4.02" valign="baseline" size="huge">level $y^2$</text>
304 -<text transformations="translations" pos="432 672" stroke="black" type="label" width="17.843" height="13.97" depth="1.57" valign="baseline" size="Huge">+</text>
305 -</page>
306 -</ipe>
1 +\documentclass{bioinfo}
2 +\copyrightyear{2015} \pubyear{2015}
3 +
4 +\access{Advance Access Publication Date: Day Month Year}
5 +\appnotes{Manuscript Category}
6 +
7 +\usepackage[ruled,vlined]{algorithm2e} % For pseudocode
8 +
9 +\begin{document}
10 +\firstpage{1}
11 +
12 +\subtitle{Subject Section}
13 +
14 +\title[long Title]{Biorseo: Benchmarking ways to use RNA modules leads to improved secondary structure prediction with pseudoknots}
15 +\author[Sample \textit{et~al}.]{Louis Becquey\,$^{\text{\sfb 1,}*}$, Eric Angel\,$^{\text{\sfb 1}}$ and Fariza Tahi\,$^{\text{\sfb 1}}$}
16 +\address{$^{\text{\sf 1}}$IBISC, Univ Evry, Universite Paris-Saclay, 91025, Evry, France}
17 +
18 +\corresp{$^\ast$To whom correspondence should be addressed.}
19 +
20 +\history{Received on XXXXX; revised on XXXXX; accepted on XXXXX}
21 +
22 +\editor{Associate Editor: XXXXXXX}
23 +
24 +\abstract{\textbf{Motivation:} RNA loops have now 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.\\
25 +\textbf{Results:} We propose a Pareto-based method for predicting RNA secondary structures by minimizing a bi-objective both energy-based and knowledge-based potential. The tool, called \textsc{Biorseo}, outputs the secondary structures from the Pareto set. We use it to compare several approaches to predict secondary structures using inserted RNA modules information: two different module data sources, Rna3Dmotifs and The RNA 3D Motif Atlas, and different ways to score the module insertions are compared: module size, module complexity, or module probability according to models like JAR3D and BayesPairing. We benchmark them against 344 known secondary structures. 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.\\
26 +\textbf{Availability:} The software is freely provided for Linux on \href{https://github.com/persalteas/biorseo/}{GitHub (https://github.com/persalteas/biorseo/)}, with the datasets. \\
27 +\textbf{Contact:} \href{louis.becquey@univ-evry.fr}{louis.becquey@univ-evry.fr}\\
28 +\textbf{Supplementary information:} Supplementary data are available at \textit{Bioinformatics}
29 +online.}
30 +
31 +\maketitle
32 +
33 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34 +\section{Introduction}
35 +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, \citealp{leontis2001geometric} proposed a classification of 12 non-canonical basepairs. 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.
36 +
37 +\paragraph{Modelling RNAs as graphs.} ~
38 +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.
39 +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.
40 +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 remain unpaired, forming so-called loops. 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 are based on the computation of 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.
41 +In 1990, McCaskill proposed a dynamic programming scheme to compute this partition function~(\citealp{mccaskill1990equilibrium}). The most used implementations are some lower complexity variants of it such as \texttt{RNAFold} in the ViennaRNA package~(\citealp{lorenz_viennarna_2011}), and \texttt{Fold}~(\citealp{mathews2004using}) in the RNAstructure package. An important limitation of this algorithm was its inability to model complex so-called \textit{pseudoknotted} structures, i.e. structures with basepairs $(i,j)$ and $(k,l)$ when $i<k<j<l$.
42 +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}).
43 +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. We can also cite Biokop (\citealp{legendre_bi-objective_2018}), a recent tool that uses both MFE and MEA criterions in a biobjective framework, and returns optimal and suboptimal structures (including pseudoknots).
44 +
45 +\paragraph{Secondary structure elements}~ 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 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.
46 +
47 +\paragraph{Modelling RNA loops with more detailed graphs.} ~ 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}). They model the loops with more detailed graphs describing non-canonical contacts on their edges. 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. 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. We can cite the work from (\citealp{djelloul_automated_2008}) with Rna3Dmotif, a pipeline that extracts terminal hairpin loops, internal loops, and multiple loops from structures annotated by FR3D, and can cluster them using a graph similarity metric. 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. A more recent one is CaRNAval (\citealp{reinharz2018mining}), an approach that enables to model a wide variety of structural features such as multipairs, multi-stranded loops, and pseudoknots. To be exhaustive, we also can cite RNA Bricks 2 (\citealp{chojnowski2014rna}), which has the particularity to also study contacts with protein chains.%, and RNA Motif Scan (\citealp{zhong_rnamotifscan:_2010}) that can search for certain modules in structures, but does not list modules on the form of a database. ==> Is it really relevant ?
48 +These works provide models combining different types of information about a module: (i) a particular base-pairing pattern of canonical and wobble pairing, which is 2D information (it often is only the canonical base-pairs that enclose a loop); (ii) a particular organisation of non-canonical contacts in space, which is 3D information; (iii) a sequence or consensus sequence that is known to adopt a particular base-pairing organisation, which could be nucleotide probabilities observed in the training dataset of RNA structures, or a more elaborated probabilistic model to predict if a given sequence will fold according to the module.
49 +For example, JAR3D (\citealp{zirbel_identifying_2015}) can score the modules from the RNA 3D Motif Atlas against a query sequence. The recent BayesPairing (\citealp{sarrazin2019automated}), expanding the method proposed by Cruz and Westhof with RMDetect (\citealp{cruz2011sequence}), can be used to do the same on modules from any database by building Bayesian networks from any graph of ordered non-canonical interactions.
50 +
51 +\paragraph{Our "backwards" approach} ~ From RNA modules, it is easy to imagine fragment assembly methods which would reconstitute 3D structures from the 2D loops. But this is not our scope here, instead we want to see if that information could be used to predict the position of loops in sequences, in other words, if this knowledge could help predicting the secondary structure graph. Here we finally ignore the 3D information the modules bring. We do not use the 3D data to help sampling conformations, but we use it to score conformations.
52 +
53 +A first attempt to tackle such task, called RNA-MoIP~(\citealp{reinharz_towards_2012}), improves an input secondary structure often given by a simple tool like RNAsubopt~(\citealp{lorenz_viennarna_2011}) to insert modules from Rna3Dmotif into it. The authors have shown that RNA-MoIP produces 2D structures with non-canonical base-pairs included, which are better inputs to give to MC-Sym~(\citealp{parisien2008mc}), resulting in better prediction of 3D structures. Unfortunately, we were not able to reproduce the published results about 2D structure accuracy, probably because the authors used a much older version of RNAsubopt than us. Our own tests over 344 structures with RNAsubopt v2.4.10 + RNA-MoIP showed a slightly inferior performance compared to RNAsubopt alone, as shown in Figure~1\vphantom{\ref{fig:comparison}}. It seems that RNA-MoIP damages the structures predicted by RNAsubopt most of the time, leading to a slightly weaker performance.
54 +\begin{figure}[!tpb]
55 +\centerline{\includegraphics[width=\linewidth]{fig/Figure_1.jpg}}
56 +\caption{Best Mattews Correlation Coefficient (see equation \ref{eq:MCC}) between the true structure and the structures predicted by RNAsubopt (blue) and RNA-MoIP (yellow) for 344 RNAs of length 10 to 100 from RNA-Strand~(\citealp{andronescu2008rna}). Selection details are provided in section \ref{sec:data}. RNAs are sorted by RNAsubopt performance.}\label{fig:comparison}
57 +\end{figure}
58 +One hypothesis about RNA-MoIP's lack of performance is that 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.
59 +
60 +To test this hypothesis, 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). This method leads to our new tool Biorseo (Bi-Objective RNA Structure Efficient Optimizer). Our approach avoids using a weighted linear combination of the objectives as done in RNA-MoIP (which can miss interesting solutions 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).
61 +
62 +In the next section, this article presents the module models sources, insertion models and 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 a reference dataset (verified structures from the RNA-Strand database). Three well-known reference RNAs are predicted and used to discuss the differences between the methods: \textit{E. coli}'s Gln tRNA, the Guanine riboswitch, and the human telomerase's pseudoknot. Finally, we recommend two prediction methods, and conclude.
63 +
64 +\begin{figure*}[t]
65 + \includegraphics[width=\textwidth]{fig/graph_abstract.jpg}
66 + \caption{The information flow in our benchmark 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 that sequence, by solving a bi-objective integer linear program (ILP).}
67 + \label{fig:pipeline}
68 +\end{figure*}
69 +
70 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71 +\begin{methods}
72 +\section{Methods}\label{sec:methods}
73 +We compared two databases of modules: (1) Modules extracted from solved 3D RNA structures, in the DESC file format of Rna3dDmotif~(\citealp{djelloul_automated_2008}). We used the data-set provided by RNA-MoIP ~(\citealp{djelloul_automated_2008,reinharz_towards_2012}). (2) Modules from the RNA 3D Motif Atlas v3.2, as provided on the BGSU website ~(\href{http://rna.bgsu.edu/rna3dhub/motifs/}{http://rna.bgsu.edu/rna3dhub/motifs/}), see~(\citealp{petrov_automated_2013}) for more information.
74 +
75 +Our main procedure is the following:
76 +\begin{itemize}
77 +\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).
78 +\item \textbf{Constraints definition step:} Define constraints on the secondary structure imposed by modules if they would be included (in this case, some of the canonical base-pairs are forbidden).
79 + \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 problem, using the previous constraints defined in the previous step.
80 +\end{itemize}
81 +
82 +The linear integer programming framework used to define the constraints and solve the resulting optimization problem is similar to previous works like IPknot, Biokop or RNA-MoIP~(\citealp{sato_ipknot:_2011,legendre_bi-objective_2018,reinharz_towards_2012}), but involves new constraints detailed in supplementary material.
83 +Figure \ref{fig:pipeline} summarizes the procedure on a graphical pipeline.
84 +
85 +\subsection{Pattern matching step}\label{sec:models}
86 +Several methods have been proposed to tackle the issue of finding if a sequence (or a part of it) is likely to fold following a given module. This section presents the ones we benchmarked.
87 +
88 +\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).
89 +
90 +\paragraph{The SCFG/MRF method, JAR3D} ~ For each motif group in each release of the RNA 3D Motif Atlas, the BGSU RNA research group proposed to construct a probabilistic model for sequence variability, based on a hybrid Stochastic Context-Free Grammar/Markov Random Field (SCFG/MRF) method. Their implementation, a software called JAR3D ~(\citealp{zirbel_identifying_2015}), 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.
91 +
92 +\paragraph{Sequence probability distribution and Bayesian Networks} ~ 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. The original article proposed four hand-made Bayesian networks for only four well-known RNA modules, but a recent tool called BayesPairing ~(\citealp{sarrazin2019automated}) automates the process for every module. A large number of sequences are sampled using the Bayesian network, and they are pattern-matched against the query to find occurrences. 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. This last step is embarrassing for us, first because it requires two computations of the partition function, and then because we would try to insert modules that were pre-selected to be appropriate. 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.
93 +
94 +
95 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
96 +\subsection{Constraints definition step and integer programming model} \label{sec:ip}
97 +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 material. Here we propose different objective functions to maximize, whose performances are compared in section \ref{sec:results}.
98 +
99 +\paragraph{Notations} ~ We call a \textit{component} a piece of strand which forms an unpaired portion of a module. 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\|$ bet 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 linear program outputs solutions by fixing definitive values for the different $y^u_v$ and $C^x_1$.
100 +
101 +\paragraph{Objective functions} ~ The more modules that are included, the more information about set and unset base-pairs, and the more information we have about the tertiary folds of these loops in space. So maximizing the number of modules could be a valid criteria. But, a disadvantage of such a criteria is that it penalizes multiple loops - sometimes referred as $k$-way junctions - with large $k$, because the insertion of a multiple loop forbids at the same time the insertion of several internal loops or bulges ($2$-way junctions) in place. 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}$, see equation \ref{eq:A}. Conversely, we could also try to maximize the number of components $\|x\|$ in the module. Then, we can suppose that secondary structure contacts are local (forget about kissing hairpins here), and want to avoid very-long-range base-pairs. This is equivalent to say that we want the minimal loop size (conversely to RNA-MoIP). Therefore, we can 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. We introduce such a penalty in criteria $f_{1B}$.\\ We also define two more criteria, $f_{1C}$ which use only the score returned by JAR3D or BayesPairing, and $f_{1D}$ which includes all the presented terms.\\
102 +Let $X$ be the set of all our decision variables, then the different objective functions to maximize are:
103 +\begin{equation} f_{1A}(X) = \sum_{x} \sum_{i=1}^{\|x\|} k_{x,i}^2 \times C^x_1\label{eq:A}\end{equation}
104 +\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}
105 +\begin{equation} f_{1C}(X) = \sum_{x} p(x) \times C^x_1 \label{eq:C}\end{equation}
106 +\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}
107 +
108 +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$ to ignore very unlikely base-pairs. This prevents the explosion of the number of variables and allows a fast resolution of the IP problem.
109 +
110 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
111 +
112 +\subsection{Optimization step}
113 +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, to search another one 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.
114 +
115 +The algorithm is implemented in C++ using the CPLEX solver concert technology~(\citealp{cplex}), resulting in the Biorseo tool, which is available online for Linux platforms.
116 +\begin{figure}[!tbp]
117 +\begin{algorithm}[H]
118 +F:= $\emptyset$\;
119 +\tcp{find the extrema of the Pareto front:}
120 +L1:= maximize($f_1$, $-\infty$, $+\infty$, F)\;
121 +L2:= maximize($f_2$, $-\infty$, $+\infty$, F)\;
122 +\tcp{Add L1 to the results:}
123 +R:= $\{$L1$\}$\;
124 +\tcp{search on top of L1:}
125 +search\_between($f_2(\text{L1}) + \epsilon$, $f_2(\text{L2})$)\;
126 +\tcp{search if solutions superposed to L1 exist:}
127 +search\_between($-\infty$, $f_2(\text{L1})$)\;
128 +\Return{R}\;
129 +\caption{FindParetoSet()}
130 +\end{algorithm}
131 +
132 +\begin{algorithm}[H]
133 +$s$:= maximize($f_1$, $\lambda_{min}$, $\lambda_{max}$, F)\;
134 +\If{$s \neq \emptyset$}{
135 + F:= F $\cup \{s\}$\;
136 + \If{$\nexists x \in \mathrm{R}$ such as $x>s$}{
137 + \tcp{solution is undominated, add it to R}
138 + R:= R $\cup \{s\}$\;
139 + \While{$\exists x \in \mathrm{R}$ such as $s>x$}{
140 + \tcp{remove dominated solutions}
141 + R:= R$\setminus \{x\}$\;
142 + }
143 + \tcp{search on top of $s$}
144 + search\_between($f_2(s) + \epsilon$, $\lambda_{max}$)\;
145 + \If{$\lambda_{max} - \lambda_{min} > \epsilon$}{
146 + \tcp{search if another solution superposed to $s$ exists}
147 + search\_between($\lambda_{min}$, $f_2(s)$)\;
148 + }
149 + }
150 +}
151 +\caption{search\_between($\lambda_{min}$, $\lambda_{max}$)}
152 +\end{algorithm}
153 +
154 +\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 minimizes 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}
155 +\end{figure}
156 +
157 +\end{methods}
158 +
159 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
160 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
161 +\section{Results}\label{sec:results}
162 +
163 +\begin{figure*}[!tbp]
164 + \includegraphics[width=\textwidth]{fig/Benchmark.jpg}
165 + \caption{Boxplots of the best MCC over the proposed solutions for each of the RNAs, for all method variants. Line (A) shows the methods that cannot find pseudoknots: RNAsubopt, RNA-MoIP, and the 14 variants of Biorseo's bi-objective methods with a constraint that explicitly forbids pseudoknots. Line (B) shows methods which allow their prediction: Biokop, and the 14 variants without the no-pseudoknot constraint. The left block gathers methods which use module data from Rna3Dmotifs (\citealp{djelloul_automated_2008}). The right one gathers those which use modules from the RNA 3D Motif Atlas (\citealp{petrov_automated_2013}). Boxplots surrounded by a dotted red frame use direct pattern matching to detect insertion sites, but do not score the sites. Those surrounded by a continuous blue frame score the sites with JAR3D (\citealp{zirbel_identifying_2015}) to score modules on loop sequences found by RNAsubopt. The remaining surrounded by a dashed green frame use the BayesPairing score~(\citealp{sarrazin2019automated}).}
166 + \label{fig:upgrades}
167 +\end{figure*}
168 +
169 +All the methods introduced return an ensemble of possible secondary structures for a given input sequence. We compare them in a benchmark over short RNA structures and a few well-known application cases.
170 +
171 +\subsection{Benchmark protocol} \label{sec:bench}
172 +We repeated the benchmark twice: first, by forbidding explicitly the formation of pseudoknots with additional constraints (for fair comparison with RNA-MoIP). Then, a second one without such limitation, to reach maximum performance.
173 +
174 +\paragraph{Materials}
175 +The tool has been conceived to be used by a regular scientist on a desktop computer. All computations were run on a workstation with AMD Ryzen 2700X (16 threads @4.3GHz) CPU, 16 GB of RAM. A prediction typically takes a few seconds, sometimes minutes. The time required grows with both the nucleotide count and the number of loops. The objective functions $f_{1A}$ and $f_{1B}$ were sometimes not discriminative enough and equally ranked a large number of module propositions, leading to combinatorial issues. For that reason, we arbitrarily stopped the jobs exceeding 500 structures in the Pareto set, because they would require over 2 hours of computation time to complete.
176 +
177 +\paragraph{Data sources} \label{sec:data}
178 +A set 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 consensus letters, for example R for a purine (A or G), or modified nucleotides (P, T, I in our case) were discarded. %In addition, we add a collection of 264 pseudoknotted RNAs taken from the Pseudobase database~(\citealp{van2000pseudobase}), covering all pseudoknot families, of length between 10 and 100 nucleotides.
179 +The final dataset contains 334 secondary structures of various RNA families, 74 of them containing pseudoknots. Due to the combinatorial issues described above, only 291 (resp. 294) of them have been predicted by all the proposed methods (the missing ones often being a combination of direct pattern-matching or JAR3D with $f_{1A}$ or $f_{1B}$) when forbidding (resp. allowing) pseudoknots. We will use these set of results for comparison.
180 +
181 +In addition to the large benchmark, we have a deeper look at very-well known structures to check if relevant combinations of models are still able to predict them correctly.
182 +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 contains a tiny, improbable pseudoknot. The G riboswitch is unpseudoknotted, and the telomerase pseudoknot is a simple H type pseudoknot.
183 +
184 +
185 +\paragraph{Reference comparison methods}
186 +To study the usefulness of the data sources, objective functions, and module placement methods, we added state-of-the art tools to the comparison. The same RNA sequences were submitted to RNA-MoIP for direct performance comparison. We used RNAsubopt as a reference method without pseudoknot support, because it is fast, widely used, easy to understand and returns several solutions. We used Biokop, the bi-objective integer programming framework, as a reference method for prediction of secondary structures with pseudoknots. Both tools over-perform other state-of-the-art tools in their respective categories, see the appropriate papers (\citealp{lorenz2011viennarna, legendre_bi-objective_2018}) for more benchmarks against other tools.
187 +
188 +\paragraph{Metrics} ~ We compute the Matthews correlation coefficient (MCC) between the real secondary structure and every proposition. The coefficient is defined as
189 +\begin{equation}
190 + MCC = \frac{TP. TN - FP. FN}{\sqrt{(TP+FP)(TP+FN)(TN+FP)(TN+FN)}}. \label{eq:MCC}
191 +\end{equation}
192 +Then, we keep the best MCC value found as a metric of the method's performance. This reflects if the true structure is included or not in the Pareto set. Averaging over the structures would be a nonsense, because some RNAs may exist in several meta-stable states which are very different in their list of base-pairs. Here, we measure if one of the states, which is reported in RNA-Strand as "true" structure, has been found. The choice of MCC over accuracy or F1 score is justified by the very large difference between the size of the classes: there exist much more negative base-pairs (pairs of nucleotides that do not interact) than positive ones in any secondary structure.
193 +
194 +\begin{table*}[!t]
195 +\processtable{MCC results for study cases. Pseudoknots are allowed. \label{Tab:01}} {
196 +\begin{tabular}{@{}rlllllll@{}}\toprule & RNAsubopt & RNA-MoIP & BiokoP & Rna3Dmotifs & Rna3Dmotifs & RNA 3D Motif Atlas & RNA 3D Motif Atlas\\
197 + & & & & + Direct P.M. & + BayesPairing & + JAR3D & + BayesPairing \\\midrule
198 +PDB\_00376 & 0.68 & 0.68 & 0.67 & 0.72 (A,B) & 0.74 (B,C,D), 0.71 (A) & 0.74 (A,C,D), 0.72 (B) & 0.76 (\textit{all})\\
199 +PDB\_01023 & 0.86 & 0.86 & 0.59 & 0.79 (A,B) & 0.29 (\textit{all}) & 0.82 (\textit{all}) & 0.82 (\textit{all})\\
200 +PDB\_00857 & 0.77 & 0.77 & 1.0 & 0.97 (B), 0.77 (A) & 0.97 (\textit{all}) & 0.97 (\textit{all}), & 0.97 (\textit{all})\\\botrule
201 +\end{tabular}}{The first line gives the results for E.\textit{coli} tRNA Gln (PDB\_00376), the second line for the glycine riboswitch (PDB\_01023), and the third for the human telomerase's pseudoknot (PDB\_00857). We observe that the best structure is often the same when we use the different objective functions $f_{1A}, f_{1B}, f_{1C}, f_{1D}$, but the rest of the set can be different.}
202 +\end{table*}
203 +
204 +
205 +\subsection{Benchmark results}
206 +Performance results under the form of best MCC are summarized in Figure \ref{fig:upgrades}.
207 +Majority of the RNAs were predicted with similar performance among the methods, including methods that do not use module information.
208 +
209 +No data source, nor objective function taken alone performs significantly better than the other ones. No one distinguishes itself alone to improve the performance.
210 +
211 +\paragraph{Methods without pseudoknots, comparison to RNAsubopt} ~ No method reaches RNAsubopt's scores. The most performing model is the use of The RNA 3D Motif Atlas modules, placed with JAR3D, and scored only with the JAR3D score ($f_{1C}$). We also notice that the 4 models (including this one) which use JAR3D return very small sets of results, most of them being one optimal solution, while RNAsubopt returns from one to ten solutions (with our dataset and default settings).
212 +
213 +\paragraph{With pseudoknots, comparison to Biokop} ~ The number of solutions returned doubles for every method compared to its no-pseudoknot version. Most of the RNAs are predicted with small knots when the method allows it. As the bottom line of Figure \ref{fig:upgrades} shows, the methods which use BayesPairing do not find as many right structures than Biokop, which performs better even without module information. On the other hand, the methods which use direct pattern-matching (like RNA-MoIP did) and the four ones which use RNAsubopt+JAR3D reach higher performance. The largest improvements concern Biorseo + Rna3Dmotifs + $f_{1B}$ and Biorseo + The RNA 3D Motif Atlas + JAR3D + $f_{1B}$. We apply Wilcoxon signed rank tests (non-parametric test for paired samples) to assert these methods distributions of results differ from Biokop (null hypothesis: "The position parameter of the distribution of the differences between the two paired samples is null"): p-values are $1.5\times 10^{-2}$ for the first method using Rna3Dmotifs, and $2.5\times 10^{-3}$ for the second with JAR3D. Other methods have more statistically significant differences with BiokoP, but smaller improvements in average, so we do not provide all the less interesting statistical tests results.
214 +
215 +\subsection{Results of the study cases}
216 +The results about very well described structures (Table~\ref{Tab:01}) are consistent with the general benchmark. Biorseo used with Rna3Dmotifs and direct pattern matching predicts 2D structures as well as RNAsubopt. So does it when used with the RNA 3D Motif Atlas and JAR3D.
217 +BayesPairing has a low performance when used with Rna3Dmotifs and a surprising good performance with the Motif Atlas, which cannot be generalized given the larger benchmark data.
218 +
219 +The tRNA is an example of structure which is approximately correctly predicted by Biorseo, as well as other tools.
220 +The G riboswitch allows to show that Biorseo is less likely to insert false positive pseudo-knots than Biokop (which inserted one, resulting in a low score, structures not shown).
221 +The telomerase pseudoknot is correctly predicted by all methods that support pseudoknots, including Biorseo.
222 +
223 +
224 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
225 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
226 +\section{Discussion}
227 +
228 +\paragraph{Without pseudoknots, comparison to RNA-MoIP} ~ An interesting point is the improvement between RNA-MoIP and the bi-objective method which uses direct-pattern matching to spot insertion sites and $f_{1A}$ to score the insertions. This method only differs from RNA-MoIP because it is bi-objective. The improvement is small, but statistically significant with a Wilcoxon's signed rank test p-value of 0.024. Then, we can conclude that the Pareto approach really improves the structure prediction by itself. This result supports our hypothesis about RNA-MoIP breaking important basepairs. Unfortunately, this improvement in average is counterbalanced by an increase in variance.
229 +
230 +\paragraph{Regarding pseudoknots} ~ The support of pseudoknots allows a small increase in performance, because we return more solutions, some with pseudoknots, and some without. As we are looking at the maximum MCC here, the appropriate solution has been selected for each RNA.
231 +Biorseo's reduced number of false positive pseudoknots compared to Biokop can be explained directly by the insertion of modules in loops: as we forbid explicitly any base-pair on nucleotides inside an inserted module's component, we prevent known loops to form pseudoknots. The drawback of this selectivity is the low ability to predict kissing hairpins (HHH type pseudoknots), precisely because they require loops to interact.
232 +However, pseudoknot prediction quality is difficult to assess with a metric like MCC, because a pseudoknot could be involved in only two or three 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 assertion method exist yet. A more accurate description of pseudoknot prediction performance would have required manual validation of every occurrence in every structure, which is too much work to achieve on such large datasets.
233 +
234 +\paragraph{On the objective functions} ~
235 +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 modules 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. As explained in section \ref{sec:bench}, some of the computations never ended because of combinatorial issues with those objectives. Such large Pareto sets are not informative for our application, because they consist in 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 length, a compromise must be found .
236 +
237 +\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 detected the loops in the RNA sequence with RNAsubopt. This use of JAR3D is biased, because we score modules on sequence portions that we already know unlikely to form stems and likely to form loops. Therefore, the information brought by the insertion of a module is low.
238 +Then, the enthusiasm about the bi-objective method with JAR3D and $f_{1C}$ (without pseudoknots) has to be moderate. It actually outputs almost the same secondary structures than RNAsubopt, discarding certain ones sometimes. As that method was the only interesting result without pseudoknots, we can argue that including known modules is not a general way to improve secondary structure prediction without pseudoknots. For every method, the average best MCC is below RNAsubopt, and the performance gain obtained on some structures is counterbalanced by the loss on approximately the same number of RNAs or more.
239 +
240 +We also observe that using The RNA 3D Motif Atlas with JAR3D has a significantly different behavior than the other methods: first, it returns a very small number of solutions (1 or 2 most of the time). Then, the best structure is almost every-time the one that has the higher number of modules, while it is not the case for the other methods. This is a good point for method JAR3D-$f_{1C}$ which performs almost as well as RNAsubopt by returning only one or two structures. An explanation is that JAR3D is selective of a few module insertion sites, sites that were first perfectly predicted to be loops by RNAsubopt (as discussed earlier). This confirms the use of module information is not always relevant and that the energy criteria brings almost all the information. The modules only sometimes allow to reduce the number of solutions.
241 +
242 +\paragraph{About BayesPairing} ~ We want to warn the reader about BayesPairing's low performance here in this benchmark. One should keep in mind that we skipped its 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 here is not an argument against the tool when used in its intended purpose.
243 +
244 +\paragraph{Final choice on which method to use}\label{sec:recommend} ~
245 +The results show that objective functions which use a score on the module insertion site (produced by BayesPairing or JAR3D) require much less computational resources to achieve the computation, as they avoid combinatorial explosion of the number of possible insertions of equally ranked modules onto the different loop sites of the RNA.
246 +On the other hand, they require time to score the modules against the insertion sites.
247 +For that reason, we recommend three models : if the user does not expect pseudoknots, using RNAsubopt is recommended. If the sequence may contain some, we recommend the simplest best-performing model : direct pattern matching and function $f_{1B}$. If the computation is too long because of combinatorial issues, one may use JAR3D to further rank the insertion sites (particularly relevant in longer RNA sequences). We then recommend the use of the RNA 3D Motif Atlas, JAR3D, and function $f_{1B}$. The user also should expect much less solutions when using JAR3D.
248 +
249 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
250 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
251 +
252 +\section{Conclusion}
253 +We developed a general bi-objective method to benchmark different sources of RNA module models (the RNA 3D Motif Atlas and Rna3Dmotifs), different methods to place them in sequences (direct pattern matching, BayesPairing, and JAR3D), and different scoring functions. The bi-objective method uses the expected accuracy of the structure, and the previous scoring functions to select relevant secondary structures.
254 +
255 +The results show that no data source prevails. They also show that the use of module information is irrelevant to predict structures without pseudoknots.
256 +The real interest would be when looking for potential pseudoknots, where several of our methods can improve the prediction performance (and computation times) compared to state-of-the-art tools.
257 +
258 +Some of our models over-perform RNA-MoIP, a previous attempt to predict better secondary structures using module information from Rna3Dmotifs and a linear combination of two objectives into a scoring function. Our simplest best-performing new method could be interpreted as an upgraded RNA-MoIP with updated data (there is a 10-fold increase in the number of solved RNA crystal structures between 2008 and 2018) and 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.
259 +
260 +Improvement perspectives now rely on the hope than newer databases like CaRNAval~(\citealp{reinharz2018mining}), containing more recent and more diverse module information, to really bring more information to assist the energy criteria.\\
261 +
262 +\bibliographystyle{natbib}
263 +%\bibliographystyle{achemnat}
264 +%\bibliographystyle{plainnat}
265 +%\bibliographystyle{abbrv}
266 +%\bibliographystyle{bioinformatics}
267 +%\bibliographystyle{plain}
268 +
269 +\bibliography{references}
270 +
271 +
272 +\end{document}
No preview for this file type
1 -\documentclass{article}
2 -\usepackage[utf8]{inputenc}
3 -\usepackage[T1]{fontenc}
4 -\usepackage{graphicx} % images PNG
5 -\usepackage{geometry} % margins
6 -\usepackage{url} % links
7 -\usepackage{charter} % betterfont
8 -\usepackage{stmaryrd} % math symbols ?
9 -\usepackage{eso-pic}
10 -\usepackage{siunitx} % SI units
11 -\usepackage{amsmath} % advanced math symbols
12 -\usepackage{rotating}
13 -\usepackage{multirow}
14 -\usepackage{color, colortbl} % color fonts and table backgrounds
15 -\usepackage{titlesec}
16 -\usepackage{enumitem}
17 -\usepackage{notoccite}
18 -\usepackage{fancyhdr} % page headers/footers
19 -\newcommand\BackgroundPic{\put(0,0){\parbox[b][\paperheight]{\paperwidth}{
20 -\vfill
21 -\centering
22 -\includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{background.png}
23 -\vfill
24 -}}}
25 -\geometry{top=1.5cm,bottom=1.5cm, left=2cm, right=2cm}
26 -\titlespacing*{\paragraph}{0pt}{0pt plus 0pt minus 0pt}{0pt plus 0pt minus 0pt}
27 -\titlespacing*{\subsection}{0pt}{0pt plus 0pt minus 0pt}{0pt plus 0pt minus 0pt}
28 -\titlespacing*{\itemize}{0pt}{0pt plus 0pt minus 0pt}{0pt plus 0pt minus 0pt}
29 -
30 -\title{Intermediate Work Report:}
31 -\author{Louis Becquey}
32 -\date{\today}
33 -
34 -\setlength\parskip{\baselineskip}
35 -
36 -\pagestyle{fancy}
37 -\setlength{\headheight}{14.7pt}
38 -\fancyhead[L]{\textsc{IP framework inserting RNA motives}}
39 -% \fancyhead[L]{\leftmark}
40 -\fancyhead[R]{Louis Becquey}
41 -\fancyfoot[L]{}
42 -\fancyfoot[C]{}
43 -\fancyfoot[R]{\thepage}
44 -\begin{document}
45 -
46 -\begin{titlepage}
47 - \AddToShipoutPicture*{\BackgroundPic}
48 - \begin{center}
49 - \vspace{3cm}
50 - \LARGE
51 - \textsc{Intermediate Work Report:}\\
52 - {\Large Louis Becquey, \today}\\
53 - \vspace{2cm}
54 - \textit{A biobjective IP framework that uses detected possible RNA modules\\ to predict RNA secondary structures}\\
55 - \end{center}
56 - \normalsize
57 - \vspace{5cm}
58 -
59 - \hrulefill
60 - \flushright{
61 - \textbf{under the supervision of:\\}
62 - Fariza Tahi, HDR \\
63 - Eric Angel, HDR \\
64 - \textit{AROBAS, IBISC, Paris-Saclay University}\\
65 - ~ \\
66 - \includegraphics[height=1cm]{logoIBISC.png} ~ ~
67 - \includegraphics[height=1cm]{minisaclay.png}
68 - }
69 - \flushleft
70 - \hrulefill
71 -\end{titlepage}
72 -
73 -\section*{Graphical Abstract}
74 -\begin{figure}[h]
75 - \hspace{-1.8cm}
76 - \includegraphics[width=1.2\linewidth]{graph_abstract.png}
77 -\end{figure}
78 -\tableofcontents
79 -
80 -\newpage
81 -
82 -\section{Motivation}
83 -We now have quite consistent RNA module databases (RNA3Dmodule \cite{djelloul_automated_2008}, the RNA Motif Atlas \cite{petrov_automated_2013}, or CaRNAval \cite{reinharz2018mining}).
84 -We call a RNA module the combined description of these points:
85 -\begin{itemize}
86 -\item A particular base-pairing pattern of canonical \& wobble pairing (bi-dimensional information),
87 - \item A particular organisation of non-canonical contacts in space (tri-dimensional information).
88 - \item A sequence or consensus sequence that we know to adopt that particular base-pairing organisation (sequence information), or at least a probabilistic model to predict if a given sequence will fold according to the module.
89 -\end{itemize}
90 -Then, a RNA module is direct data about how a sequence can fold in space. Here, we are interested in using them to predict the bi or tri dimensional structure of an RNA sequence from scratch.
91 -Then, the algorithm we plan to use is the following:
92 -
93 -\begin{itemize}
94 - \item Find all possible occurences of known RNA modules in the query sequence by using the sequence probabilistic models of the modules against the query bases,
95 - \item Define constraints on the secondary structure imposed by motives if they would be included
96 - \item Find a secondary structure that satisfies as much as possible both the expected accuracy of the structure and a criterion of module inclusion, by solving a bi-objective IP problem, using the previous constraints.
97 -\end{itemize}
98 -
99 -\section{Computation of basepair probabilities}
100 -To compute the probability of a structure to exist in the equilibrium thermodynamical ensemble, we need to estimate the basepair probabilities.
101 -This is usually done by a dynamic programming algorithm using an energy parameter model for base stackings in stems and energies of loops.
102 -As we are supposed to allow the existence of pseudoknots, we chose the Dirks \& Pierce algorithm \cite{dirksAlgorithmComputingNucleic2004} and its C++ implementation called Nupack.
103 -
104 -\paragraph{Discussion of that choice} ~ \\
105 -The Dirks and Pierce algorithm has a complexity of \(O(N^5)\) instead of the usual \(O(N^3)\) algorithm, and its implementation in libNupack is even not parallel.
106 -We may want to use a faster one (like ViennaRNA's one), even if it does not officialy supports pseudoknots.
107 -Actually, to form a simple class of pseudoknots, an RNA needs to have a high likelihood to form each of the two independant loops in a non-pseudoknotted form.
108 -Then, using a probability matrix computed with an algorithm that does not model pseudoknot may result in similar structures.
109 -Our biobjective program would etablish the pseudoknot after all as forming more stems stabilizes the structure and as we do not forbid the pseudoknot.
110 -
111 -\section{Detection of potential modules in the sequence input}
112 -\paragraph{\textbf{Choice of a module model, choice of a sequence probabilistic model}} ~ \\
113 -Depending on the authors and databases, different approaches have been published.
114 -A very complete model has been developped by the BGSU team \cite{zirbel_identifying_2015} : For each recurrent module of their "3D Motif Atlas", they build a probabilistic model for sequence variability based on a hybrid Stochastic Context-Free Grammar/Markov Random Field (SCFG/MRF) method.
115 -Concerning the other databases, a probabilistic model using a bayesian Network can be designed for an RNA module \cite{cruz2011sequence} to estimate the probability that the sequence would fold into the module.
116 -
117 -As BGSU's model is already implemented in a software called JAR3D that perfectly suits our need, we decided to use BGSU's model of modules and their database.
118 -JAR3D finds, given the sequence of an RNA loop with no additional information, the likelihood that it folds in every known 3D module of the RNA Motif Atlas \cite{petrov_automated_2013}.
119 -
120 -For each module group of the database, JAR3D estimates the probability that a sequence folds into the 3D pattern, given instances of the module in real RNA 3D structures.
121 -The instances might differ in sequence, length of bulged insertions, and other details, but share a common graph of 3D non-canonical interactions.
122 -It takes into account crossed contacts, base-ribose and base-phosphate interactions, and triple base-pairs.
123 -This is the most complete approach to use to my knowledge.
124 -
125 -\paragraph{\textbf{Detection of the loops in an RNA sequence}} ~ \\
126 -As JAR3D scores the sequence of RNA loops, we first need to predict the 2D loops positions in the RNA sequence.
127 -
128 -For now, we have been using RNAsubopt from the ViennaRNA package \cite{lorenz_viennarna_2011} to compute the 10 most probable 2D structures of the RNA and extract the loops that occur in those structures.
129 -This computation should be avoided in the future : It requires the computation of the RNA's partition function and basepair probabilities again, which is something we already computed with Nupack.
130 -Unfortunately, to avoid computing it twice, we should reimplement ourselves the algorithms instead of using the actual implementations. We have programs that output the basepair matrix but no structures, and programs that output structures but not the basepair matrix, and we don't have a program that can do both.
131 -
132 -\section{Formulation of the IP problem}
133 -
134 -This formulation is an improved merge between the IPknot \cite{sato_ipknot:_2011} formulation to fold RNAs with pseudoknots (but without "levels") and RNAMoIP's one \cite{reinharz_towards_2012} to include modules.
135 -The bi-objective algorithm is inspired from BiokoP \cite{legendre_bi-objective_2018} and detailed later in section \ref{methods}.
136 -% This problem has been inspired by IPknot's model \cite{sato_ipknot:_2011}, but without the use of what they call \textit{levels}, which are pseudoknot-free
137 -% structures that should be superposed to give the true pseudoknotted secondary structure graph.\\
138 -% Levels are mutually exclusive (a base cannot be paired in two different levels). The more levels you use, the more decision variables you have,
139 -% but the more complex pseudoknots you are able to predict. IPknot and BiokoP use 2 levels, to predict simple knots.\\
140 -% \begin{figure}[h]\centering \includegraphics[height=5cm]{levels.png}\end{figure}
141 -
142 -
143 -\subsection{Variables}
144 -
145 -% Let $m$ be the number of levels that our program uses.\\
146 -Let $n$ be the number of nucleotides in the query RNA sequence $s$.\\
147 -Let $M$ be the set of modules that could be inserted in $s$ (a loop from $s$ has a good JAR3D score against one of the modules).\\
148 -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 for that motif inserted at a particular position.\\
149 -Let $P_{x,i}$ be the position in $s$ where we can insert the $i$th component of module $x$.\\
150 -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.\\
151 -Let $k_{x,i}$ be the size in nucleotides of that $i$th component of $x$.\\
152 -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$.\\
153 -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}$.
154 -
155 -
156 -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_{vu}$ for the same pair.
157 -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$.
158 -Regarding the $C^x_i$, if we have an average insertion of $\nu$ motives by RNA sequence, the motives having in average $\mu$ components, components that can be inserted in average at $\pi$ different positions in $s$,
159 -then we need to add, in average, $\nu \times \mu \times \pi$ decision variables $C^x_i$.
160 -
161 -Then, we expect having around $\frac{1}{2}n^2+\nu \mu \pi$ decision variables.
162 -
163 -\newpage
164 -\subsection{Objectives \label{objectives}}
165 -We have two objectives : Find a structure with correct expected accuracy, and find a structure which includes (large) known modules.
166 -Let $X$ be the vector of all our decision variables, we define the following objective functions to maximize:
167 -\[ f_{1A}(X) = \sum_{x \in M} (\|x\|)^2 \times C^x_1 \]
168 -\[ f_{1B}(X) = \sum_{x \in M} p(x) \times C^x_1 \]
169 -\[ f_{1C}(X) = \sum_{x \in M} \left[ \frac{\|x\|}{\log_2(\sum_{i=1}^{\|x\|}k_{x,i})} \times p(x) \times C^x_1 \right]\]
170 -$$ f_2(X) = \sum_{u<v} p_{uv}\times y^u_v \times I[p_{uv}>\theta], \qquad \qquad
171 - p_{uv} = \sum_{\sigma \in S(s)} y^u_v.p(\sigma | s)$$
172 -The different $f_1$ objectives are supposed to maximize the number of inserted motives in $s$,
173 -weighted by their number of components (squared for 1A), or the JAR3D score (B and C).
174 -In $1C$, a penalty is added on the number of nucleotides involved in the looped zone (sum of $k_{x,i}$) to avoid long unpaired zones.
175 -We don't know yet which one will give the better results.
176 -$f_2$ is supposed to maximise the expected accuracy of the secondary structure.
177 -$p_{uv}$ are the base pairing probabilities.
178 -
179 -Note that \(f_{1A}\) is taken from RNA MoIP \cite{reinharz_towards_2012}, to compare performance.
180 -
181 -\subsection{9 Constraints to bind them all}
182 -\paragraph{Constraint to ensure there only is 0 or 1 canonical pairing by nucleotide} ~
183 -\begin{equation} \label{constraint:1}
184 - \sum_{v<u} y^v_u + \sum_{v>u} y^u_v \leq 1 \qquad\qquad \forall u \in \llbracket 1,n \rrbracket
185 -\end{equation}
186 -
187 -\paragraph{Constraints to forbid lonely base pairs} ~
188 -% \begin{equation} \label{constraint:2}
189 -% \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
190 -% \end{equation}
191 -% \begin{equation} \label{constraint:3}
192 -% \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
193 -% \end{equation}
194 -% These conditions ensure that if a base pair exists with $s[i]$,
195 -% one of the adjacent bases is paired too.
196 -% Equation \ref{constraint:2} is useful if $s[u]$ is paired with $s[v>u]$ (a nucleotide later in the sequence),
197 -% and equation \ref{constraint:3} if $s[v]$ is paired with $s[u<v]$ (a nucleotide earlier in the sequence).
198 -\begin{equation} \label{constraint:2}
199 - 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 \}
200 -\end{equation}
201 -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
202 -the only decision variables kept are those with probability above a $\theta$ threshold.
203 -Then, this condition sets to zero "lonely decision variables" who have no neighbour basepair variable allowed.
204 -
205 -
206 -\paragraph{Constraint to forbid pairings inside a module component} ~
207 -\begin{equation} \label{constraint:4}
208 - (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)
209 - \qquad \qquad \forall x \in M, i \in \llbracket 1,\|x\| \rrbracket
210 -\end{equation}
211 -
212 -\paragraph{Constraint to forbid component to overlap} ~
213 -\begin{equation} \label{constraint:5}
214 - \sum_{x \in M} \sum_{i=1}^{\|x\|} C^x_i \times I( u \in [ P_{x,i} ; P_{x,i}+k_{x,i}-1]) \leq 1 \qquad \qquad \forall u \in \llbracket 1,n \rrbracket
215 -\end{equation}
216 -$I( u \in [ P_{x,i} ; P_{x,i}+k_{x,i}-1])$ is a booleean value depending on the condition's truth. Then, whatever the nucleotide $u$, it can be part of a module component only once.
217 -% \begin{center}\includegraphics[height=3cm]{component.png}\end{center}
218 -
219 -\paragraph{Constraints to respect the structure of large motives ($\{ x\in M \; | \; \|x\| \geq 2\}$)} ~
220 -
221 -This constraint ensures that none or all the components of a motif are inserted.
222 -\begin{equation}\label{constraint:6}
223 - \sum_{i=2}^{\|x\|} C^x_i = (\|x\| - 1) \times C^{x}_{1} \qquad \qquad \forall x \in \{ x\in M \; | \; \|x\| \geq 2\}
224 -\end{equation}
225 -
226 -And then, we force base pairs between the end of a component and the beginning of the next one:
227 -\begin{equation}\label{constraint:7}
228 - 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\}
229 -\end{equation}
230 -\begin{equation}\label{constraint:8}
231 - 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
232 -\end{equation}
233 -
234 -Constraint \ref{constraint:7} binds the first nucleotide of first component to the last one of the last component.
235 -Constraint \ref{constraint:8} binds the last nucleotide of component $j$ to the first of component $j+1$.
236 -
237 -\paragraph{Constraint to forbid a previously found solution} ~
238 -
239 -As several solutions may result in the same values of the two objectives, we can't forbid the algorithm to search twice the same region of the objective landscape.
240 -We have to explicitly forbid to find again every found solution.\\
241 -We do it by adding iteratively, for every structure $s^*$ found, the following condition :
242 -\begin{equation}\label{constraint:9}
243 - \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 +
244 - \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
245 -\end{equation}
246 -
247 -It ensures that at least one of the decision variables differs from $s^*$.
248 -
249 -\section{Methods \label{methods}}
250 -\subsection{Bi-objective algorithm}
251 -This is an adaptation of BiokoP's algorithm \cite{legendre_bi-objective_2018} to gather all the points of the pareto set, removing the $k$-pareto set part.
252 -
253 -We start by solving each objective independantly to have a lower and higher bound on each objective.
254 -The two solutions found are considered optimal (higher bound) on one objective, and the worse point of the Pareto set concerning the other objective.
255 -
256 -Then, we will iteratively solve the mono-objective problem, but adding as a constraint that the second one has to be included between the bounds.
257 -Suppose we decide to iteratively solve objective 1.
258 -The found solutions are getting worse and worse concerning objective 1, but better and better concerning objective 2.
259 -Every time a solution is found with a better objective 2 value, we update our lower bound to search for solutions with objective 2 above this new value.
260 -Note that we use weak inequality constraints, as several solutions may have the same values concerning the two objectives and that we want to include them in the Pareto set.
261 -
262 -When no more solutions are discovered, the Pareto has been entirely found.
263 -
264 -\subsection{Solving the IP problem}
265 -We use ILOG CPLEX's \cite{cplex} concert technology to solve the integer linear programming problem. All our decision variables are booleans, and all our constraints are linear.
266 -
267 -\subsection{Benchmarking of the module inclusion objective functions}
268 -To assess the performance of the objective functions proposed in section \ref{objectives}, we need to chose some performance metrics.
269 -We will focus on:
270 -\begin{itemize}
271 - \item wether the native secondary structure of the proposed RNA sequence exists in the returned solutions (the pareto set),
272 - \item the number of solutions returned (size of the Pareto set).
273 -\end{itemize}
274 -
275 -The performance is assessed on the structures taken from the RNA STRAND database \cite{andronescu2008rna}, after a simple preprocessing to remove pseudobases.
276 -
277 -\section{Results \label{results}}
278 -\subsection{Comparison of the 3 objective functions for motif insertion}
279 -It appears that function $f_{1A}$ introduced in section \ref{objectives} is not usable in practice.
280 -Actually, on a short RNA sequence (67 nucleotides) but with 4 loop sites that may fold into $~30$ different known loops,
281 -we obtain a combinatorial superposition of near $30^4 = 810 000$ structures which have the same $f_{1A}$ and $f_2$ objectives values, and
282 -all belong to the Pareto front. This results is not desired, as the size of the Pareto set is wanted to be small, and as the program fills the machine's memory very quick in practice.
283 -
284 -\section{Discussion \label{discussion}}
285 -
286 -
287 -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
288 -% \newpage
289 -\bibliographystyle{unsrt}
290 -\bibliography{RNA}
291 -\end{document}
...\ No newline at end of file ...\ No newline at end of file
1 +%%
2 +%% This is file `natbib.bst', generated
3 +%% on <1994/9/16> with the docstrip utility (2.2h).
4 +%%
5 +%% The original source files were:
6 +%%
7 +%% genbst.mbs (with options: `ay,nat,seq-lab,nm-rev,dt-beg,yr-par,vol-bf,
8 +%% volp-com,etal-it')
9 +%% ----------------------------------------
10 +%% *** Personal bib style, PWD ***
11 +%%
12 +%% (Here are the specifications of the source file)
13 +%% \ProvidesFile{genbst.mbs}[1994/09/16 1.5 (PWD)]
14 +%% For use with BibTeX version 0.99a or later
15 +%% and with LaTeX 2.09 or 2e
16 +%%-------------------------------------------------------------------
17 +%% NOTICE:
18 +%% This file may be used for non-profit purposes.
19 +%% It may not be distributed in exchange for money,
20 +%% other than distribution costs.
21 +%%
22 +%% The author provides it `as is' and does not guarantee it in any way.
23 +%%
24 +%% Copyright (C) 1994 Patrick W. Daly
25 +%% Max-Planck-Institut f\"ur Aeronomie
26 +%% Postfach 20
27 +%% D-37189 Katlenburg-Lindau
28 +%% Germany
29 +%%
30 +%% E-mail:
31 +%% SPAN-- nsp::linmpi::daly (note nsp also known as ecd1)
32 +%% Internet-- daly@linmpi.dnet.gwdg.de
33 +%%-----------------------------------------------------------
34 +%% \CharacterTable
35 +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
36 +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
37 +%% Digits \0\1\2\3\4\5\6\7\8\9
38 +%% Exclamation \! Double quote \" Hash (number) \#
39 +%% Dollar \$ Percent \% Ampersand \&
40 +%% Acute accent \' Left paren \( Right paren \)
41 +%% Asterisk \* Plus \+ Comma \,
42 +%% Minus \- Point \. Solidus \/
43 +%% Colon \: Semicolon \; Less than \<
44 +%% Equals \= Greater than \> Question mark \?
45 +%% Commercial at \@ Left bracket \[ Backslash \\
46 +%% Right bracket \] Circumflex \^ Underscore \_
47 +%% Grave accent \` Left brace \{ Vertical bar \|
48 +%% Right brace \} Tilde \~}
49 +%%---------------------------------------------------------------------
50 + % This is an author-year citation style bibliography. As such, it is
51 + % non-standard LaTeX, and requires a special package file to function properly.
52 + % Such a package is natbib.sty by Patrick W. Daly
53 + % The form of the \bibitem entries is
54 + % \bibitem[Jones et al.(1990)]{key}...
55 + % \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}...
56 + % The essential feature is that the label (the part in brackets) consists
57 + % of the author names, as they should appear in the citation, with the year
58 + % in parentheses following. There must be no space before the opening
59 + % parenthesis!
60 + % With natbib v5.3, a full list of authors may also follow the year.
61 + % In natbib.sty, it is possible to define the type of enclosures that is
62 + % really wanted (brackets or parentheses), but in either case, there must
63 + % be parentheses in the label.
64 + % The \cite command functions as follows:
65 + % \cite{key} ==>> Jones et al. (1990)
66 + % \cite[]{key} ==>> (Jones et al., 1990)
67 + % \cite[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2)
68 + % \cite[e.g.][]{key} ==>> (e.g. Jones et al., 1990)
69 + % \cite[e.g.][p. 32]{key} ==>> (e.g. Jones et al., p. 32)
70 + % \citeauthor{key} Jones et al.
71 + % \citefullauthor{key} Jones, Baker, and Smith
72 + % \citeyear{key} 1990
73 +%%---------------------------------------------------------------------
74 +
75 +ENTRY
76 + { address
77 + author
78 + booktitle
79 + chapter
80 + edition
81 + editor
82 + howpublished
83 + institution
84 + journal
85 + key
86 + month
87 + note
88 + number
89 + organization
90 + pages
91 + publisher
92 + school
93 + series
94 + title
95 + type
96 + volume
97 + year
98 + }
99 + {}
100 + { label extra.label sort.label }
101 +
102 +INTEGERS { output.state before.all mid.sentence after.sentence after.block }
103 +
104 +FUNCTION {init.state.consts}
105 +{ #0 'before.all :=
106 + #1 'mid.sentence :=
107 + #2 'after.sentence :=
108 + #3 'after.block :=
109 +}
110 +
111 +STRINGS { s t }
112 +
113 +FUNCTION {output.nonnull}
114 +{ 's :=
115 + output.state mid.sentence =
116 + { ", " * write$ }
117 + { output.state after.block =
118 + { add.period$ write$
119 + newline$
120 + "\newblock " write$
121 + }
122 + { output.state before.all =
123 + 'write$
124 + { add.period$ " " * write$ }
125 + if$
126 + }
127 + if$
128 + mid.sentence 'output.state :=
129 + }
130 + if$
131 + s
132 +}
133 +
134 +FUNCTION {output}
135 +{ duplicate$ empty$
136 + 'pop$
137 + 'output.nonnull
138 + if$
139 +}
140 +
141 +FUNCTION {output.check}
142 +{ 't :=
143 + duplicate$ empty$
144 + { pop$ "empty " t * " in " * cite$ * warning$ }
145 + 'output.nonnull
146 + if$
147 +}
148 +
149 +FUNCTION {fin.entry}
150 +{ add.period$
151 + write$
152 + newline$
153 +}
154 +
155 +FUNCTION {new.block}
156 +{ output.state before.all =
157 + 'skip$
158 + { after.block 'output.state := }
159 + if$
160 +}
161 +
162 +FUNCTION {new.sentence}
163 +{ output.state after.block =
164 + 'skip$
165 + { output.state before.all =
166 + 'skip$
167 + { after.sentence 'output.state := }
168 + if$
169 + }
170 + if$
171 +}
172 +
173 +FUNCTION {not}
174 +{ { #0 }
175 + { #1 }
176 + if$
177 +}
178 +
179 +FUNCTION {and}
180 +{ 'skip$
181 + { pop$ #0 }
182 + if$
183 +}
184 +
185 +FUNCTION {or}
186 +{ { pop$ #1 }
187 + 'skip$
188 + if$
189 +}
190 +
191 +FUNCTION {non.stop}
192 +{ duplicate$
193 + "}" * add.period$
194 + #-1 #1 substring$ "." =
195 +}
196 +
197 +FUNCTION {new.block.checkb}
198 +{ empty$
199 + swap$ empty$
200 + and
201 + 'skip$
202 + 'new.block
203 + if$
204 +}
205 +
206 +FUNCTION {field.or.null}
207 +{ duplicate$ empty$
208 + { pop$ "" }
209 + 'skip$
210 + if$
211 +}
212 +
213 +FUNCTION {emphasize}
214 +{ duplicate$ empty$
215 + { pop$ "" }
216 + { "{\em " swap$ * non.stop
217 + { "\/}" * }
218 + { "}" * }
219 + if$
220 + }
221 + if$
222 +}
223 +
224 +FUNCTION {bolden}
225 +{ duplicate$ empty$
226 + { pop$ "" }
227 + { "{\bf " swap$ * "}" * }
228 + if$
229 +}
230 +
231 +INTEGERS { nameptr namesleft numnames }
232 +
233 +FUNCTION {format.names}
234 +{ 's :=
235 + #1 'nameptr :=
236 + s num.names$ 'numnames :=
237 + numnames 'namesleft :=
238 + { namesleft #0 > }
239 + { s nameptr
240 + "{vv~}{ll}{, jj}{, f.}" format.name$ 't :=
241 + nameptr #1 >
242 + {
243 + namesleft #1 >
244 + { ", " * t * }
245 + {
246 + numnames #2 >
247 + { "," * }
248 + 'skip$
249 + if$
250 + t "others" =
251 + { " " * "et~al." emphasize * }
252 + { " and " * t * }
253 + if$
254 + }
255 + if$
256 + }
257 + 't
258 + if$
259 + nameptr #1 + 'nameptr :=
260 + namesleft #1 - 'namesleft :=
261 + }
262 + while$
263 +}
264 +
265 +FUNCTION {format.names.ed}
266 +{ 's :=
267 + #1 'nameptr :=
268 + s num.names$ 'numnames :=
269 + numnames 'namesleft :=
270 + { namesleft #0 > }
271 + { s nameptr
272 + "{f.~}{vv~}{ll}{, jj}"
273 + format.name$ 't :=
274 + nameptr #1 >
275 + {
276 + namesleft #1 >
277 + { ", " * t * }
278 + {
279 + numnames #2 >
280 + { "," * }
281 + 'skip$
282 + if$
283 + t "others" =
284 + { " " * "et~al." emphasize * }
285 + { " and " * t * }
286 + if$
287 + }
288 + if$
289 + }
290 + 't
291 + if$
292 + nameptr #1 + 'nameptr :=
293 + namesleft #1 - 'namesleft :=
294 + }
295 + while$
296 +}
297 +
298 +FUNCTION {format.key}
299 +{ empty$
300 + { key field.or.null }
301 + { "" }
302 + if$
303 +}
304 +
305 +FUNCTION {format.authors}
306 +{ author empty$
307 + { "" }
308 + { author format.names }
309 + if$
310 +}
311 +
312 +FUNCTION {format.editors}
313 +{ editor empty$
314 + { "" }
315 + { editor format.names
316 + editor num.names$ #1 >
317 + { ", editors" * }
318 + { ", editor" * }
319 + if$
320 + }
321 + if$
322 +}
323 +
324 +FUNCTION {format.in.editors}
325 +{ editor empty$
326 + { "" }
327 + { editor format.names.ed
328 + editor num.names$ #1 >
329 + { ", editors" * }
330 + { ", editor" * }
331 + if$
332 + }
333 + if$
334 +}
335 +
336 +FUNCTION {format.title}
337 +{ title empty$
338 + { "" }
339 + { title "t" change.case$
340 + }
341 + if$
342 +}
343 +
344 +FUNCTION {format.full.names}
345 +{'s :=
346 + #1 'nameptr :=
347 + s num.names$ 'numnames :=
348 + numnames 'namesleft :=
349 + { namesleft #0 > }
350 + { s nameptr
351 + "{vv~}{ll}" format.name$ 't :=
352 + nameptr #1 >
353 + {
354 + namesleft #1 >
355 + { ", " * t * }
356 + {
357 + numnames #2 >
358 + { "," * }
359 + 'skip$
360 + if$
361 + t "others" =
362 + { " " * "et~al." emphasize * }
363 + { " and " * t * }
364 + if$
365 + }
366 + if$
367 + }
368 + 't
369 + if$
370 + nameptr #1 + 'nameptr :=
371 + namesleft #1 - 'namesleft :=
372 + }
373 + while$
374 +}
375 +
376 +FUNCTION {author.editor.key.full}
377 +{ author empty$
378 + { editor empty$
379 + { key empty$
380 + { cite$ #1 #3 substring$ }
381 + 'key
382 + if$
383 + }
384 + { editor format.full.names }
385 + if$
386 + }
387 + { author format.full.names }
388 + if$
389 +}
390 +
391 +FUNCTION {author.key.full}
392 +{ author empty$
393 + { key empty$
394 + { cite$ #1 #3 substring$ }
395 + 'key
396 + if$
397 + }
398 + { author format.full.names }
399 + if$
400 +}
401 +
402 +FUNCTION {editor.key.full}
403 +{ editor empty$
404 + { key empty$
405 + { cite$ #1 #3 substring$ }
406 + 'key
407 + if$
408 + }
409 + { editor format.full.names }
410 + if$
411 +}
412 +
413 +FUNCTION {make.full.names}
414 +{ type$ "book" =
415 + type$ "inbook" =
416 + or
417 + 'author.editor.key.full
418 + { type$ "proceedings" =
419 + 'editor.key.full
420 + 'author.key.full
421 + if$
422 + }
423 + if$
424 +}
425 +
426 +FUNCTION {output.bibitem}
427 +{ newline$
428 + "\bibitem[" write$
429 + label write$
430 + ")" make.full.names * "]{" * write$
431 + cite$ write$
432 + "}" write$
433 + newline$
434 + ""
435 + before.all 'output.state :=
436 +}
437 +
438 +FUNCTION {n.dashify}
439 +{ 't :=
440 + ""
441 + { t empty$ not }
442 + { t #1 #1 substring$ "-" =
443 + { t #1 #2 substring$ "--" = not
444 + { "--" *
445 + t #2 global.max$ substring$ 't :=
446 + }
447 + { { t #1 #1 substring$ "-" = }
448 + { "-" *
449 + t #2 global.max$ substring$ 't :=
450 + }
451 + while$
452 + }
453 + if$
454 + }
455 + { t #1 #1 substring$ *
456 + t #2 global.max$ substring$ 't :=
457 + }
458 + if$
459 + }
460 + while$
461 +}
462 +
463 +FUNCTION {word.in}
464 +{ "In " }
465 +
466 +FUNCTION {format.date}
467 +{ year duplicate$ empty$
468 + { "empty year in " cite$ * "; set to ????" * warning$
469 + pop$ "????" }
470 + 'skip$
471 + if$
472 + before.all 'output.state :=
473 + " (" swap$ * extra.label * ")" *
474 +}
475 +
476 +FUNCTION {format.btitle}
477 +{ title emphasize
478 +}
479 +
480 +FUNCTION {tie.or.space.connect}
481 +{ duplicate$ text.length$ #3 <
482 + { "~" }
483 + { " " }
484 + if$
485 + swap$ * *
486 +}
487 +
488 +FUNCTION {either.or.check}
489 +{ empty$
490 + 'pop$
491 + { "can't use both " swap$ * " fields in " * cite$ * warning$ }
492 + if$
493 +}
494 +
495 +FUNCTION {format.bvolume}
496 +{ volume empty$
497 + { "" }
498 + { "volume" volume tie.or.space.connect
499 + series empty$
500 + 'skip$
501 + { " of " * series emphasize * }
502 + if$
503 + "volume and number" number either.or.check
504 + }
505 + if$
506 +}
507 +
508 +FUNCTION {format.number.series}
509 +{ volume empty$
510 + { number empty$
511 + { series field.or.null }
512 + { output.state mid.sentence =
513 + { "number" }
514 + { "Number" }
515 + if$
516 + number tie.or.space.connect
517 + series empty$
518 + { "there's a number but no series in " cite$ * warning$ }
519 + { " in " * series * }
520 + if$
521 + }
522 + if$
523 + }
524 + { "" }
525 + if$
526 +}
527 +
528 +FUNCTION {format.edition}
529 +{ edition empty$
530 + { "" }
531 + { output.state mid.sentence =
532 + { edition "l" change.case$ " edition" * }
533 + { edition "t" change.case$ " edition" * }
534 + if$
535 + }
536 + if$
537 +}
538 +
539 +INTEGERS { multiresult }
540 +
541 +FUNCTION {multi.page.check}
542 +{ 't :=
543 + #0 'multiresult :=
544 + { multiresult not
545 + t empty$ not
546 + and
547 + }
548 + { t #1 #1 substring$
549 + duplicate$ "-" =
550 + swap$ duplicate$ "," =
551 + swap$ "+" =
552 + or or
553 + { #1 'multiresult := }
554 + { t #2 global.max$ substring$ 't := }
555 + if$
556 + }
557 + while$
558 + multiresult
559 +}
560 +
561 +FUNCTION {format.pages}
562 +{ pages empty$
563 + { "" }
564 + { pages multi.page.check
565 + { "pages" pages n.dashify tie.or.space.connect }
566 + { "page" pages tie.or.space.connect }
567 + if$
568 + }
569 + if$
570 +}
571 +
572 +FUNCTION {format.vol.num.pages}
573 +{ volume field.or.null
574 + bolden
575 + number empty$
576 + 'skip$
577 + { "(" number * ")" * *
578 + volume empty$
579 + { "there's a number but no volume in " cite$ * warning$ }
580 + 'skip$
581 + if$
582 + }
583 + if$
584 + pages empty$
585 + 'skip$
586 + { duplicate$ empty$
587 + { pop$ format.pages }
588 + { ", " * pages n.dashify * }
589 + if$
590 + }
591 + if$
592 +}
593 +
594 +FUNCTION {format.chapter.pages}
595 +{ chapter empty$
596 + 'format.pages
597 + { type empty$
598 + { "chapter" }
599 + { type "l" change.case$ }
600 + if$
601 + chapter tie.or.space.connect
602 + pages empty$
603 + 'skip$
604 + { ", " * format.pages * }
605 + if$
606 + }
607 + if$
608 +}
609 +
610 +FUNCTION {format.in.ed.booktitle}
611 +{ booktitle empty$
612 + { "" }
613 + { editor empty$
614 + { word.in booktitle emphasize * }
615 + { word.in format.in.editors * ", " * booktitle emphasize * }
616 + if$
617 + }
618 + if$
619 +}
620 +
621 +FUNCTION {format.thesis.type}
622 +{ type empty$
623 + 'skip$
624 + { pop$
625 + type "t" change.case$
626 + }
627 + if$
628 +}
629 +
630 +FUNCTION {format.tr.number}
631 +{ type empty$
632 + { "Technical Report" }
633 + 'type
634 + if$
635 + number empty$
636 + { "t" change.case$ }
637 + { number tie.or.space.connect }
638 + if$
639 +}
640 +
641 +FUNCTION {format.article.crossref}
642 +{
643 + word.in
644 + "\cite{" * crossref * "}" *
645 +}
646 +
647 +FUNCTION {format.book.crossref}
648 +{ volume empty$
649 + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
650 + word.in
651 + }
652 + { "Volume" volume tie.or.space.connect
653 + " of " *
654 + }
655 + if$
656 + "\cite{" * crossref * "}" *
657 +}
658 +
659 +FUNCTION {format.incoll.inproc.crossref}
660 +{
661 + word.in
662 + "\cite{" * crossref * "}" *
663 +}
664 +
665 +FUNCTION {article}
666 +{ output.bibitem
667 + format.authors "author" output.check
668 + author format.key output
669 + format.date "year" output.check
670 + new.block
671 + format.title "title" output.check
672 + new.block
673 + crossref missing$
674 + { journal emphasize "journal" output.check
675 + format.vol.num.pages output
676 + }
677 + { format.article.crossref output.nonnull
678 + format.pages output
679 + }
680 + if$
681 + new.block
682 + note output
683 + fin.entry
684 +}
685 +
686 +FUNCTION {book}
687 +{ output.bibitem
688 + author empty$
689 + { format.editors "author and editor" output.check
690 + editor format.key output
691 + }
692 + { format.authors output.nonnull
693 + crossref missing$
694 + { "author and editor" editor either.or.check }
695 + 'skip$
696 + if$
697 + }
698 + if$
699 + format.date "year" output.check
700 + new.block
701 + format.btitle "title" output.check
702 + crossref missing$
703 + { format.bvolume output
704 + new.block
705 + format.number.series output
706 + new.sentence
707 + publisher "publisher" output.check
708 + address output
709 + }
710 + {
711 + new.block
712 + format.book.crossref output.nonnull
713 + }
714 + if$
715 + format.edition output
716 + new.block
717 + note output
718 + fin.entry
719 +}
720 +
721 +FUNCTION {booklet}
722 +{ output.bibitem
723 + format.authors output
724 + author format.key output
725 + format.date "year" output.check
726 + new.block
727 + format.title "title" output.check
728 + new.block
729 + howpublished output
730 + address output
731 + new.block
732 + note output
733 + fin.entry
734 +}
735 +
736 +FUNCTION {inbook}
737 +{ output.bibitem
738 + author empty$
739 + { format.editors "author and editor" output.check
740 + editor format.key output
741 + }
742 + { format.authors output.nonnull
743 + crossref missing$
744 + { "author and editor" editor either.or.check }
745 + 'skip$
746 + if$
747 + }
748 + if$
749 + format.date "year" output.check
750 + new.block
751 + format.btitle "title" output.check
752 + crossref missing$
753 + { format.bvolume output
754 + format.chapter.pages "chapter and pages" output.check
755 + new.block
756 + format.number.series output
757 + new.sentence
758 + publisher "publisher" output.check
759 + address output
760 + }
761 + { format.chapter.pages "chapter and pages" output.check
762 + new.block
763 + format.book.crossref output.nonnull
764 + }
765 + if$
766 + format.edition output
767 + new.block
768 + note output
769 + fin.entry
770 +}
771 +
772 +FUNCTION {incollection}
773 +{ output.bibitem
774 + format.authors "author" output.check
775 + author format.key output
776 + format.date "year" output.check
777 + new.block
778 + format.title "title" output.check
779 + new.block
780 + crossref missing$
781 + { format.in.ed.booktitle "booktitle" output.check
782 + format.bvolume output
783 + format.number.series output
784 + format.chapter.pages output
785 + new.sentence
786 + publisher "publisher" output.check
787 + address output
788 + format.edition output
789 + }
790 + { format.incoll.inproc.crossref output.nonnull
791 + format.chapter.pages output
792 + }
793 + if$
794 + new.block
795 + note output
796 + fin.entry
797 +}
798 +
799 +FUNCTION {inproceedings}
800 +{ output.bibitem
801 + format.authors "author" output.check
802 + author format.key output
803 + format.date "year" output.check
804 + new.block
805 + format.title "title" output.check
806 + new.block
807 + crossref missing$
808 + { format.in.ed.booktitle "booktitle" output.check
809 + format.bvolume output
810 + format.number.series output
811 + format.pages output
812 + address output
813 + new.sentence
814 + organization output
815 + publisher output
816 + }
817 + { format.incoll.inproc.crossref output.nonnull
818 + format.pages output
819 + }
820 + if$
821 + new.block
822 + note output
823 + fin.entry
824 +}
825 +
826 +FUNCTION {conference} { inproceedings }
827 +
828 +FUNCTION {manual}
829 +{ output.bibitem
830 + format.authors output
831 + author format.key output
832 + format.date "year" output.check
833 + new.block
834 + format.btitle "title" output.check
835 + organization address new.block.checkb
836 + organization output
837 + address output
838 + format.edition output
839 + new.block
840 + note output
841 + fin.entry
842 +}
843 +
844 +FUNCTION {mastersthesis}
845 +{ output.bibitem
846 + format.authors "author" output.check
847 + author format.key output
848 + format.date "year" output.check
849 + new.block
850 + format.btitle "title" output.check
851 + new.block
852 + "Master's thesis" format.thesis.type output.nonnull
853 + school "school" output.check
854 + address output
855 + new.block
856 + note output
857 + fin.entry
858 +}
859 +
860 +FUNCTION {misc}
861 +{ output.bibitem
862 + format.authors output
863 + author format.key output
864 + format.date "year" output.check
865 + new.block
866 + format.title output
867 + new.block
868 + howpublished output
869 + new.block
870 + note output
871 + fin.entry
872 +}
873 +
874 +FUNCTION {phdthesis}
875 +{ output.bibitem
876 + format.authors "author" output.check
877 + author format.key output
878 + format.date "year" output.check
879 + new.block
880 + format.btitle "title" output.check
881 + new.block
882 + "Ph.D. thesis" format.thesis.type output.nonnull
883 + school "school" output.check
884 + address output
885 + new.block
886 + note output
887 + fin.entry
888 +}
889 +
890 +FUNCTION {proceedings}
891 +{ output.bibitem
892 + format.editors output
893 + editor format.key output
894 + format.date "year" output.check
895 + new.block
896 + format.btitle "title" output.check
897 + format.bvolume output
898 + format.number.series output
899 + address output
900 + new.sentence
901 + organization output
902 + publisher output
903 + new.block
904 + note output
905 + fin.entry
906 +}
907 +
908 +FUNCTION {techreport}
909 +{ output.bibitem
910 + format.authors "author" output.check
911 + author format.key output
912 + format.date "year" output.check
913 + new.block
914 + format.title "title" output.check
915 + new.block
916 + format.tr.number output.nonnull
917 + institution "institution" output.check
918 + address output
919 + new.block
920 + note output
921 + fin.entry
922 +}
923 +
924 +FUNCTION {unpublished}
925 +{ output.bibitem
926 + format.authors "author" output.check
927 + author format.key output
928 + format.date "year" output.check
929 + new.block
930 + format.title "title" output.check
931 + new.block
932 + note "note" output.check
933 + fin.entry
934 +}
935 +
936 +FUNCTION {default.type} { misc }
937 +
938 +MACRO {jan} {"January"}
939 +
940 +MACRO {feb} {"February"}
941 +
942 +MACRO {mar} {"March"}
943 +
944 +MACRO {apr} {"April"}
945 +
946 +MACRO {may} {"May"}
947 +
948 +MACRO {jun} {"June"}
949 +
950 +MACRO {jul} {"July"}
951 +
952 +MACRO {aug} {"August"}
953 +
954 +MACRO {sep} {"September"}
955 +
956 +MACRO {oct} {"October"}
957 +
958 +MACRO {nov} {"November"}
959 +
960 +MACRO {dec} {"December"}
961 +
962 +MACRO {acmcs} {"ACM Computing Surveys"}
963 +
964 +MACRO {acta} {"Acta Informatica"}
965 +
966 +MACRO {cacm} {"Communications of the ACM"}
967 +
968 +MACRO {ibmjrd} {"IBM Journal of Research and Development"}
969 +
970 +MACRO {ibmsj} {"IBM Systems Journal"}
971 +
972 +MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
973 +
974 +MACRO {ieeetc} {"IEEE Transactions on Computers"}
975 +
976 +MACRO {ieeetcad}
977 + {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
978 +
979 +MACRO {ipl} {"Information Processing Letters"}
980 +
981 +MACRO {jacm} {"Journal of the ACM"}
982 +
983 +MACRO {jcss} {"Journal of Computer and System Sciences"}
984 +
985 +MACRO {scp} {"Science of Computer Programming"}
986 +
987 +MACRO {sicomp} {"SIAM Journal on Computing"}
988 +
989 +MACRO {tocs} {"ACM Transactions on Computer Systems"}
990 +
991 +MACRO {tods} {"ACM Transactions on Database Systems"}
992 +
993 +MACRO {tog} {"ACM Transactions on Graphics"}
994 +
995 +MACRO {toms} {"ACM Transactions on Mathematical Software"}
996 +
997 +MACRO {toois} {"ACM Transactions on Office Information Systems"}
998 +
999 +MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1000 +
1001 +MACRO {tcs} {"Theoretical Computer Science"}
1002 +
1003 +READ
1004 +
1005 +FUNCTION {sortify}
1006 +{ purify$
1007 + "l" change.case$
1008 +}
1009 +
1010 +INTEGERS { len }
1011 +
1012 +FUNCTION {chop.word}
1013 +{ 's :=
1014 + 'len :=
1015 + s #1 len substring$ =
1016 + { s len #1 + global.max$ substring$ }
1017 + 's
1018 + if$
1019 +}
1020 +
1021 +FUNCTION {format.lab.names}
1022 +{ 's :=
1023 + s #1 "{vv~}{ll}" format.name$
1024 + s num.names$ duplicate$
1025 + #2 >
1026 + { pop$ " " * "et~al." emphasize * }
1027 + { #2 <
1028 + 'skip$
1029 + { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1030 + { " " * "et~al." emphasize * }
1031 + { " and " * s #2 "{vv~}{ll}" format.name$ * }
1032 + if$
1033 + }
1034 + if$
1035 + }
1036 + if$
1037 +}
1038 +
1039 +FUNCTION {author.key.label}
1040 +{ author empty$
1041 + { key empty$
1042 + { cite$ #1 #3 substring$ }
1043 + 'key
1044 + if$
1045 + }
1046 + { author format.lab.names }
1047 + if$
1048 +}
1049 +
1050 +FUNCTION {author.editor.key.label}
1051 +{ author empty$
1052 + { editor empty$
1053 + { key empty$
1054 + { cite$ #1 #3 substring$ }
1055 + 'key
1056 + if$
1057 + }
1058 + { editor format.lab.names }
1059 + if$
1060 + }
1061 + { author format.lab.names }
1062 + if$
1063 +}
1064 +
1065 +FUNCTION {editor.key.label}
1066 +{ editor empty$
1067 + { key empty$
1068 + { cite$ #1 #3 substring$ }
1069 + 'key
1070 + if$
1071 + }
1072 + { editor format.lab.names }
1073 + if$
1074 +}
1075 +
1076 +FUNCTION {calc.label}
1077 +{ type$ "book" =
1078 + type$ "inbook" =
1079 + or
1080 + 'author.editor.key.label
1081 + { type$ "proceedings" =
1082 + 'editor.key.label
1083 + 'author.key.label
1084 + if$
1085 + }
1086 + if$
1087 + "("
1088 + *
1089 + year duplicate$ empty$
1090 + { pop$ "????" }
1091 + { purify$ #-1 #4 substring$ }
1092 + if$
1093 + *
1094 + 'label :=
1095 +}
1096 +
1097 +FUNCTION {sort.format.names}
1098 +{ 's :=
1099 + #1 'nameptr :=
1100 + ""
1101 + s num.names$ 'numnames :=
1102 + numnames 'namesleft :=
1103 + { namesleft #0 > }
1104 + { nameptr #1 >
1105 + { " " * }
1106 + 'skip$
1107 + if$
1108 + s nameptr
1109 + "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}"
1110 + format.name$ 't :=
1111 + nameptr numnames = t "others" = and
1112 + { "et al" * }
1113 + { numnames #2 > nameptr #2 = and
1114 + { "zzzzzz" * #1 'namesleft := }
1115 + { t sortify * }
1116 + if$
1117 + }
1118 + if$
1119 + nameptr #1 + 'nameptr :=
1120 + namesleft #1 - 'namesleft :=
1121 + }
1122 + while$
1123 +}
1124 +
1125 +FUNCTION {sort.format.title}
1126 +{ 't :=
1127 + "A " #2
1128 + "An " #3
1129 + "The " #4 t chop.word
1130 + chop.word
1131 + chop.word
1132 + sortify
1133 + #1 global.max$ substring$
1134 +}
1135 +
1136 +FUNCTION {author.sort}
1137 +{ author empty$
1138 + { key empty$
1139 + { "to sort, need author or key in " cite$ * warning$
1140 + ""
1141 + }
1142 + { key sortify }
1143 + if$
1144 + }
1145 + { author sort.format.names }
1146 + if$
1147 +}
1148 +
1149 +FUNCTION {author.editor.sort}
1150 +{ author empty$
1151 + { editor empty$
1152 + { key empty$
1153 + { "to sort, need author, editor, or key in " cite$ * warning$
1154 + ""
1155 + }
1156 + { key sortify }
1157 + if$
1158 + }
1159 + { editor sort.format.names }
1160 + if$
1161 + }
1162 + { author sort.format.names }
1163 + if$
1164 +}
1165 +
1166 +FUNCTION {editor.sort}
1167 +{ editor empty$
1168 + { key empty$
1169 + { "to sort, need editor or key in " cite$ * warning$
1170 + ""
1171 + }
1172 + { key sortify }
1173 + if$
1174 + }
1175 + { editor sort.format.names }
1176 + if$
1177 +}
1178 +
1179 +FUNCTION {presort}
1180 +{ calc.label
1181 + label sortify
1182 + " "
1183 + *
1184 + type$ "book" =
1185 + type$ "inbook" =
1186 + or
1187 + 'author.editor.sort
1188 + { type$ "proceedings" =
1189 + 'editor.sort
1190 + 'author.sort
1191 + if$
1192 + }
1193 + if$
1194 + #1 entry.max$ substring$
1195 + 'sort.label :=
1196 + sort.label
1197 + *
1198 + " "
1199 + *
1200 + title field.or.null
1201 + sort.format.title
1202 + *
1203 + #1 entry.max$ substring$
1204 + 'sort.key$ :=
1205 +}
1206 +
1207 +ITERATE {presort}
1208 +
1209 +SORT
1210 +
1211 +STRINGS { last.label next.extra }
1212 +
1213 +INTEGERS { last.extra.num }
1214 +
1215 +FUNCTION {initialize.extra.label.stuff}
1216 +{ #0 int.to.chr$ 'last.label :=
1217 + "" 'next.extra :=
1218 + #0 'last.extra.num :=
1219 +}
1220 +
1221 +FUNCTION {forward.pass}
1222 +{ last.label label =
1223 + { last.extra.num #1 + 'last.extra.num :=
1224 + last.extra.num int.to.chr$ 'extra.label :=
1225 + }
1226 + { "a" chr.to.int$ 'last.extra.num :=
1227 + "" 'extra.label :=
1228 + label 'last.label :=
1229 + }
1230 + if$
1231 +}
1232 +
1233 +FUNCTION {reverse.pass}
1234 +{ next.extra "b" =
1235 + { "a" 'extra.label := }
1236 + 'skip$
1237 + if$
1238 + extra.label 'next.extra :=
1239 + label extra.label * 'label :=
1240 +}
1241 +
1242 +EXECUTE {initialize.extra.label.stuff}
1243 +
1244 +ITERATE {forward.pass}
1245 +
1246 +REVERSE {reverse.pass}
1247 +
1248 +FUNCTION {bib.sort.order}
1249 +{ sort.label
1250 + " "
1251 + *
1252 + year field.or.null sortify
1253 + *
1254 + " "
1255 + *
1256 + title field.or.null
1257 + sort.format.title
1258 + *
1259 + #1 entry.max$ substring$
1260 + 'sort.key$ :=
1261 +}
1262 +
1263 +ITERATE {bib.sort.order}
1264 +
1265 +SORT
1266 +
1267 +FUNCTION {begin.bib}
1268 +{ preamble$ empty$
1269 + 'skip$
1270 + { preamble$ write$ newline$ }
1271 + if$
1272 + "\begin{thebibliography}{}" write$ newline$
1273 +}
1274 +
1275 +EXECUTE {begin.bib}
1276 +
1277 +EXECUTE {init.state.consts}
1278 +
1279 +ITERATE {call.type$}
1280 +
1281 +FUNCTION {end.bib}
1282 +{ newline$
1283 + "\end{thebibliography}" write$ newline$
1284 +}
1285 +
1286 +EXECUTE {end.bib}
1287 +%% End of customized bst file
...\ No newline at end of file ...\ No newline at end of file
1 +
2 +
3 +@article{cruz2011sequence,
4 + title={Sequence-based identification of 3D structural modules in {RNA} with RMDetect},
5 + author={Cruz, Jos{\'e} Almeida and Westhof, Eric},
6 + journal={Nature methods},
7 + volume={8},
8 + number={6},
9 + pages={513},
10 + year={2011},
11 + publisher={Nature Publishing Group}
12 +}
13 +
14 +@article{djelloul_automated_2008,
15 + title = {Automated motif extraction and classification in {RNA} tertiary structures},
16 + volume = {14},
17 + issn = {1355-8382, 1469-9001},
18 + url = {http://rnajournal.cshlp.org/content/14/12/2489},
19 + doi = {10.1261/rna.1061108},
20 + abstract = {We used a novel graph-based approach to extract {RNA} tertiary motifs. We cataloged them all and clustered them using an innovative graph similarity measure. We applied our method to three widely studied structures: Haloarcula marismortui 50S (H.m 50S), Escherichia coli 50S (E. coli 50S), and Thermus thermophilus 16S (T.th 16S) RNAs. We identified 10 known motifs without any prior knowledge of their shapes or positions. We additionally identified four putative new motifs.},
21 + language = {en},
22 + number = {12},
23 + urldate = {2018-10-04},
24 + journal = {RNA},
25 + author = {Djelloul, Mahassine and Denise, Alain},
26 + month = jan,
27 + year = {2008},
28 + pmid = {18957493},
29 + keywords = {clustering, graph similarity, {RNA} tertiary structure},
30 + pages = {2489--2497},
31 + file = {Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/6PDZZRI6/Djelloul et Denise - 2008 - Automated motif extraction and classification in R.pdf:application/pdf;Snapshot:/nhome/siniac/lbecquey/Zotero/storage/28T5ICXG/2489.html:text/html}
32 +}
33 +
34 +@article{roll_jar3d_2016,
35 + title = {{JAR}3D {Webserver}: {Scoring} and aligning {RNA} loop sequences to known 3D motifs},
36 + volume = {44},
37 + issn = {0305-1048},
38 + shorttitle = {{JAR}3D {Webserver}},
39 + url = {https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4987954/},
40 + doi = {10.1093/nar/gkw453},
41 + abstract = {Many non-coding RNAs have been identified and may function by forming 2D and 3D structures. {RNA} hairpin and internal loops are often represented as unstructured on secondary structure diagrams, but {RNA} 3D structures show that most such loops are structured by non-Watson–Crick basepairs and base stacking. Moreover, different {RNA} sequences can form the same {RNA} 3D motif. JAR3D finds possible 3D geometries for hairpin and internal loops by matching loop sequences to motif groups from the {RNA} 3D Motif Atlas, by exact sequence match when possible, and by probabilistic scoring and edit distance for novel sequences. The scoring gauges the ability of the sequences to form the same pattern of interactions observed in 3D structures of the motif. The JAR3D webserver at http://rna.bgsu.edu/jar3d/ takes one or many sequences of a single loop as input, or else one or many sequences of longer RNAs with multiple loops. Each sequence is scored against all current motif groups. The output shows the ten best-matching motif groups. Users can align input sequences to each of the motif groups found by JAR3D. JAR3D will be updated with every release of the {RNA} 3D Motif Atlas, and so its performance is expected to improve over time.},
42 + number = {Web Server issue},
43 + urldate = {2018-10-04},
44 + journal = {Nucleic Acids Research},
45 + author = {Roll, James and Zirbel, Craig L. and Sweeney, Blake and Petrov, Anton I. and Leontis, Neocles},
46 + month = jul,
47 + year = {2016},
48 + pmid = {27235417},
49 + pmcid = {PMC4987954},
50 + pages = {W320--W327},
51 + file = {PubMed Central Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/KWD59J5I/Roll et al. - 2016 - JAR3D Webserver Scoring and aligning {RNA} loop seq.pdf:application/pdf}
52 +}
53 +
54 +@article{zhong_rnamotifscan:_2010,
55 + title = {{RNAMotifScan}: automatic identification of {RNA} structural motifs using secondary structural alignment},
56 + volume = {38},
57 + issn = {0305-1048},
58 + shorttitle = {{RNAMotifScan}},
59 + url = {https://academic.oup.com/nar/article/38/18/e176/1069222},
60 + doi = {10.1093/nar/gkq672},
61 + abstract = {Abstract. Recent studies have shown that {RNA} structural motifs play essential roles in {RNA} folding and interaction with other molecules. Computational identifi},
62 + language = {en},
63 + number = {18},
64 + urldate = {2018-10-04},
65 + journal = {Nucleic Acids Research},
66 + author = {Zhong, Cuncong and Tang, Haixu and Zhang, Shaojie},
67 + month = oct,
68 + year = {2010},
69 + pages = {e176--e176},
70 + file = {Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/ESXL69Q6/Zhong et al. - 2010 - RNAMotifScan automatic identification of {RNA} stru.pdf:application/pdf;Snapshot:/nhome/siniac/lbecquey/Zotero/storage/MWTNC94Z/1069222.html:text/html}
71 +}
72 +
73 +@inproceedings{tahi_fast_2003,
74 + title = {A fast algorithm for {RNA} secondary structure prediction including pseudoknots},
75 + doi = {10.1109/BIBE.2003.1188924},
76 + abstract = {Many important {RNA} molecules contain pseudoknots, which are generally excluded by the definition of the secondary structure, mainly for computational reasons. Still, most existing algorithms for secondary structure prediction are not satisfactory in results and complexities, even when pseudoknots are not allowed. We present an algorithm, called P-DCFold, for the prediction of {RNA} secondary structures including all kinds of pseudoknots. It is based on the comparative approach. The helices are searched recursively, from more "likely" to less "likely", using the "Divide and Conquer" approach. This approach, which allows to limit the amount of searching, is possible when only non-interleaved helices are searched for. The pseudoknots are therefore searched in several steps, each helix of the pseudoknot being selected in a different step. P-DCFold has been applied to tmRNA and RnaseP sequences. In less than two seconds, their respective secondary structures, including their pseudoknots, have been recovered very efficiently.},
77 + booktitle = {Third {IEEE} {Symposium} on {Bioinformatics} and {Bioengineering}, 2003. {Proceedings}.},
78 + author = {Tahi, F. and Engelen, S. and Regnier, M.},
79 + month = mar,
80 + year = {2003},
81 + keywords = {2 s, Bioinformatics, Biological control systems, computational methods, computational reasons, Context modeling, Databases, Evolution (biology), fast algorithm, macromolecules, molecular biophysics, molecular configurations, noninterleaved helices, Predictive models, pseudoknots, recursive searches, RNA, {RNA} secondary structure prediction, RnaseP, Robustness, secondary structures, spatial structures, Stochastic processes, Switches, tmRNA},
82 + pages = {11--17},
83 + file = {IEEE Xplore Abstract Record:/nhome/siniac/lbecquey/Zotero/storage/HTHXNSVF/1188924.html:text/html}
84 +}
85 +
86 +@article{tahi_p-dcfold_2005,
87 + title = {P-dcfold or how to predict all kinds of pseudoknots in {RNA} secondary structures},
88 + volume = {14},
89 + issn = {0218-2130},
90 + url = {https://www.worldscientific.com/doi/abs/10.1142/S021821300500234X},
91 + doi = {10.1142/S021821300500234X},
92 + abstract = {Pseudoknots play important roles in many RNAs. But for computational reasons, pseudoknots are usually excluded from the definition of {RNA} secondary structures. Indeed, prediction of pseudoknots increase very highly the complexities in time of the algorithms, knowing that all existing algorithms for {RNA} secondary structure prediction have complexities at least of O(n3). Some algorithms have been developed for searching pseudoknots, but all of them have very high complexities, and consider generally particular kinds of pseudoknots.We present an algorithm, called P-DCFold based on the comparative approach, for the prediction of {RNA} secondary structures including all kinds of pseudoknots. The helices are searched recursively using the "Divide and Conquer" approach, searching the helices from the "most significant" to the "less significant". A selected helix subdivide the sequence into two sub-sequences, the internal one and a concatenation of the two externals. This approach is used to search non-interleaved helices and allows to limit the space of searching. To search for pseudoknots, the processing is reiterated. Therefore, each helix of the pseudoknot is selected in a different step.P-DCFold has been applied to several {RNA} sequences. In less than two seconds, their respective secondary structures, including their pseudoknots, have been recovered very efficiently.},
93 + number = {05},
94 + urldate = {2018-10-02},
95 + journal = {International Journal on Artificial Intelligence Tools},
96 + author = {Tahi, Fariza and Stefan, Engelen and Regnier, Mireille},
97 + month = oct,
98 + year = {2005},
99 + pages = {703--716},
100 + file = {Snapshot:/nhome/siniac/lbecquey/Zotero/storage/GEIBPMJ4/S021821300500234X.html:text/html}
101 +}
102 +
103 +@article{tempel_fast_2012,
104 + title = {A fast ab-initio method for predicting {miRNA} precursors in genomes},
105 + volume = {40},
106 + issn = {0305-1048},
107 + url = {https://academic.oup.com/nar/article/40/11/e80/2409259},
108 + doi = {10.1093/nar/gks146},
109 + abstract = {Abstract. miRNAs are small non coding {RNA} structures which play important roles in biological processes. Finding miRNA precursors in genomes is therefore an i},
110 + language = {en},
111 + number = {11},
112 + urldate = {2018-10-02},
113 + journal = {Nucleic Acids Research},
114 + author = {Tempel, Sébastien and Tahi, Fariza},
115 + month = jun,
116 + year = {2012},
117 + pages = {e80--e80},
118 + file = {Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/BSCSRRL2/Tempel et Tahi - 2012 - A fast ab-initio method for predicting miRNA precu.pdf:application/pdf;Snapshot:/nhome/siniac/lbecquey/Zotero/storage/ZTG4GDDT/2409259.html:text/html}
119 +}
120 +
121 +@article{reinharz_towards_2012,
122 + title = {Towards 3D structure prediction of large {RNA} molecules: an integer programming framework to insert local 3D motifs in {RNA} secondary structure},
123 + volume = {28},
124 + issn = {1367-4803},
125 + shorttitle = {Towards 3D structure prediction of large {RNA} molecules},
126 + url = {https://academic.oup.com/bioinformatics/article/28/12/i207/269345},
127 + doi = {10.1093/bioinformatics/bts226},
128 + abstract = {Abstract. Motivation: The prediction of {RNA} 3D structures from its sequence only is a milestone to {RNA} function analysis and prediction. In recent years, many},
129 + language = {en},
130 + number = {12},
131 + urldate = {2018-10-01},
132 + journal = {Bioinformatics},
133 + author = {Reinharz, Vladimir and Major, François and Waldispühl, Jérôme},
134 + month = jun,
135 + year = {2012},
136 + pages = {i207--i214},
137 + file = {Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/IAYRK53E/Reinharz et al. - 2012 - Towards 3D structure prediction of large {RNA} molec.pdf:application/pdf;Snapshot:/nhome/siniac/lbecquey/Zotero/storage/SSMTN6YZ/269345.html:text/html}
138 +}
139 +
140 +@article{pan_predicting_nodate,
141 + title = {Predicting {RNA}–protein binding sites and motifs through combining local and global deep convolutional neural networks},
142 + url = {https://academic.oup.com/bioinformatics/advance-article/doi/10.1093/bioinformatics/bty364/4990826},
143 + doi = {10.1093/bioinformatics/bty364},
144 + abstract = {AbstractMotivation. RNA-binding proteins (RBPs) take over 5–10\% of the eukaryotic proteome and play key roles in many biological processes, e.g. gene regulatio},
145 + language = {en},
146 + urldate = {2018-06-12},
147 + journal = {Bioinformatics},
148 + author = {Pan, Xiaoyong and Shen, Hong-Bin and Valencia, Alfonso},
149 + file = {10.1093@bioinformatics@bty364.pdf:/nhome/siniac/lbecquey/Zotero/storage/KUQZ2HNN/10.1093@bioinformatics@bty364.pdf:application/pdf;Snapshot:/nhome/siniac/lbecquey/Zotero/storage/TLQUYHEU/4990826.html:text/html}
150 +}
151 +
152 +@article{yi_brief_2017,
153 + title = {A {Brief} {Review} of {RNA}–{Protein} {Interaction} {Database} {Resources}},
154 + volume = {3},
155 + issn = {2311-553X},
156 + url = {https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5832006/},
157 + doi = {10.3390/ncrna3010006},
158 + abstract = {RNA–Protein interactions play critical roles in various biological processes. By collecting and analyzing the RNA–Protein interactions and binding sites from experiments and predictions, RNA–Protein interaction databases have become an essential resource for the exploration of the transcriptional and post-transcriptional regulatory network. Here, we briefly review several widely used RNA–Protein interaction database resources developed in recent years to provide a guide of these databases. The content and major functions in databases are presented. The brief description of database helps users to quickly choose the database containing information they interested. In short, these RNA–Protein interaction database resources are continually updated, but the current state shows the efforts to identify and analyze the large amount of RNA–Protein interactions.},
159 + number = {1},
160 + urldate = {2018-06-08},
161 + journal = {Non-Coding RNA},
162 + author = {Yi, Ying and Zhao, Yue and Huang, Yan and Wang, Dong},
163 + month = jan,
164 + year = {2017},
165 + pmid = {29657278},
166 + pmcid = {PMC5832006},
167 + file = {PubMed Central Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/C3ZRG7MJ/Yi et al. - 2017 - A Brief Review of RNA–Protein Interaction Database.pdf:application/pdf}
168 +}
169 +
170 +@article{das_automated_2007,
171 + title = {Automated de novo prediction of native-like {RNA} tertiary structures},
172 + volume = {104},
173 + copyright = {© 2007 by The National Academy of Sciences of the USA. Freely available online through the PNAS open access option.},
174 + issn = {0027-8424, 1091-6490},
175 + url = {http://www.pnas.org/content/104/37/14664},
176 + doi = {10.1073/pnas.0703836104},
177 + abstract = {RNA tertiary structure prediction has been based almost entirely on base-pairing constraints derived from phylogenetic covariation analysis. We describe here a complementary approach, inspired by the Rosetta low-resolution protein structure prediction method, that seeks the lowest energy tertiary structure for a given {RNA} sequence without using evolutionary information. In a benchmark test of 20 {RNA} sequences with known structure and lengths of ≈30 nt, the new method reproduces better than 90\% of Watson–Crick base pairs, comparable with the accuracy of secondary structure prediction methods. In more than half the cases, at least one of the top five models agrees with the native structure to better than 4 Å rmsd over the backbone. Most importantly, the method recapitulates more than one-third of non-Watson–Crick base pairs seen in the native structures. Tandem stacks of “sheared” base pairs, base triplets, and pseudoknots are among the noncanonical features reproduced in the models. In the cases in which none of the top five models were native-like, higher energy conformations similar to the native structures are still sampled frequently but not assigned low energies. These results suggest that modest improvements in the energy function, together with the incorporation of information from phylogenetic covariance, may allow confident and accurate structure prediction for larger and more complex {RNA} chains.},
178 + language = {en},
179 + number = {37},
180 + urldate = {2018-06-04},
181 + journal = {Proceedings of the National Academy of Sciences},
182 + author = {Das, Rhiju and Baker, David},
183 + month = sep,
184 + year = {2007},
185 + pmid = {17726102},
186 + keywords = {ab initio, energy-based, fragment assembly, nucleic acid, Rosetta},
187 + pages = {14664--14669},
188 + file = {Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/H79FEN6P/Das and Baker - 2007 - Automated de novo prediction of native-like {RNA} te.pdf:application/pdf;Snapshot:/nhome/siniac/lbecquey/Zotero/storage/WH7PUGNW/14664.html:text/html}
189 +}
190 +
191 +@article{cao_physics-based_2011,
192 + title = {Physics-based de novo prediction of {RNA} 3D structures},
193 + volume = {115},
194 + issn = {1520-6106},
195 + url = {https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3072456/},
196 + doi = {10.1021/jp112059y},
197 + abstract = {Current experiments on structural determination cannot keep up the pace with the steadily emerging {RNA} sequences and new functions. This underscores the request for an accurate model for {RNA} three-dimensional (3D) structural prediction. Although considerable progress has been made in mechanistic studies, accurate prediction for {RNA} tertiary folding from sequence remains an unsolved problem. The first and most important requirement for the prediction of {RNA} structure from physical principles is an accurate free energy model. A recently developed three-vector virtual bond-based {RNA} folding model (“Vfold”) has allowed us to compute the chain entropy and predict folding free energies and structures for {RNA} secondary structures and simple pseudoknots. Here we develop a free energy-based method to predict larger more complex {RNA} tertiary folds. The approach is based on a multiscaling strategy: from the nucleotide sequence, we predict the two-dimensional (2D) structures (defined by the base pairs and tertiary contacts); based on the 2D structure, we construct a 3D scaffold; with the 3D scaffold as the initial state, we combine AMBER energy minimization and PDB-based fragment search to predict the all-atom structure. A key advantage of the approach is the statistical mechanical calculation for the conformational entropy of {RNA} structures, including those with cross-linked loops. Benchmark tests show that the model leads to significant improvements in {RNA} 3D structure prediction.},
198 + number = {14},
199 + urldate = {2018-06-04},
200 + journal = {The journal of physical chemistry. B},
201 + author = {Cao, Song and Chen, Shi-Jie},
202 + month = apr,
203 + year = {2011},
204 + pmid = {21413701},
205 + pmcid = {PMC3072456},
206 + pages = {4216--4226},
207 + file = {PubMed Central Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/ZY98QT5K/Cao and Chen - 2011 - Physics-based de novo prediction of {RNA} 3D structu.pdf:application/pdf}
208 +}
209 +
210 +@article{bellaousov2010probknot,
211 + title={ProbKnot: fast prediction of {RNA} secondary structure including pseudoknots},
212 + author={Bellaousov, Stanislav and Mathews, David H},
213 + journal={Rna},
214 + volume={16},
215 + number={10},
216 + pages={1870--1880},
217 + year={2010},
218 + publisher={Cold Spring Harbor Lab}
219 +}
220 +
221 +@article{mccaskill1990equilibrium,
222 + title={The equilibrium partition function and base pair binding probabilities for {RNA} secondary structure},
223 + author={McCaskill, John S},
224 + journal={Biopolymers: Original Research on Biomolecules},
225 + volume={29},
226 + number={6-7},
227 + pages={1105--1119},
228 + year={1990},
229 + publisher={Wiley Online Library}
230 +}
231 +
232 +@article{bottaro_towards_2015,
233 + title = {Towards de novo {RNA} 3D {Structure} {Prediction}},
234 + volume = {2},
235 + copyright = {Copyright (c) 2015 Sandro Bottaro, Francesco Di Palma, Giovanni Bussi},
236 + issn = {2375-2467},
237 + url = {http://www.smartscitech.com/index.php/RD/article/view/544},
238 + doi = {10.14800/rd.544},
239 + abstract = {RNA is a fundamental class of biomolecules that mediate a large variety of molecular processes within the cell. Computational algorithms can be of great help in the understanding of {RNA} structure-function relationship. One of the main challenges in this field is the development of structure-prediction algorithms, which aim at the prediction of the three-dimensional (3D) native fold from the sole knowledge of the sequence. In a recent paper, we have introduced a scoring function for {RNA} structure prediction. Here, we analyze in detail the performance of the method, we underline strengths and shortcomings, and we discuss the results with respect to state-of-the-art techniques. These observations provide a starting point for improving current methodologies, thus paving the way to the advances of more accurate approaches for {RNA} 3D structure prediction.},
240 + language = {en},
241 + number = {2},
242 + urldate = {2018-06-04},
243 + journal = {RNA \& DISEASE},
244 + author = {Bottaro, Sandro and Palma, Francesco Di and Bussi, Giovanni},
245 + month = jan,
246 + year = {2015},
247 + file = {Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/SWAYZQEV/Bottaro et al. - 2015 - Towards de novo {RNA} 3D Structure Prediction.pdf:application/pdf;Snapshot:/nhome/siniac/lbecquey/Zotero/storage/SQMMYVCU/544.html:text/html}
248 +}
249 +
250 +@article{mathews2004using,
251 + title={Using an {RNA} secondary structure partition function to determine confidence in base pairs predicted by free energy minimization},
252 + author={Mathews, David H},
253 + journal={Rna},
254 + volume={10},
255 + number={8},
256 + pages={1178--1190},
257 + year={2004},
258 + publisher={Cold Spring Harbor Lab}
259 +}
260 +
261 +@article{lorenz2011viennarna,
262 + title={ViennaRNA Package 2.0},
263 + author={Lorenz, Ronny and Bernhart, Stephan H and Zu Siederdissen, Christian Hoener and Tafer, Hakim and Flamm, Christoph and Stadler, Peter F and Hofacker, Ivo L},
264 + journal={Algorithms for Molecular Biology},
265 + volume={6},
266 + number={1},
267 + pages={26},
268 + year={2011},
269 + publisher={BioMed Central}
270 +}
271 +@article{andronescu2008rna,
272 + title={RNA STRAND: the {RNA} secondary structure and statistical analysis database},
273 + author={Andronescu, Mirela and Bereg, Vera and Hoos, Holger H and Condon, Anne},
274 + journal={BMC bioinformatics},
275 + volume={9},
276 + number={1},
277 + pages={340},
278 + year={2008},
279 + publisher={BioMed Central}
280 +}
281 +
282 +@article{bindewald_multistrand_2016,
283 + title = {Multistrand {Structure} {Prediction} of {Nucleic} {Acid} {Assemblies} and {Design} of {RNA} {Switches}},
284 + volume = {16},
285 + issn = {1530-6984},
286 + url = {https://doi.org/10.1021/acs.nanolett.5b04651},
287 + doi = {10.1021/acs.nanolett.5b04651},
288 + abstract = {RNA is an attractive material for the creation of molecular logic gates that release programmed functionalities only in the presence of specific molecular interaction partners. Here we present HyperFold, a multistrand RNA/DNA structure prediction approach for predicting nucleic acid complexes that can contain pseudoknots. We show that HyperFold also performs competitively compared to other published folding algorithms. We performed a large variety of RNA/DNA hybrid reassociation experiments for different concentrations, DNA toehold lengths, and G+C content and find that the observed tendencies for reassociation correspond well to computational predictions. Importantly, we apply this method to the design and experimental verification of a two-stranded {RNA} molecular switch that upon binding to a single-stranded {RNA} toehold disease-marker trigger mRNA changes its conformation releasing an shRNA-like Dicer substrate structure. To demonstrate the concept, connective tissue growth factor (CTGF) mRNA and enhanced green fluorescent protein (eGFP) mRNA were chosen as trigger and target sequences, respectively. In vitro experiments confirm the formation of an {RNA} switch and demonstrate that the functional unit is being released when the trigger {RNA} interacts with the switch toehold. The designed {RNA} switch is shown to be functional in MDA-MB-231 breast cancer cells. Several other switches were also designed and tested. We conclude that this approach has considerable potential because, in principle, it allows the release of an siRNA designed against a gene that differs from the gene that is utilized as a biomarker for a disease state.},
289 + number = {3},
290 + urldate = {2018-05-31},
291 + journal = {Nano Letters},
292 + author = {Bindewald, Eckart and Afonin, Kirill A. and Viard, Mathias and Zakrevsky, Paul and Kim, Taejin and Shapiro, Bruce A.},
293 + month = mar,
294 + year = {2016},
295 + pages = {1726--1735},
296 + file = {ACS Full Text Snapshot:/nhome/siniac/lbecquey/Zotero/storage/285MME3I/acs.nanolett.html:text/html}
297 +}
298 +
299 +
300 +@article{parisien2008mc,
301 + title={The MC-Fold and MC-Sym pipeline infers {RNA} structure from sequence data},
302 + author={Parisien, Marc and Major, Francois},
303 + journal={Nature},
304 + volume={452},
305 + number={7183},
306 + pages={51},
307 + year={2008},
308 + publisher={Nature Publishing Group}
309 +}
310 +
311 +@article{ge_novo_2018,
312 + title = {De novo discovery of structural motifs in {RNA} 3D structures through clustering},
313 + volume = {46},
314 + issn = {0305-1048},
315 + url = {https://academic.oup.com/nar/article/46/9/4783/4925243},
316 + doi = {10.1093/nar/gky139},
317 + abstract = {Abstract. As functional components in three-dimensional (3D) conformation of an RNA, the {RNA} structural motifs provide an easy way to associate the molecular a},
318 + language = {en},
319 + number = {9},
320 + urldate = {2018-05-31},
321 + journal = {Nucleic Acids Research},
322 + author = {Ge, Ping and Islam, Shahidul and Zhong, Cuncong and Zhang, Shaojie},
323 + month = may,
324 + year = {2018},
325 + pages = {4783--4793},
326 + file = {Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/8YS7LY6E/Ge et al. - 2018 - De novo discovery of structural motifs in {RNA} 3D s.pdf:application/pdf;Snapshot:/nhome/siniac/lbecquey/Zotero/storage/4TLRV8ZT/4925243.html:text/html}
327 +}
328 +
329 +@article{wang_rna_2018,
330 + title = {{RNA} 3-dimensional structural motifs as a critical constraint of viroid {RNA} evolution},
331 + volume = {14},
332 + issn = {1553-7374},
333 + url = {http://journals.plos.org/plospathogens/article?id=10.1371/journal.ppat.1006801},
334 + doi = {10.1371/journal.ppat.1006801},
335 + language = {en},
336 + number = {2},
337 + urldate = {2018-05-31},
338 + journal = {PLOS Pathogens},
339 + author = {Wang, Ying and Zirbel, Craig L. and Leontis, Neocles B. and Ding, Biao},
340 + month = feb,
341 + year = {2018},
342 + keywords = {Non-coding {RNA} sequences, {RNA} structure, {RNA} viruses, Sequence motif analysis, Viral evolution, Viral replication, Viral structure, Viroids},
343 + pages = {e1006801},
344 + file = {Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/M3P6GCA7/Wang et al. - 2018 - {RNA} 3-dimensional structural motifs as a critical .pdf:application/pdf;Snapshot:/nhome/siniac/lbecquey/Zotero/storage/3YRBKI96/article.html:text/html}
345 +}
346 +
347 +@article{lorenz_viennarna_2011,
348 + title = {{ViennaRNA} {Package} 2.0},
349 + volume = {6},
350 + issn = {1748-7188},
351 + url = {https://doi.org/10.1186/1748-7188-6-26},
352 + doi = {10.1186/1748-7188-6-26},
353 + abstract = {Secondary structure forms an important intermediate level of description of nucleic acids that encapsulates the dominating part of the folding energy, is often well conserved in evolution, and is routinely used as a basis to explain experimental findings. Based on carefully measured thermodynamic parameters, exact dynamic programming algorithms can be used to compute ground states, base pairing probabilities, as well as thermodynamic properties.},
354 + urldate = {2018-05-31},
355 + journal = {Algorithms for Molecular Biology},
356 + author = {Lorenz, Ronny and Bernhart, Stephan H. and Höner zu Siederdissen, Christian and Tafer, Hakim and Flamm, Christoph and Stadler, Peter F. and Hofacker, Ivo L.},
357 + month = nov,
358 + year = {2011},
359 + keywords = {Consensus Structure, Folding Algorithm, Matthews Correlation Coefficient, Minimum Free Energy, Partition Function},
360 + pages = {26},
361 + annote = {Pages 26 in PDF},
362 + file = {Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/WFPBA2H8/Lorenz et al. - 2011 - ViennaRNA Package 2.0.pdf:application/pdf;Snapshot:/nhome/siniac/lbecquey/Zotero/storage/ADNFF9EA/1748-7188-6-26.html:text/html}
363 +}
364 +
365 +@article{janssen_rna_2015,
366 + title = {The {RNA} shapes studio},
367 + volume = {31},
368 + issn = {1367-4803},
369 + url = {https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4308662/},
370 + doi = {10.1093/bioinformatics/btu649},
371 + abstract = {Motivation: Abstract shape analysis, first proposed in 2004, allows one to extract several relevant structures from the folding space of an {RNA} sequence, preferable to focusing in a single structure of minimal free energy. We report recent extensions to this approach., Results: We have rebuilt the original RNAshapes as a repository of components that allows us to integrate several established tools for {RNA} structure analysis: RNAshapes, RNAalishapes and pknotsRG, including its recent extension pKiss. As a spin-off, we obtain heretofore unavailable functionality: e. g. with pKiss, we can now perform abstract shape analysis for structures holding pseudoknots up to the complexity of kissing hairpin motifs. The new tool pAliKiss can predict kissing hairpin motifs from aligned sequences. Along with the integration, the functionality of the tools was also extended in manifold ways., Availability and implementation: As before, the tool is available on the Bielefeld Bioinformatics server at http://bibiserv.cebitec.uni-bielefeld.de/rnashapesstudio., Contact: bibi-help@cebitec.uni-bielefeld.de},
372 + number = {3},
373 + urldate = {2018-05-31},
374 + journal = {Bioinformatics},
375 + author = {Janssen, Stefan and Giegerich, Robert},
376 + month = feb,
377 + year = {2015},
378 + pmid = {25273103},
379 + pmcid = {PMC4308662},
380 + pages = {423--425},
381 + file = {PubMed Central Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/KFQTVDR3/Janssen and Giegerich - 2015 - The {RNA} shapes studio.pdf:application/pdf}
382 +}
383 +
384 +@article{parlea_rna_2016,
385 + series = {Advances in {RNA} {Structure} {Determination}},
386 + title = {The {RNA} 3D {Motif} {Atlas}: {Computational} methods for extraction, organization and evaluation of {RNA} motifs},
387 + volume = {103},
388 + issn = {1046-2023},
389 + shorttitle = {The {RNA} 3D {Motif} {Atlas}},
390 + url = {http://www.sciencedirect.com/science/article/pii/S1046202316301049},
391 + doi = {10.1016/j.ymeth.2016.04.025},
392 + abstract = {RNA 3D motifs occupy places in structured {RNA} molecules that correspond to the hairpin, internal and multi-helix junction “loops” of their secondary structure representations. As many as 40\% of the nucleotides of an {RNA} molecule can belong to these structural elements, which are distinct from the regular double helical regions formed by contiguous AU, GC, and GU Watson-Crick basepairs. With the large number of atomic- or near atomic-resolution 3D structures appearing in a steady stream in the PDB/NDB structure databases, the automated identification, extraction, comparison, clustering and visualization of these structural elements presents an opportunity to enhance {RNA} science. Three broad applications are: (1) identification of modular, autonomous structural units for {RNA} nanotechnology, nanobiology and synthetic biology applications; (2) bioinformatic analysis to improve {RNA} 3D structure prediction from sequence; and (3) creation of searchable databases for exploring the binding specificities, structural flexibility, and dynamics of these {RNA} elements. In this contribution, we review methods developed for computational extraction of hairpin and internal loop motifs from a non-redundant set of high-quality {RNA} 3D structures. We provide a statistical summary of the extracted hairpin and internal loop motifs in the most recent version of the {RNA} 3D Motif Atlas. We also explore the reliability and accuracy of the extraction process by examining its performance in clustering recurrent motifs from homologous ribosomal {RNA} (rRNA) structures. We conclude with a summary of remaining challenges, especially with regard to extraction of multi-helix junction motifs.},
393 + urldate = {2018-05-31},
394 + journal = {Methods},
395 + author = {Parlea, Lorena G. and Sweeney, Blake A. and Hosseini-Asanjan, Maryam and Zirbel, Craig L. and Leontis, Neocles B.},
396 + month = jul,
397 + year = {2016},
398 + keywords = {Hairpin loop, Internal loop, Multi-helix junction loop, Non-Watson-Crick basepair, {RNA} 3D Motif, Structured {RNA} molecules},
399 + pages = {99--119},
400 + file = {ScienceDirect Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/HM9ZDD83/Parlea et al. - 2016 - The {RNA} 3D Motif Atlas Computational methods for .pdf:application/pdf;ScienceDirect Snapshot:/nhome/siniac/lbecquey/Zotero/storage/ANJRICVQ/S1046202316301049.html:text/html}
401 +}
402 +
403 +@article{legendre_bi-objective_2018,
404 + title = {Bi-objective integer programming for {RNA} secondary structure prediction with pseudoknots},
405 + volume = {19},
406 + issn = {1471-2105},
407 + url = {https://doi.org/10.1186/s12859-018-2007-7},
408 + doi = {10.1186/s12859-018-2007-7},
409 + abstract = {RNA structure prediction is an important field in bioinformatics, and numerous methods and tools have been proposed. Pseudoknots are specific motifs of {RNA} secondary structures that are difficult to predict. Almost all existing methods are based on a single model and return one solution, often missing the real structure. An alternative approach would be to combine different models and return a (small) set of solutions, maximizing its quality and diversity in order to increase the probability that it contains the real structure.},
410 + urldate = {2018-05-24},
411 + journal = {BMC Bioinformatics},
412 + author = {Legendre, Audrey and Angel, Eric and Tahi, Fariza},
413 + month = jan,
414 + year = {2018},
415 + keywords = {RNA, Bi-objective, Integer programming, Optimal solutions, Pseudoknot, Secondary structure, Sub-optimal solutions},
416 + pages = {13},
417 + annote = {Pages 13 in PDF},
418 + file = {Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/4YMW5M4S/Legendre et al. - 2018 - Bi-objective integer programming for {RNA} secondary.pdf:application/pdf;Snapshot:/nhome/siniac/lbecquey/Zotero/storage/XP46BMHH/s12859-018-2007-7.html:text/html}
419 +}
420 +
421 +@article{sarver_fr3d:_2008,
422 + title = {{FR}3D: finding local and composite recurrent structural motifs in {RNA} 3D structures},
423 + volume = {56},
424 + issn = {1432-1416},
425 + shorttitle = {{FR}3D},
426 + url = {https://doi.org/10.1007/s00285-007-0110-x},
427 + doi = {10.1007/s00285-007-0110-x},
428 + abstract = {New methods are described for finding recurrent three-dimensional (3D) motifs in {RNA} atomic-resolution structures. Recurrent {RNA} 3D motifs are sets of {RNA} nucleotides with similar spatial arrangements. They can be local or composite. Local motifs comprise nucleotides that occur in the same hairpin or internal loop. Composite motifs comprise nucleotides belonging to three or more different {RNA} strand segments or molecules. We use a base-centered approach to construct efficient, yet exhaustive search procedures using geometric, symbolic, or mixed representations of {RNA} structure that we implement in a suite of MATLAB programs, “Find {RNA} 3D” (FR3D). The first modules of FR3D preprocess structure files to classify base-pair and -stacking interactions. Each base is represented geometrically by the position of its glycosidic nitrogen in 3D space and by the rotation matrix that describes its orientation with respect to a common frame. Base-pairing and base-stacking interactions are calculated from the base geometries and are represented symbolically according to the Leontis/Westhof basepairing classification, extended to include base-stacking. These data are stored and used to organize motif searches. For geometric searches, the user supplies the 3D structure of a query motif which FR3D uses to find and score geometrically similar candidate motifs, without regard to the sequential position of their nucleotides in the {RNA} chain or the identity of their bases. To score and rank candidate motifs, FR3D calculates a geometric discrepancy by rigidly rotating candidates to align optimally with the query motif and then comparing the relative orientations of the corresponding bases in the query and candidate motifs. Given the growing size of the {RNA} structure database, it is impossible to explicitly compute the discrepancy for all conceivable candidate motifs, even for motifs with less than ten nucleotides. The screening algorithm that we describe finds all candidate motifs whose geometric discrepancy with respect to the query motif falls below a user-specified cutoff discrepancy. This technique can be applied to RMSD searches. Candidate motifs identified geometrically may be further screened symbolically to identify those that contain particular basepair types or base-stacking arrangements or that conform to sequence continuity or nucleotide identity constraints. Purely symbolic searches for motifs containing user-defined sequence, continuity and interaction constraints have also been implemented. We demonstrate that FR3D finds all occurrences, both local and composite and with nucleotide substitutions, of sarcin/ricin and kink-turn motifs in the 23S and 5S ribosomal {RNA} 3D structures of the H. marismortui 50S ribosomal subunit and assigns the lowest discrepancy scores to bona fide examples of these motifs. The search algorithms have been optimized for speed to allow users to search the non-redundant {RNA} 3D structure database on a personal computer in a matter of minutes.},
429 + language = {en},
430 + number = {1},
431 + urldate = {2018-10-10},
432 + journal = {Journal of Mathematical Biology},
433 + author = {Sarver, Michael and Zirbel, Craig L. and Stombaugh, Jesse and Mokdad, Ali and Leontis, Neocles B.},
434 + month = jan,
435 + year = {2008},
436 + keywords = {05C85, 92C40},
437 + pages = {215--252}
438 +}
439 +
440 +@article{petrov_webfr3dserver_2011,
441 + title = {{WebFR}3D—a server for finding, aligning and analyzing recurrent {RNA} 3D motifs},
442 + volume = {39},
443 + issn = {0305-1048},
444 + url = {https://academic.oup.com/nar/article/39/suppl_2/W50/2505799},
445 + doi = {10.1093/nar/gkr249},
446 + abstract = {Abstract. WebFR3D is the on-line version of ‘Find {RNA} 3D’ (FR3D), a program for annotating atomic-resolution {RNA} 3D structure files and searching them efficie},
447 + language = {en},
448 + number = {suppl\_2},
449 + urldate = {2018-10-10},
450 + journal = {Nucleic Acids Research},
451 + author = {Petrov, Anton I. and Zirbel, Craig L. and Leontis, Neocles B.},
452 + month = jul,
453 + year = {2011},
454 + pages = {W50--W55},
455 + file = {Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/WVGVFLFH/Petrov et al. - 2011 - WebFR3D—a server for finding, aligning and analyzi.pdf:application/pdf;Snapshot:/nhome/siniac/lbecquey/Zotero/storage/8NMZZLKV/2505799.html:text/html}
456 +}
457 +
458 +@article{petrov_automated_2013,
459 + title = {Automated classification of {RNA} 3D motifs and the {RNA} 3D {Motif} {Atlas}},
460 + volume = {19},
461 + issn = {1355-8382, 1469-9001},
462 + url = {http://rnajournal.cshlp.org/content/19/10/1327},
463 + doi = {10.1261/rna.039438.113},
464 + abstract = {A monthly journal publishing high-quality, peer-reviewed research on all topics related to {RNA} and its metabolism in all organisms},
465 + language = {en},
466 + number = {10},
467 + urldate = {2018-10-10},
468 + journal = {RNA},
469 + author = {Petrov, Anton I. and Zirbel, Craig L. and Leontis, Neocles B.},
470 + month = jan,
471 + year = {2013},
472 + pmid = {23970545},
473 + pages = {1327--1340},
474 + file = {Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/GIC5F2CJ/Petrov et al. - 2013 - Automated classification of {RNA} 3D motifs and the .pdf:application/pdf;Snapshot:/nhome/siniac/lbecquey/Zotero/storage/UJFVEML3/1327.full.html:text/html}
475 +}
476 +
477 +@article{lu_dssr:_2015,
478 + title = {{DSSR}: an integrated software tool for dissecting the spatial structure of {RNA}},
479 + volume = {43},
480 + issn = {0305-1048},
481 + shorttitle = {{DSSR}},
482 + url = {https://academic.oup.com/nar/article/43/21/e142/2468098},
483 + doi = {10.1093/nar/gkv716},
484 + abstract = {Abstract. Insight into the three-dimensional architecture of {RNA} is essential for understanding its cellular functions. However, even the classic transfer RNA},
485 + language = {en},
486 + number = {21},
487 + urldate = {2018-10-09},
488 + journal = {Nucleic Acids Research},
489 + author = {Lu, Xiang-Jun and Bussemaker, Harmen J. and Olson, Wilma K.},
490 + month = dec,
491 + year = {2015},
492 + pages = {e142--e142},
493 + file = {Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/NURMS9UY/Lu et al. - 2015 - DSSR an integrated software tool for dissecting t.pdf:application/pdf;Snapshot:/nhome/siniac/lbecquey/Zotero/storage/BTZXBR6S/2468098.html:text/html}
494 +}
495 +
496 +@article{antczak_rnapdbeewebserver_2014,
497 + title = {{RNApdbee}—a webserver to derive secondary structures from pdb files of knotted and unknotted {RNAs}},
498 + volume = {42},
499 + issn = {0305-1048},
500 + url = {https://academic.oup.com/nar/article/42/W1/W368/2435287},
501 + doi = {10.1093/nar/gku330},
502 + abstract = {Abstract. In {RNA} structural biology and bioinformatics an access to correct {RNA} secondary structure and its proper representation is of crucial importance. Thi},
503 + language = {en},
504 + number = {W1},
505 + urldate = {2018-10-09},
506 + journal = {Nucleic Acids Research},
507 + author = {Antczak, Maciej and Zok, Tomasz and Popenda, Mariusz and Lukasiak, Piotr and Adamiak, Ryszard W. and Blazewicz, Jacek and Szachniuk, Marta},
508 + month = jul,
509 + year = {2014},
510 + pages = {W368--W372},
511 + file = {Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/RWXNJQH6/Antczak et al. - 2014 - RNApdbee—a webserver to derive secondary structure.pdf:application/pdf;Snapshot:/nhome/siniac/lbecquey/Zotero/storage/H6CZVH4F/2435287.html:text/html}
512 +}
513 +
514 +
515 +@article{dirksAlgorithmComputingNucleic2004,
516 + title = {An Algorithm for Computing Nucleic Acid Base-Pairing Probabilities Including Pseudoknots},
517 + volume = {25},
518 + copyright = {Copyright \textcopyright{} 2004 Wiley Periodicals, Inc.},
519 + issn = {1096-987X},
520 + doi = {10.1002/jcc.20057},
521 + abstract = {Given a nucleic acid sequence, a recent algorithm allows the calculation of the partition function over secondary structure space including a class of physically relevant pseudoknots. Here, we present a method for computing base-pairing probabilities starting from the output of this partition function algorithm. The approach relies on the calculation of recursion probabilities that are computed by backtracking through the partition function algorithm, applying a particular transformation at each step. This transformation is applicable to any partition function algorithm that follows the same basic dynamic programming paradigm. Base-pairing probabilities are useful for analyzing the equilibrium ensemble properties of natural and engineered nucleic acids, as demonstrated for a human telomerase {RNA} and a synthetic DNA nanostructure. \textcopyright{} 2004 Wiley Periodicals, Inc. J Comput Chem 25: 1295\textendash{}1304, 2004},
522 + language = {en},
523 + number = {10},
524 + journal = {Journal of Computational Chemistry},
525 + author = {Dirks, Robert M. and Pierce, Niles A.},
526 + year = {2004},
527 + keywords = {pseudoknots,RNA,DNA,base-pairing probabilities,partition function},
528 + pages = {1295-1304},
529 + file = {/nhome/siniac/lbecquey/Zotero/storage/LA8RHBVN/jcc.html}
530 +}
531 +
532 +
533 +@article{laing_computational_2010,
534 + title = {Computational approaches to 3D modeling of {RNA}},
535 + volume = {22},
536 + issn = {0953-8984},
537 + url = {http://stacks.iop.org/0953-8984/22/i=28/a=283101},
538 + doi = {10.1088/0953-8984/22/28/283101},
539 + abstract = {Many exciting discoveries have recently revealed the versatility of {RNA} and its importance in a variety of functions within the cell. Since the structural features of {RNA} are of major importance to their biological function, there is much interest in predicting {RNA} structure, either in free form or in interaction with various ligands, including proteins, metabolites and other molecules. In recent years, an increasing number of researchers have developed novel {RNA} algorithms for predicting {RNA} secondary and tertiary structures. In this review, we describe current experimental and computational advances and discuss recent ideas that are transforming the traditional view of {RNA} folding. To evaluate the performance of the most recent {RNA} 3D folding algorithms, we provide a comparative study in order to test the performance of available 3D structure prediction algorithms for an {RNA} data set of 43 structures of various lengths and motifs. We find that the algorithms vary widely in terms of prediction quality across different {RNA} lengths and topologies; most predictions have very large root mean square deviations from the experimental structure. We conclude by outlining some suggestions for future {RNA} folding research.},
540 + language = {en},
541 + number = {28},
542 + urldate = {2018-10-09},
543 + journal = {Journal of Physics: Condensed Matter},
544 + author = {Laing, Christian and Schlick, Tamar},
545 + year = {2010},
546 + pages = {283101}
547 +}
548 +
549 +@article{dawson_computational_2016,
550 + series = {Theory and simulation • {Macromolcular} machines},
551 + title = {Computational modeling of {RNA} 3D structures and interactions},
552 + volume = {37},
553 + issn = {0959-440X},
554 + url = {http://www.sciencedirect.com/science/article/pii/S0959440X15001700},
555 + doi = {10.1016/j.sbi.2015.11.007},
556 + abstract = {RNA molecules have key functions in cellular processes beyond being carriers of protein-coding information. These functions are often dependent on the ability to form complex three-dimensional (3D) structures. However, experimental determination of {RNA} 3D structures is difficult, which has prompted the development of computational methods for structure prediction from sequence. Recent progress in 3D structure modeling of {RNA} and emerging approaches for predicting {RNA} interactions with ions, ligands and proteins have been stimulated by successes in protein 3D structure modeling.},
557 + urldate = {2018-10-09},
558 + journal = {Current Opinion in Structural Biology},
559 + author = {Dawson, Wayne K and Bujnicki, Janusz M},
560 + month = apr,
561 + year = {2016},
562 + pages = {22--28},
563 + file = {ScienceDirect Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/7V5SQ8PN/Dawson et Bujnicki - 2016 - Computational modeling of {RNA} 3D structures and in.pdf:application/pdf;ScienceDirect Snapshot:/nhome/siniac/lbecquey/Zotero/storage/CDMTYU7W/S0959440X15001700.html:text/html}
564 +}
565 +
566 +@article{laing_computational_2011,
567 + title = {Computational approaches to {RNA} structure prediction, analysis, and design},
568 + volume = {21},
569 + issn = {0959-440X},
570 + url = {http://www.sciencedirect.com/science/article/pii/S0959440X11000674},
571 + doi = {10.1016/j.sbi.2011.03.015},
572 + abstract = {RNA molecules are important cellular components involved in many fundamental biological processes. Understanding the mechanisms behind their functions requires {RNA} tertiary structure knowledge. Although modeling approaches for the study of {RNA} structures and dynamics lag behind efforts in protein folding, much progress has been achieved in the past two years. Here, we review recent advances in {RNA} folding algorithms, {RNA} tertiary motif discovery, applications of graph theory approaches to {RNA} structure and function, and in silico generation of {RNA} sequence pools for aptamer design. Advances within each area can be combined to impact many problems in {RNA} structure and function.},
573 + number = {3},
574 + urldate = {2018-10-09},
575 + journal = {Current Opinion in Structural Biology},
576 + author = {Laing, Christian and Schlick, Tamar},
577 + month = jun,
578 + year = {2011},
579 + pages = {306--318},
580 + file = {ScienceDirect Snapshot:/nhome/siniac/lbecquey/Zotero/storage/LWS5RU5Z/S0959440X11000674.html:text/html}
581 +}
582 +
583 +
584 +@article{reinharz2018mining,
585 + title={Mining for recurrent long-range interactions in {RNA} structures reveals embedded hierarchies in network families},
586 + author={Reinharz, Vladimir and Soul{\'e}, Antoine and Westhof, Eric and Waldisp{\"u}hl, J{\'e}r{\^o}me and Denise, Alain},
587 + journal={Nucleic Acids Research},
588 + volume={46},
589 + number={8},
590 + pages={3841--3851},
591 + year={2018},
592 + publisher={Oxford University Press}
593 +}
594 +
595 +@article{sato_ipknot:_2011,
596 + title = {{IPknot}: fast and accurate prediction of {RNA} secondary structures with pseudoknots using integer programming},
597 + volume = {27},
598 + issn = {1367-4803},
599 + shorttitle = {{IPknot}},
600 + url = {https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3117384/},
601 + doi = {10.1093/bioinformatics/btr215},
602 + abstract = {Motivation: Pseudoknots found in secondary structures of a number of functional RNAs play various roles in biological processes. Recent methods for predicting {RNA} secondary structures cover certain classes of pseudoknotted structures, but only a few of them achieve satisfying predictions in terms of both speed and accuracy., Results: We propose IPknot, a novel computational method for predicting {RNA} secondary structures with pseudoknots based on maximizing expected accuracy of a predicted structure. IPknot decomposes a pseudoknotted structure into a set of pseudoknot-free substructures and approximates a base-pairing probability distribution that considers pseudoknots, leading to the capability of modeling a wide class of pseudoknots and running quite fast. In addition, we propose a heuristic algorithm for refining base-paring probabilities to improve the prediction accuracy of IPknot. The problem of maximizing expected accuracy is solved by using integer programming with threshold cut. We also extend IPknot so that it can predict the consensus secondary structure with pseudoknots when a multiple sequence alignment is given. IPknot is validated through extensive experiments on various datasets, showing that IPknot achieves better prediction accuracy and faster running time as compared with several competitive prediction methods., Availability: The program of IPknot is available at http://www.ncrna.org/software/ipknot/. IPknot is also available as a web server at http://rna.naist.jp/ipknot/., Contact: satoken@k.u-tokyo.ac.jp; ykato@is.naist.jp, Supplementary information: Supplementary data are available at Bioinformatics online.},
603 + number = {13},
604 + urldate = {2018-10-12},
605 + journal = {Bioinformatics},
606 + author = {Sato, Kengo and Kato, Yuki and Hamada, Michiaki and Akutsu, Tatsuya and Asai, Kiyoshi},
607 + month = jul,
608 + year = {2011},
609 + pmid = {21685106},
610 + pmcid = {PMC3117384},
611 + pages = {i85--i93},
612 + file = {Texte intégral:/nhome/siniac/lbecquey/Zotero/storage/EEWT77EA/Sato et al. - 2011 - IPknot fast and accurate prediction of {RNA} second.pdf:application/pdf}
613 +}
614 +
615 +
616 +@article{zirbel_identifying_2015,
617 + title = {Identifying novel sequence variants of {RNA} 3D motifs},
618 + volume = {43},
619 + issn = {0305-1048},
620 + url = {https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4551918/},
621 + doi = {10.1093/nar/gkv651},
622 + abstract = {Predicting {RNA} 3D structure from sequence is a major challenge in biophysics. An important sub-goal is accurately identifying recurrent 3D motifs from {RNA} internal and hairpin loop sequences extracted from secondary structure (2D) diagrams. We have developed and validated new probabilistic models for 3D motif sequences based on hybrid Stochastic Context-Free Grammars and Markov Random Fields (SCFG/MRF). The SCFG/MRF models are constructed using atomic-resolution {RNA} 3D structures. To parameterize each model, we use all instances of each motif found in the {RNA} 3D Motif Atlas and annotations of pairwise nucleotide interactions generated by the FR3D software. Isostericity relations between non-Watson–Crick basepairs are used in scoring sequence variants. SCFG techniques model nested pairs and insertions, while MRF ideas handle crossing interactions and base triples. We use test sets of randomly-generated sequences to set acceptance and rejection thresholds for each motif group and thus control the false positive rate. Validation was carried out by comparing results for four motif groups to RMDetect. The software developed for sequence scoring (JAR3D) is structured to automatically incorporate new motifs as they accumulate in the {RNA} 3D Motif Atlas when new structures are solved and is available free for download.},
623 + number = {15},
624 + urldate = {2018-10-19},
625 + journal = {Nucleic Acids Research},
626 + author = {Zirbel, Craig L. and Roll, James and Sweeney, Blake A. and Petrov, Anton I. and Pirrung, Meg and Leontis, Neocles B.},
627 + month = sep,
628 + year = {2015},
629 + pmid = {26130723},
630 + pmcid = {PMC4551918},
631 + pages = {7504--7520},
632 + file = {PubMed Central Full Text PDF:/nhome/siniac/lbecquey/Zotero/storage/C68JKL5J/Zirbel et al. - 2015 - Identifying novel sequence variants of {RNA} 3D moti.pdf:application/pdf}
633 +}
634 +
635 +
636 +@software{cplex,
637 + author = {IBM ILOG},
638 + title = {{CPLEX}: {CPLEX} {Optimizer} (Academic license)},
639 + version = {12.8},
640 + howpublished = {https://www.ibm.com/analytics/optimization-modeling-interfaces},
641 + year = {2018}
642 +}
643 +
644 +@article{leontis2001geometric,
645 + title={Geometric nomenclature and classification of {RNA} base pairs},
646 + author={Leontis, Neocles B and Westhof, Eric},
647 + journal={Rna},
648 + volume={7},
649 + number={4},
650 + pages={499--512},
651 + year={2001},
652 + publisher={Cambridge University Press}
653 +}
654 +
655 +@article{sarrazin2019automated,
656 + title={Automated, customizable and efficient identification of 3D base pair modules with BayesPairing},
657 + author={Sarrazin-Gendron, Roman and Reinharz, Vladimir and Oliver, Carlos G and Moitessier, Nicolas and Waldisp{\"u}hl, J{\'e}r{\^o}me},
658 + journal={Nucleic acids research},
659 + year={2019}
660 +}
661 +
662 +@article{schlick2018adventures,
663 + title={Adventures with {RNA} graphs},
664 + author={Schlick, Tamar},
665 + journal={Methods},
666 + year={2018},
667 + publisher={Elsevier}
668 +}
669 +
670 +@article{chojnowski2014rna,
671 + title={RNA Bricks—a database of {RNA} 3D motifs and their interactions},
672 + author={Chojnowski, Grzegorz and Wale{\'n}, Tomasz and Bujnicki, Janusz M},
673 + journal={Nucleic acids research},
674 + volume={42},
675 + number={D1},
676 + pages={D123--D131},
677 + year={2014},
678 + publisher={Oxford University Press}
679 +}
680 +
681 +@article{gendron2001quantitative,
682 + title={Quantitative analysis of nucleic acid three-dimensional structures},
683 + author={Gendron, Patrick and Lemieux, S{\'e}bastien and Major, Fran{\c{c}}ois},
684 + journal={Journal of molecular biology},
685 + volume={308},
686 + number={5},
687 + pages={919--936},
688 + year={2001},
689 + publisher={Elsevier}
690 +}
...\ No newline at end of file ...\ No newline at end of file
1 +\documentclass{article}
2 +\usepackage[utf8]{inputenc}
3 +\usepackage{amsmath}
4 +\usepackage{stmaryrd} % llbracket, rrbracket
5 +\usepackage{siunitx} % SI units
6 +\usepackage{geometry}
7 +\usepackage{charter} % betterfont
8 +
9 +\geometry{top=1.5cm,bottom=1.5cm, left=2cm, right=2cm}
10 +
11 +\begin{document}
12 +
13 +\appendix
14 +\section{Linear constraints to model RNA Structure in a linear integer program}
15 +The constraints have been rewritten by us, but are inspired by works like IPknot, Biokop, and RNA-MoIP.
16 +
17 +\paragraph{Extended notations} ~ Here we repeat the definition of the variables that we already used in the article, and we use a few more, that also are defined:\\
18 +Let $n$ be the number of nucleotides in the query RNA sequence $s$.\\
19 +Let $M$ be the set of modules that could be inserted in $s$.\\
20 +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 for that motif inserted at a particular position.\\
21 +Let $P_{x,i}$ be the position in $s$ where we can insert the $i$th component of module $x$.\\
22 +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.\\
23 +Let $k_{x,i}$ be the size in nucleotides of that $i$th component of $x$.\\
24 +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$.\\
25 +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}$.
26 +
27 +
28 +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_{vu}$ for the same pair.
29 +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$.
30 +Regarding the $C^x_i$, if we have an average insertion of $\nu$ motives by RNA sequence, the motives having in average $\mu$ components, components that can be inserted in average at $\pi$ different positions in $s$,
31 +then we need to add, in average, $\nu \times \mu \times \pi$ decision variables $C^x_i$.
32 +
33 +Then, we expect having around $\frac{1}{2}n^2+\nu \mu \pi$ decision variables.
34 +
35 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36 +\paragraph{Constraint to ensure there only is 0 or 1 canonical pairing by nucleotide} ~
37 +\begin{equation} \label{constraint:1}
38 + \sum_{v<u} y^v_u + \sum_{v>u} y^u_v \leq 1 \qquad\qquad \forall u \in \llbracket 1,n \rrbracket
39 +\end{equation}
40 +
41 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42 +\paragraph{Constraints to forbid lonely base pairs} ~
43 +% \begin{equation} \label{constraint:2}
44 +% \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
45 +% \end{equation}
46 +% \begin{equation} \label{constraint:3}
47 +% \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
48 +% \end{equation}
49 +% These conditions ensure that if a base pair exists with $s[i]$,
50 +% one of the adjacent bases is paired too.
51 +% Equation \ref{constraint:2} is useful if $s[u]$ is paired with $s[v>u]$ (a nucleotide later in the sequence),
52 +% and equation \ref{constraint:3} if $s[v]$ is paired with $s[u<v]$ (a nucleotide earlier in the sequence).
53 +\begin{equation} \label{constraint:2}
54 + 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 \}
55 +\end{equation}
56 +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
57 +the only decision variables kept are those with probability above a $\theta$ threshold.
58 +Then, this condition sets to zero "lonely decision variables" who have no neighbour basepair variable allowed.
59 +
60 +
61 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
62 +\paragraph{Constraint to forbid pairings inside a module component} ~
63 +\begin{equation} \label{constraint:4}
64 + (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)
65 + \qquad \qquad \forall x \in M, i \in \llbracket 1,\|x\| \rrbracket
66 +\end{equation}
67 +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.
68 +
69 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
70 +\paragraph{Constraint to forbid component to overlap} ~
71 +\begin{equation} \label{constraint:5}
72 + \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
73 +\end{equation}
74 +$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.
75 +
76 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77 +\paragraph{Constraints to respect the structure of large motives ($\{ x\in M \; | \; \|x\| \geq 2\}$)} ~
78 +
79 +This constraint ensures that none or all the components of a motif are inserted.
80 +\begin{equation}\label{constraint:6}
81 + \sum_{i=2}^{\|x\|} C^x_i = (\|x\| - 1) \times C^{x}_{1} \qquad \qquad \forall x \in \{ x\in M \; | \; \|x\| \geq 2\}
82 +\end{equation}
83 +
84 +And then, we force base pairs between the end of a component and the beginning of the next one:
85 +\begin{equation}\label{constraint:7}
86 + 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\}
87 +\end{equation}
88 +\begin{equation}\label{constraint:8}
89 + 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
90 +\end{equation}
91 +
92 +Constraint \ref{constraint:7} binds the first nucleotide of first component to the last one of the last component.
93 +Constraint \ref{constraint:8} binds the last nucleotide of component $j$ to the first of component $j+1$.
94 +
95 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
96 +\paragraph{Facultative constraint to forbid pseudoknots} ~
97 +\begin{equation}\label{constraint:9}
98 + 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
99 +\end{equation}
100 +
101 +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$).
102 +
103 +
104 +
105 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
106 +\paragraph{Constraint to forbid a previously found solution} ~
107 +
108 +As several solutions may result in the same values of the two objectives, we can't forbid the algorithm to search twice the same region of the objective landscape.
109 +We have to explicitly forbid to find again every found solution.\\
110 +We do it by adding iteratively, for every structure $s^*$ found, the following condition :
111 +\begin{equation}\label{constraint:10}
112 + \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 +
113 + \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
114 +\end{equation}
115 +
116 +It ensures that at least one of the decision variables differs from $s^*$.
117 +\end{document}
...\ No newline at end of file ...\ No newline at end of file