3 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
4 * Copyright (C) $$Year-Rel$$ The Jalview Authors
6 * This file is part of Jalview.
8 * Jalview is free software: you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation, either version 3
11 * of the License, or (at your option) any later version.
13 * Jalview is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 * PURPOSE. See the GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
20 * The Jalview Authors are detailed in the 'AUTHORS' file.
22 <title>Command Line: argument files</title>
25 <h1>Command Line: argument files</h1>
28 <a href="clarguments.html">Command Line: summary</a>
30 <a href="clarguments-intro.html">Command Line: introduction</a>
32 <a href="clarguments-basic.html">Command Line: basic usage</a>
34 <a href="clarguments-advanced.html">Command Line: advanced usage</a>
36 Command Line: argument files
42 <li><a href="#argumentfiles">Argument files</a></li>
43 <li><a href="#onlyargumentfiles">Only argument files</a></li>
44 <li><a href="#evenmoresubstitutions">Even more substitutions</a></li>
47 <h2><a name="argumentfiles"></a>Argument files</h2>
50 If you want to save a set of arguments to reuse, you can save them in a text file, say <code>argfile.txt</code>, and read them into Jalview with
52 jalview --argfile=argfile.txt
57 The argument file has one argument and value per line, still using the double-dash ('--') before the argument name, and separating the argument and value with an equals sign ('=').
59 Because the argument file is read by the application and not read by the shell, you do not need to escape any values -- all spaces will be read as part of the value until the end of the line.
61 You can add comments to a line by starting the line with an octothorpe (hash, pound-sign '#').
67 File <code>argfile.txt</code>
75 --open=[nowrap,colour=gecos-flower,showannotations]examples/plantfdx.fa
76 --features=examples/plantfdx.features
77 --annotations=examples/plantfdx.annotations
78 --image=images/alignment.png
81 # let's see what's happening
89 Because <code>--argfiles</code> takes a filename argument, and multiple <code>--argfiles</code> can be read on the command line, you can also use file globs to specify multiple <code>--argfile</code> values. If you produce an argument file for each set of alignment files that you wish to associate then you can act on all of them with, e.g.
91 jalview --argfile=*/argfile.txt --headless
96 You can even read argument files from within argument files, e.g.
98 jalview --argfile=argfile*.txt --headless
101 <tr><td>File <code>argfile1.txt</code></td></tr>
104 --argfile=myfavouriteformattingargfile.txt
105 --argfile=mysecondfavouriteimageargfile.txt</pre></td></tr>
106 <tr><td>File <code>myfavouriteformattingargfile.txt</code></td></tr>
110 --annotations={dirname}/{basename}.annots</pre></td></tr>
111 <tr><td>File <code>mysecondfavouriteimageargfile.txt</code></td></tr>
113 --image=images/{basename}.png
115 --height=1080</pre></td></tr>
120 If a "loop" of argument files is detected then Jalview will refuse to play (which is a Good Thing).
124 <h2><a name="onlyargumentfiles"></a>Only argument files</h2>
127 When you use an <code>--argfile</code> argument, all other non-initialising arguments on the command line <em>will be ignored</em>. Only the initialising arguments and any and all <code>--argfiles</code> arguments on the command line will be used. You can also set initialising arguments in argument files.
131 <h2><a name="evenmoresubstitutions"></a>Even more substitutions</h2>
134 When adding values that can use substitutions within argument files, there are two additional substitutions that are made:
136 <code>{argfilebasename}</code> - replaced with the base of the filename of the argument file (i.e. without directory path or file extension).
138 <code>{argfiledirname}</code> - replaced with the path to the filename of the argument file.
142 Another amusing substitution you can make in argument files is the <code>{n}</code> substitution, combined with an <code>-npp</code> increment at the start (or end) of the argument file, which gives the potential of having multiple argument files with the exact same content, or even re-using the same argument file multiple times. e.g.
145 <tr><td>File <code>alignment.argfile</code></td></tr>
147 --open={argfilebasename}-{n}.fa
149 --output={basename}.stk
151 --npp</pre></td></tr>
154 jalview --argfile alignment.argfile --argfile alignment.argfile --headless
156 would be processed like
158 jalview --open=alignment-0.fa --wrap --output=alignment-0.stk --close --open=alignment-1.fa --wrap --output=alignment-1.stk --close --headless
164 Return to <a href="clarguments.html">Command Line: summary</a>.