Merge branch 'develop' into patch/JAL-4281_idwidthandannotHeight_in_project
[jalview.git] / help / help / html / features / clarguments-basic.html
1 <html>
2 <!--
3  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
4  * Copyright (C) $$Year-Rel$$ The Jalview Authors
5  * 
6  * This file is part of Jalview.
7  * 
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.
12  *  
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.
17  * 
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.
21  -->
22 <title>Command Line: basic usage</title>
23 <body>
24
25   <h1>Command Line: basic usage</h1>
26
27   <p>
28   <a href="clarguments.html">Command Line: introduction</a>
29   <br/>
30   Command Line: basic usage
31   <br/>
32   <a href="clarguments-advanced.html">Command Line: advanced usage</a>
33   <br/>
34   <a href="clarguments-argfiles.html">Command Line: argument files</a>
35   <br/>
36   <a href="clarguments-reference.html">Command Line: reference</a>
37   </p>
38
39   <hr/>
40
41   <ul>
42   <li><a href="#openingalignments">Opening alignments</a></li>
43   <li><a href="#alignmentoptions">Alignment options</a></li>
44   <li><a href="#adding3dstructures">Adding 3D structures</a></li>
45   <li><a href="#outputtingalignmentfiles">Outputting/converting alignment files and images</a></li>
46   <li><a href="#filenamesubstitutionsandbatchprocessing">Filename substitutions and batch processing</a></li>
47   <li><a href="#alloutputwildcard">The all output wildcard</a></li>
48   </ul>
49
50   <h2><a name="openingalignments"></a>Opening alignments (<code>&#8209;&#8209;open</code>, <code>&#8209;&#8209;append</code>, <code>&#8209;&#8209;new</code>)</h2>
51
52   <p>
53   To simply open one or more alignment files in different alignment windows just put the filenames as the first arguments:
54   <pre>
55   jalview filename1 filename2 ...
56   </pre>
57   </p>
58
59   <p>
60   You can use shell-expanded wildcards:
61   <pre>
62   jalview this/filename* that/filename* other/filename*
63   </pre>
64   and URLs:
65   <pre>
66   jalview https://rest.uniprot.org/uniprotkb/P00221.fasta
67   </pre>
68   </p>
69
70   <p>
71   (Using initial filenames is the same as using the <code>&#8209;&#8209;open</code> argument, and further arguments can be used
72   after the initial filenames.)
73   </p>
74
75   <h3><a name="open"></a><code>&#8209;&#8209;open</code></h3>
76
77   <p>
78   Use the <code>&#8209;&#8209;open</code> argument to open alignment files each in their own window.
79   </p>
80
81   <p>
82   The following are equivalent:
83   <pre>
84   jalview --open filename1 filename2 ...
85
86   jalview --open filename*
87
88   jalview --open filename1 --open filename2 --open ...
89
90   jalview filename1 filename2 ...
91   </pre>
92   </p>
93
94   <p>
95   Similarly you can open URLs:
96   <pre>
97   jalview --open https://rest.uniprot.org/uniprotkb/P00221.fasta
98   </pre>
99   </p>
100
101   <h3><a name="append"></a><code>&#8209;&#8209;append</code></h3>
102
103   <p>
104   To append several alignment files together use:
105   <pre>
106   jalview --open filename1.fa --append filename2.fa filename3.fa
107   </pre>
108   or, if you haven't previously used <code>&#8209;&#8209;open</code> then you can use --append to open one new window and keep appending each set of alignments:
109   <pre>
110   jalview --append these/filename*.fa --append more/filename*.fa
111
112   jalview --append https://rest.uniprot.org/uniprotkb/P00221.fasta https://www.uniprot.org/uniprotkb/A0A0K9QVB3/entry
113   </pre>
114   </p>
115
116   <p>
117   <strong>Note</strong> that whilst you can include a Jalview Project File (<code>.jvp</code>) as an <code>&#8209;&#8209;append</code> value, the items in the file will always open in their original windows and not append to another.
118   </p>
119
120   <h3><a name="new"></a><code>&#8209;&#8209;new</code></h3>
121
122   <p>
123   To append different sets of alignment files in different windows, use <code>&#8209;&#8209;new</code> to move on to a new alignment window:
124   <pre>
125   jalview --append these/filename*.fa --new --append other/filename*.fa
126   </pre>
127   </p>
128
129   <p>
130   <code>&#8209;&#8209;open</code> is like using <code>&#8209;&#8209;new --append</code> applied to every filename/URL given to <code>&#8209;&#8209;open</code>
131   </p>
132
133
134   <h2><a name="alignmentoptions"></a>Alignment options (<code>&#8209;&#8209;colour</code>, <code>&#8209;&#8209;wrap</code>, <code>&#8209;&#8209;showannotations</code>, <code>&#8209;&#8209;title</code>)</h2>
135
136   <p>
137   An opened alignment window (or set of opened alignment windows) can be modified in its appearance using the following arguments before the next <code>&#8209;&#8209;open</code> argument.  These modifying arguments apply to the one or more files that were opened with the preceding <code>&#8209;&#8209;open</code> argument.  E.g. <code>&#8209;&#8209;open file.fa --colour gecos-flower</code> will colour the one alignment window with <code>file.fa</code>.  However, <code>&#8209;&#8209;open *.fa --colour gecos-flower</code> will colour every alignment window matching <code>file*.fa</code>, and <code> --open file1.fa file2.fa --colour gecos-flower</code>
138   will colour both opened alignment windows.
139   </p>
140
141   <h3><a name="colour"></a><code>&#8209;&#8209;colour</code></h3>
142
143   <p>
144   You can specify a residue/base colouring for the alignment using the <code>&#8209;&#8209;colour</code> option (note spelling -- Jalview is made in Scotland!):
145   <pre>
146   jalview --open examples/uniref50.fa --colour gecos-flower
147   </pre>
148   There are several colour schemes that you can use.  See the <a href="../colourSchemes/index.html">page on Colour Schemes</a> for details.
149   The names to use on the command line for colour schemes are:
150   </p>
151   <p>
152   <code>clustal</code>,
153   <br/>
154   <code>blosum62</code>,
155   <br/>
156   <code>pc-identity</code>,
157   <br/>
158   <code>zappo</code>,
159   <br/>
160   <code>taylor</code>,
161   <br/>
162   <code>gecos-flower</code>,
163   <br/>
164   <code>gecos-blossom</code>,
165   <br/>
166   <code>gecos-sunset</code>,
167   <br/>
168   <code>gecos-ocean</code>,
169   <br/>
170   <code>hydrophobic</code>,
171   <br/>
172   <code>helix-propensity</code>,
173   <br/>
174   <code>strand-propensity</code>,
175   <br/>
176   <code>turn-propensity</code>,
177   <br/>
178   <code>buried-index</code>,
179   <br/>
180   <code>nucleotide</code>,
181   <br/>
182   <code>nucleotide-ambiguity</code>,
183   <br/>
184   <code>purine-pyrimidine</code>,
185   <br/>
186   <code>rna-helices</code>,
187   <br/>
188   <code>t-coffee-scores</code>,
189   <br/>
190   <code>sequence-id</code>
191   </p>
192
193   <h3><a name="wrap"></a><code>&#8209;&#8209;wrap</code></h3>
194   <p>
195   An alignment should open with your usual preferences stored in the <code>.jalview_properties</code> file.  To open an alignment with the sequences (definitely) wrapped, following your <code>&#8209;&#8209;open</code> (or first <code>&#8209;&#8209;append</code>) argument use the argument <code>&#8209;&#8209;wrap</code>:
196   <pre>
197   jalview --open examples/uniref50.fa --wrap
198   </pre>
199   To ensure an alignment is not wrapped use <code>&#8209;&#8209;nowrap</code>:
200   <pre>
201   jalview --open examples/uniref50.fa --nowrap
202   </pre>
203   </p>
204
205   <h3><a name="showannotations"></a><code>&#8209;&#8209;showannotations</code> / <code>&#8209;&#8209;noshowannotations</code></h3>
206
207   <p>
208   You can specify whether the currently opened alignment window should show alignment annotations (e.g. Conservation, Quality, Consensus...) or not with either <code>&#8209;&#8209;showannotations</code> or <code>&#8209;&#8209;noshowannotations</code>.  If you don't specify then your saved preference will be used.
209   <pre>
210   jalview --open examples/uniref50.fa --noshowannotations
211   </pre>
212   </p>
213
214   <h3><a name="title"></a><code>&#8209;&#8209;title</code></h3>
215
216   <p>
217   If you would like to give the alignment window a specific title you can do so with the <code>&#8209;&#8209;title</code> option:
218   <pre>
219   jalview --open examples/uniref50.fa --title "My example alignment"
220   </pre>
221   </p>
222
223
224
225
226   <h2><a name="adding3dstructures"></a>Adding 3D structures (<code>&#8209;&#8209;structure</code>, <code>&#8209;&#8209;seqid</code>, <code>&#8209;&#8209;structureviewer</code>, <code>&#8209;&#8209;paematrix</code>, <code>&#8209;&#8209;tempfac</code>, <code>&#8209;&#8209;showssannotations</code>)</h2>
227
228   <p>
229   </p>
230
231   <h3><a name="structure"></a><code>&#8209;&#8209;structure</code></h3>
232
233   <p>
234   You can add a 3D structure file to a sequence in the current alignment window with the <code>&#8209;&#8209;structure</code> option:
235   <pre>
236   jalview --open examples/uniref50.fa --structure examples/AlphaFold/AF-P00221-F1-model_v4.pdb
237   </pre>
238   By default this attaches to the first sequence in the alignment but most likely you will want to attach it to a specific sequence.
239   </p>
240
241   <h3><a name="seqid"></a><code>&#8209;&#8209;seqid</code></h3>
242
243   <p>
244   The easiest way to specify a sequence ID for your structure is to follow the <code>&#8209;&#8209;structure</code> argument with a <code>&#8209;&#8209;seqid</code> argument with a value of a sequence ID in the alignment.  This does of course require some knowledge of the sequences in the alignment files
245   that have been opened.
246   <br/>
247   Alternatively you can specify a <em>sub-value</em> with the <code>&#8209;&#8209;structure</code> argument value.  You do this by preceding the value with square brackets and <code>seqid=SequenceId</code>,
248   like this:
249   <pre>
250   jalview --open examples/uniref50.fa --structure [seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.pdb
251   </pre>
252   which is equivalent to
253   <pre>
254   jalview --open examples/uniref50.fa --structure examples/AlphaFold/AF-P00221-F1-model_v4.pdb --seqid FER1_SPIOL
255   </pre>
256   </p>
257
258   <p>
259   The sub-value <code>seqid=FER1_SPIOL</code> takes precedence over the following argument <code>&#8209;&#8209;seqid FER1_SPIOL</code> if you accidentally specify both (in which case the argument will probably be completely unused).
260   </p>
261
262   <p>
263   If you don't know the sequence IDs but do know the position of the sequence in the alignment, you can also specify an <em>INDEX</em>
264   in the sub-values to indicate which sequence in the alignment to attach the sequence to (although this is less precise).  This is a zero-indexed value, so to specify the eighth sequence in the alignment use:
265   <pre>
266   jalview --open examples/uniref50.fa --structure [7]examples/AlphaFold/AF-P00221-F1-model_v4.pdb
267   </pre>
268
269   <p>
270   Remember that you might need to escape any spaces in the sequence ID or enclose the ID in quotation marks.
271   </p>
272
273   <h3><a name="structureviewer"></a><code>&#8209;&#8209;structureviewer</code></h3>
274
275   <p>
276   You can specify which structure viewer (or none) to use to open the structure using either the <code>&#8209;&#8209;structureviewer</code> argument or the <code>structureviewer</code> sub-value.  Multiple sub-values can be specified together, separated by a comma ','.  Possible values for the <code>structureviewer</code> are:
277   <br/>
278   <code>none</code>,
279   <br/>
280   <code>jmol</code>,
281   <br/>
282   <code>chimera</code>,
283   <br/>
284   <code>chimerax</code>,
285   <br/>
286   <code>pymol</code>.
287   </p>
288   <p>
289   <code>none</code> and <code>jmol</code> will always be available, but to use the others you must have the appropriate software already set up on your computer and in Jalview.  See the page <a href="../features/viewingpdbs.html">Discovering and Viewing PDB and 3D-Beacons structures</a> for more details.
290   <pre>
291   jalview --open examples/uniref50.fa --structure [seqid=FER1_SPIOL,structureviewer=none]examples/AlphaFold/AF-P00221-F1-model_v4.pdb
292   </pre>
293   or, if you prefer
294   <pre>
295   jalview --open examples/uniref50.fa --structure examples/AlphaFold/AF-P00221-F1-model_v4.pdb --seqid FER1_SPIOL --structureviewer none
296   </pre>
297   </p>
298
299   <h3><a name="paematrix"></a><code>&#8209;&#8209;paematrix</code></h3>
300
301   <p>
302   If you are opening a structure file that has a PAE matrix (provided as a JSON file), such as from an AlphaFold model or an nf-core pipeline, you can add the PAE matrix as an annotation by following the <code>&#8209;&#8209;structure</code> argument with a <code>&#8209;&#8209;paematrix</code> argument with the filename.  You can also specify a <code>paematrix=filename</code> sub-value.
303   <pre>
304   jalview --open examples/uniref50.fa --structure [seqid=FER1+SPIOL,structureviewer=pymol]examples/AlphaFold/AF-P00221-F1-model_v4.pdb --paematrix examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json
305   </pre>
306   </p>
307
308   <h3><a name="tempfac"></a><code>&#8209;&#8209;tempfac</code></h3>
309
310   <p>
311   Structure files may have a temperature factor associated with the structure component positions.  If the temperature factor is a pLDDT confidence score, such as with an AlphaFold model, you can specify this by using a following argument of <code>&#8209;&#8209;tempfac</code> with a value of <code>plddt</code>.  This will enable standard pLDDT colouring of the temperature factor annotation.  Valid values are:
312   <code>default</code>,
313   <code>plddt</code>.
314   More types of temperature factor may be added in future releases of Jalview.
315   <br/>
316   The value can also be specified as a sub-value:
317   <pre>
318   jalview --open examples/uniref50.fa --structure [seqid=FER1_SPIOL,structureviewer=jmol,tempfac=plddt]examples/AlphaFold/AF-P00221-F1-model_v4.pdb
319   </pre>
320   which is equivalent to
321   <pre>
322   jalview --open examples/uniref50.fa --structure examples/AlphaFold/AF-P00221-F1-model_v4.pdb --tempfac plddt --seqid FER1_SPIOL
323    --structureviewer jmol
324   </pre>
325
326   </p>
327
328   <!-- notempfac not yet working. undocumented until then -->
329
330   <h3><a name="showssannotations"></a><code>&#8209;&#8209;showssannotations</code> / <code>&#8209;&#8209;noshowssannotations</code></h3>
331
332   <p>
333   You can specify whether the currently opened alignment window should show secondary structure annotations or not with either <code>&#8209;&#8209;showssannotations</code> or <code>&#8209;&#8209;noshowssannotations</code>.  If you don't specify then your saved preference will be used.
334   <pre>
335   jalview --open examples/uniref50.fa --structure examples/AlphaFold/AF-P00221-F1-model_v4.pdb --noshowssannotations
336   </pre>
337   or you can use a sub-value modifier:
338   <pre>
339   jalview --open examples/uniref50.fa --structure [noshowssannotations]examples/AlphaFold/AF-P00221-F1-model_v4.pdb
340   </pre>
341   </p>
342
343   <h2><a name="outputtingalignmentfiles"></a>Outputting/converting alignment files and images (<code>&#8209;&#8209;output</code>, <code>&#8209;&#8209;format</code>, <code>&#8209;&#8209;image</code>, <code>&#8209;&#8209;structureimage</code>, <code>&#8209;&#8209;type</code>, <code>&#8209;&#8209;scale</code>, <code>&#8209;&#8209;width</code>, <code>&#8209;&#8209;height</code>, <code>&#8209;&#8209;imagecolour</code>, <code>&#8209;&#8209;bgcolour</code>, <code>&#8209;&#8209;textrenderer</code>, <code>&#8209;&#8209;overwrite</code>, <code>&#8209;&#8209;backups</code>, <code>&#8209;&#8209;mkdirs</code>)</h2>
344
345   <p>
346   You can save an alignment as an alignment file, or exported as an image, in different formats.  Jalview's alignment output formats are:
347   fasta,
348   pfam,
349   stockholm,
350   pir,
351   blc,
352   amsa,
353   json,
354   pileup,
355   msf,
356   clustal,
357   phylip,
358   jalview.
359   </p>
360   <p>
361   Alignments can be exported as an image in formats EPS, SVG, HTML, BioJSON (vector formats) or PNG (bitmap format).
362   </p>
363   <p>
364   In vector formats you can specify whether text should be rendered as text (which may have font changes, but will produce a smaller and more usable file) or as lineart (which will retain exact appearance of text, but will be less easy to edit or use to copy text).
365   </p>
366   <p>
367   In bitmap formats (currently only PNG, but what else would you want?!) you can specify a scaling factor to improve the resolution of the output image.
368   </p>
369
370   <h3><a name="output"></a><code>&#8209;&#8209;output</code></h3>
371
372   <p>
373   To save the open alignment in a new alignment file use <code>&#8209;&#8209;output filename</code>.  The format for the file can be found from the extension of <code>filename</code>, or if you are using a non-standard extension you can use a following <code>&#8209;&#8209;format</code> argument, or specify it as a sub-value modifier.
374   </p>
375   <p>
376   Recognised formats and their recognised extensions are:
377   <br/>
378   <code>fasta</code> (<code>fa, fasta, mfa, fastq</code>),
379   <br/>
380   <code>pfam</code> (<code>pfam</code>),
381   <br/>
382   <code>stockholm</code> (<code>sto, stk</code>),
383   <br/>
384   <code>pir</code> (<code>pir</code>),
385   <br/>
386   <code>blc</code> (<code>blc</code>),
387   <br/>
388   <code>amsa</code> (<code>amsa</code>),
389   <br/>
390   <code>json</code> (<code>json</code>),
391   <br/>
392   <code>pileup</code> (<code>pileup</code>),
393   <br/>
394   <code>msf</code> (<code>msf</code>),
395   <br/>
396   <code>clustal</code> (<code>aln</code>),
397   <br/>
398   <code>phylip</code> (<code>phy</code>),
399   <br/>
400   <code>jalview</code> (<code>jvp, jar</code>).
401   </p>
402   <p>
403   For example, to open a FASTA file, append another FASTA file and then save the concatenation as a Stockholm file, do
404   <pre>
405   jalview --open alignment1.fa --append alignment2.fa --output bothalignments.stk
406   </pre>
407   or
408   <pre>
409   jalview --append alignment*.fa --output bigballofstring.txt --format stockholm
410   </pre>
411   or
412   <pre>
413   jalview --append alignment*.fa --output [format=stockholm]bigballofstring.txt
414   </pre>
415   </p>
416
417   <p>
418   <em>Important!</em> If you use <code>&#8209;&#8209;output</code> or any other argument that outputs a file, then it will be assumed you want to run Jalview in headless mode (as if you had specified <code>&#8209;&#8209;headless</code>).  To use Jalview with <code>&#8209;&#8209;output</code> and not assume headless mode, use the <code>&#8209;&#8209;gui</code> argument (the order doesn't matter).
419   </p>
420
421   <p>
422   If you would like to output an alignment file directly to standard output (often referred to as STDOUT), then use the filename <code>-</code> (a single hyphen).  In this case any messages that would normally appear on STDOUT will be diverted to STDERR to avoid invalidating the output file.
423   </p>
424   <p>
425   For example, to open a Stockholm file and pipe it to another command as a Block file, do
426   <pre>
427   jalview --open alignment1.stk --output - --format blc | another_command
428   </pre>
429   or equivalently
430   <pre>
431   jalview alignment1.stk --output=[format=blc]- | another_command
432   </pre>
433   </p>
434
435   <h3><a name="format"></a><code>&#8209;&#8209;format</code></h3>
436
437   <p>
438   To specify the format of the output file (if using an unrecognised file extension) use the <code>&#8209;&#8209;format</code> argument to specify a value (see above).  A sub-value modifier on the <code>&#8209;&#8209;output</code> value can also be used.
439   </p>
440
441   <h3><a name="image"></a><code>&#8209;&#8209;image</code></h3>
442   <p>
443   To export the open alignment window as an image, use the <code>&#8209;&#8209;image</code> argument, which will give an image of the alignment and annotations as it appears (or would appear if not in <code>&#8209;&#8209;headless</code> mode) in the alignment window if it was large enough for the whole alignment, including colour scheme and features.
444   </p>
445   <p>
446   <pre>
447   jalview --open examples/plantfdx.fa --colour gecos-blossom --features examples/plantfdx.features --annotations examples/plantfdx.annotations --image plantfdx.png --headless
448   </pre>
449   </p>
450
451   <h3><a name="structureimage"></a><code>&#8209;&#8209;structureimage</code></h3>
452   <p>
453   To export an open structure as an image, use the <code>&#8209;&#8209;structureimage</code> argument, which will give an image of the structure as it appears (or would appear if not in <code>&#8209;&#8209;headless</code> mode) in a Jmol window including colour scheme. <code>&#8209;&#8209;structureimage</code> can currently only be used with structures opened with the <code>jmol</code> structureviewer (the default viewer).
454   </p>
455   <p>
456   <pre>
457   jalview --open examples/plantfdx.fa --colour gecos-blossom --features examples/plantfdx.features --annotations examples/plantfdx.annotations --image plantfdx.png --headless
458   </pre>
459   </p>
460
461   <p>
462   These by default produce a PNG image of screen or webpage resolution, which you will probably want to improve upon.  There are two ways of doing this with Jalview: increasing the scale of the PNG image, or using a vector based image format (EPS, SVG, HTML).
463   <p>
464
465   <h3><a name="type"></a><code>&#8209;&#8209;type</code></h3>
466
467   <p>
468   To specify the type of image file to write (if using an unrecognised file extension) use the <code>&#8209;&#8209;type</code> argument to specify a value (see above).  A sub-value modifier on the <code>&#8209;&#8209;image</code> and <code>&#8209;&#8209;structureimage</code> value can also be used.  Valid values are:
469   <br/>
470   <code>png</code> - A Portable Network Graphics image (bitmap, default),
471   <br/>
472   <code>svg</code> - A Scalable Vector Graphics image (vector),
473   <br/>
474   <code>eps</code> - An Encapsulated PostScript file (vector),
475   <br/>
476   <code>html</code> - An HTML rendition of the alignment with embedded source data (vector/web browser),
477   <br/>
478   <code>biojs</code> - An HTML rendition of the alignment with interactive MSA viewer <a href="biojsmsa.html">BioJS-MSA</a> (vector).
479   </p>
480
481   <h3><a name="bitmap"></a>Bitmap image types (<code>png</code>)</h3>
482
483   <p>
484   Bitmap images are composed of an array of pixels.  Bitmap images with a low resolution that are blown up to a larger size appear "blocky", so it is important to get the resolution for your purpose correct.  Older screens only require a modest resolution, whilst newer HiDPI screens look better with a higher resolution.  For print you will want an even higher resolution although in this case you would probably want to use a vector image format.  In general creating a bitmap image that has a large resolution means you can scale the image down if needed, although if you are running a batch process this will take more time and resources.
485   </p>
486   <p>
487   Jalview only produces a PNG bitmap image type.  This is a high-colour lossless format which can also use lossless compression so is suitable for alignment figures.
488   </p>
489   <p>
490   Let's increase the resolution of the PNG image:
491   </p>
492
493   <h3><a name="scale"></a><code>&#8209;&#8209;scale</code></h3>
494
495   <p>
496   We can increase the size of the PNG image by a factor of <em>S</em> by following the <code>&#8209;&#8209;image</code> or <code>&#8209;&#8209;structureimage</code> argument with a <code>&#8209;&#8209;scale <em>S</em></code> argument and value.  The value doesn't have to be an integer and should be given as an integer or floating point formatted number, e.g.
497   <pre>
498   jalview --open examples/uniref50.fa --colour gecos-ocean --image mypic.png --scale 5.5 --headless
499   </pre>
500   which will produce a PNG image 5.5 times larger (and more detailed) than without the <code>&#8209;&#8209;scale</code> argument.
501   </p>
502   <p>
503   However, since you won't necessarily already know the size of an alignment's exported image you can specify either an exact width or height (in pixels) with either one of the
504   <code>&#8209;&#8209;width</code> and <code>&#8209;&#8209;height</code> arguments:
505
506   <h3><a name="width"></a><code>&#8209;&#8209;width</code></h3>
507
508   <p>
509   Specify an exact width of an exported PNG image with <code>&#8209;&#8209;width</code>:
510   <pre>
511   jalview --headless --open https://www.ebi.ac.uk/interpro/api/entry/pfam/PF03760/?annotation=alignment%3Aseed --noshowannotations --colour gecos-sunset --image wallpaper.png --width 3840
512   </pre>
513   </p>
514
515   <h3><a name="height"></a><code>&#8209;&#8209;height</code></h3>
516
517   <p>
518   Alternatively specify an exact height with the <code>&#8209;&#8209;height</code> argument:
519   <pre>
520   jalview --headless --open https://www.ebi.ac.uk/interpro/api/entry/pfam/PF03760/?annotation=alignment%3Aseed --noshowannotations --colour gecos-ocean --image wallpaper.png --height 2160
521   </pre>
522   </p>
523
524   <p>
525   You can specify two or all of <code>&#8209;&#8209;scale</code>, <code>&#8209;&#8209;width</code> and <code>&#8209;&#8209;height</code> as limits to the size of the image (think of one or two bounding boxes) and the one which produces the smallest scale of image is used.  You can also specify each of these as sub-value modifiers to the <code>&#8209;&#8209;image</code> or <code>&#8209;&#8209;structureimage</code> value:
526   <pre>
527   jalview --headless --open https://www.ebi.ac.uk/interpro/api/entry/pfam/PF03760/?annotation=alignment%3Aseed --noshowannotations --colour gecos-flower --image [scale=0.25,width=320,height=240]thumbnail.png
528   </pre>
529   </p>
530
531   <h3><a name="imagecolour"></a><code>&#8209;&#8209;imagecolour</code></h3>
532
533   <p>
534   Specify a colour scheme to use just for this image using the <code>&#8209;&#8209;imagecolour</code> argument:
535   <pre>
536   jalview --open examples/uniref50.fa --colour gecos-flower --image uniref50-residues.png --height 2160 --image uniref50-helix.png --imagecolour helix-propensity --width 800 --image uniref50-turn.png --imagecolour turn-propensity --width 800
537   </pre>
538   </p>
539
540   <h3><a name="bgcolour"></a><code>&#8209;&#8209;bgcolour</code></h3>
541
542   <p>
543   <strong>Only applies to <code>&#8209;&#8209;structureimage</code>.</strong> Specify a background colour for a structure image.  The colour can be specified as a named colour recognised by Java (e.g. <code>"white"</code>, <code>"cyan"</code>) or as a RRGGBB 6 digit hex string (e.g. <code>ffffff</code>, <code>00ffff</code>).
544   </p>
545   <p>
546   E.g.
547   <pre>
548   jalview --open examples/uniref50.fa --colour gecos-sunset --structure examples/AF-P00221-F1-model_v4.pdb --seqid FER1_SPIOL --structureimage temp.png  --bgcolour magenta
549   </pre>
550   </p>
551
552   <p>
553   Next we look at vector image formats, which maintain detail at all resolutions.
554   </p>
555
556   <h3><a name="vector"></a>Vector image export (<code>svg</code>, <code>eps</code>, <code>html</code>, <code>biojs</code>)</h3>
557
558   <p>
559   Jalview can export an alignment in Encapsulated PostScript (<code>eps</code>), Scalable Vector Graphics (<code>svg</code>), HTML (<code>html</code>) or <a href="biojsmsa.html">BioJSON</a> -- another HTML format with an interactive MSA viewer (<code>biojs</code>), by using, e.g.
560   <pre>
561   jalview --open examples/uniref50.fa --colour gecos-flower --image printable.eps
562   </pre>
563   The image format can be specified with the <code>&#8209;&#8209;type</code> argument or as a sub-value modifier on the <code>&#8209;&#8209;image</code> value.  If neither is used the <code>type</code> will be guessed from the image file extension.  The following three examples should produce the same contents:
564   <pre>
565   jalview --open examples/uniref50.fa --colour gecos-flower --image printable.eps
566   jalview --open examples/uniref50.fa --colour gecos-flower --image printable.postscript --type eps
567   jalview --open examples/uniref50.fa --colour gecos-flower --image [type=eps]printable.postscript
568   jalview --open examples/uniref50.fa --colour gecos-flower --image [type=biojs]printable.html
569   </pre>
570   </p>
571
572   <h3><a name="textrenderer"></a><code>&#8209;&#8209;textrenderer</code></h3>
573
574   <p>
575   In a vector format any text that appears on the page (including residue/base labels) can be saved in the image file either as <code>text</code> or as <code>lineart</code> using the <code>&#8209;&#8209;textrenderer</code> argument.  This is only available for <code>eps</code>, <code>svg</code> and <code>html</code> formats.
576   </p>
577
578   <p>
579   The difference is potentially in the appearance of the file, and definitely in the filesize!  Saving with <code>text</code> requires the font used to display the text characters in the alignment to be present on the viewing platform to look exactly the same.  If it isn't then another suitable font will probably be used.  The filesize using <code>text</code> is relatively small.
580   </p>
581   <p>
582   When using <code>lineart</code> each individual character that appears in the alignment (including names/titles and resisdues/bases) is stored in the image with its own vector lines.  This means that the appearance of the text is retained exactly independent of installed fonts, but the filesize is increased.  You will also be unable to copy what appears to be text as text.
583   </p>
584
585   <p>
586   The type of <code>&#8209;&#8209;textrenderer</code> can be specified with an argument following <code>&#8209;&#8209;image</code> or as a sub-value modifier:
587   <pre>
588   jalview --open examples/uniref50.fa --colour gecos-flower --image printable.html --type biojs
589   jalview --open examples/uniref50.fa --colour gecos-flower --image [type=eps,textrenderer=lineart]printable.ps
590   </pre>
591   </p>
592
593   <h3><a name="outputbehaviour"></a>Output behaviour</h3>
594
595   <h3><a name="overwrite"></a><code>&#8209;&#8209;overwrite</code></h3>
596
597   <p>
598   By default, Jalview will refuse to overwrite an output file (alignment or image) unless backups are in operation (alignment files only).  To force overwriting files, use the <code>&#8209;&#8209;overwrite</code> argument.
599   </p>
600
601   <h3><a name="backups"></a><code>&#8209;&#8209;backups / --nobackups</code></h3>
602
603   <p>
604   Jalview should honour your preferences for backup files of output alignment files.  Using <code>&#8209;&#8209;backups</code> or <code>&#8209;&#8209;nobackups</code> forces the behaviour.  With no backups set, you will need to use <code>&#8209;&#8209;overwrite</code> to overwrite an existing file.  Note that Jalview does not make backup files of exported images.
605   </p>
606
607   <h3><a name="mkdirs"></a><code>&#8209;&#8209;mkdirs</code></h3>
608
609   <p>
610   If you want to output a file into a folder that doesn't yet exist (this might happen particularly when using <code>{dirname}</code> substitutions -- see below), then Jalview will fail to write the file since the parent directory doesn't exist.  You can use <code>&#8209;&#8209;mkdirs</code> to tell Jalview to make the new directory (or directories, it will create several nested directories if necessary) before writing the file.  <code>&#8209;&#8209;mkdirs</code> is cautious and will generally refuse to make a new directory using a relative path with <code>..</code> in.
611   </p>
612
613   <h2><a name="filenamesubstitutionsandbatchprocessing"></a>Filename substitutions and batch processing (<code>&#8209;&#8209;substitutions</code>, <code>&#8209;&#8209;close</code>, <code>&#8209;&#8209;all</code>)</h2>
614
615   <p>
616   One of the more powerful aspects of Jalview's command line operations is that stores all of the different opened alignment arguments (before opening them) and can apply some arguments to <em>all</em> of the alignments as they are opened.  This includes display and output arguments.
617   </p>
618
619   <p>
620   When outputting a file you will obviously want to use a different filename for each of the alignments that are opened.  There are several ways you can specify how that filename differs, but the easiest way is to refer to the input filename and change the extension.  In the case of an alignment where multiple files are appended, the filename of the first file to be appended or opened is used.
621   </p>
622
623   <p>
624   To refer to different parts of the opening filename, you can use the strings
625   <ul>
626   <li><code>{dirname}</code> -- is replaced by the directory path to the opened file.</li>
627   <li><code>{basename}</code> -- is replaced by the base of the filename of the opened file. This is without the path or file extension (if there is one).</li>
628   <li><code>{extension}</code> -- is replaced by the extension of the filename of the opened file.</li>
629   </ul>
630   The braces (curly brackets '{', '}') are important!
631   </p>
632
633   <p>
634   Specifically for <code>&#8209;&#8209;structureimage</code> output, you can also use substitutions using parts of the structure filename:
635   <ul>
636   <li><code>{structuredirname}</code> -- is replaced by the directory path to the opened structure file.</li>
637   <li><code>{structurebasename}</code> -- is replaced by the base of the filename of the opened structure file. This is without the path or file extension (if there is one).</li>
638   <li><code>{structureextension}</code> -- is replaced by the extension of the filename of the opened structure file.</li>
639   </ul>
640   </p>
641
642   <p>
643   These filename substitutions are on by default, but if for whatever reason you wish to disable the substitutions, they can be turned off (or back on again) through the list of arguments with:
644   </p>
645
646   <h3><a name="substitutions"></a><code>&#8209;&#8209;substitutions / --nosubstitutions</code></h3>
647
648   <p>
649   Enable (or disable) filename substitutions in the following argument values and sub-value modifier values.
650   <pre>
651   jalview --open exampes/uniref50.fa --nosubstitutions --output I_Want_A_Weird_Output_Filname_With_{basename}_Curly_Brackets_In_And_A_Sensible_One_Next.stk --substitutions --output tmp/{basename}.stk --headless
652   </pre>
653   </p>
654
655   <p>
656   For opening single files this is less useful, since you could obviously just type the output filename, but for multiple opened alignments you can also use these substituted values and they will be replaced by the relevant part of the filename given for each opened alignment window.  Normally an <code>&#8209;&#8209;output</code> or <code>&#8209;&#8209;image</code> argument will only be applied to the latest opened alignment window, but you can tell Jalview to apply some arguments to all alignments that have been opened (so far) by using the <code>&#8209;&#8209;all</code> argument.
657   </p>
658
659   <h3><a name="all"></a><code>&#8209;&#8209;all / -noall</code></h3>
660
661   <p>
662   When using the <code>&#8209;&#8209;all</code> argument, following arguments will apply to all of the previously opened alignment windows.  You can turn this behaviour off again for following arguments using the <code>&#8209;&#8209;noall</code> argument.  The arguments that can apply to all previously opened alignments are:
663   <br/>
664   <code>&#8209;&#8209;colour</code>
665   <br/>
666   <code>&#8209;&#8209;sortbytree</code>
667   <br/>
668   <code>&#8209;&#8209;showannotations</code>
669   <br/>
670   <code>&#8209;&#8209;wrap</code>
671   <br/>
672   <code>&#8209;&#8209;nostructure</code>
673   <br/>
674   <code>&#8209;&#8209;notempfac</code>
675   <br/>
676   <code>&#8209;&#8209;showssannotations</code>
677   <br/>
678   <code>&#8209;&#8209;image</code>
679   <br/>
680   <code>&#8209;&#8209;type</code>
681   <br/>
682   <code>&#8209;&#8209;textrenderer</code>
683   <br/>
684   <code>&#8209;&#8209;scale</code>
685   <br/>
686   <code>&#8209;&#8209;width</code>
687   <br/>
688   <code>&#8209;&#8209;height</code>
689   <br/>
690   <code>&#8209;&#8209;output</code>
691   <br/>
692   <code>&#8209;&#8209;format</code>
693   <br/>
694   <code>&#8209;&#8209;groovy</code>
695   <br/>
696   <code>&#8209;&#8209;backups</code>
697   <br/>
698   <code>&#8209;&#8209;overwrite</code>
699   <br/>
700   <code>&#8209;&#8209;close</code>
701   </p>
702   <p>
703   In particular, for our example above, we can use <code>-all</code> and <code>&#8209;&#8209;output</code> like this (<code>&#8209;&#8209;close</code> will be explained in a moment):
704   <pre>
705   jalview --open all_my_fasta_files/*.fa --all --output all_my_converted_stockholm_files/{basename}.stk --close --headless
706   </pre>
707   </p>
708
709   <p>
710   Another example would be to create a print quality coloured postscript image for every Fasta file in several directories and place the image next to the alignment:
711   <pre>
712   jalview --open */*.fa --all --colour gecos-flower --image {dirname}/{basename}.eps --textrenderer text --close --headless
713   </pre>
714   or thumbnails for every Fasta file with
715   <pre>
716   jalview --open */*.fa --all --colour gecos-flower --image {dirname}/{basename}.png --width 256 --height 256 --close --headless
717   </pre>
718   </p>
719
720   <h3><a name="close"></a><code>&#8209;&#8209;close</code></h3>
721
722   <p>
723   The <code>&#8209;&#8209;close</code> tag is used to close an alignment window after all output files or image exports are performed.  This reduces memory use, especially if an <code>&#8209;&#8209;open</code> value is set to open many files.  These will be opened, formatted and output sequentially so since they are closed before the next one is opened memory use will not build up over a large number of alignments.
724   <pre>
725   </pre>
726   </p>
727
728
729   <h2><a name="alloutputwildcard"></a>The all output wildcard: <code>&#8209;&#8209;output "*/*.ext"</code>,  <code>&#8209;&#8209;image "*/*.ext"</code></h2>
730
731   <p>
732   Purely as an intuitive syntactic sweetener, you can use the <code>&#8209;&#8209;output</code> wildcard <code>*</code> in two places as part of an output path and filename.
733   </p>
734
735   <p>
736   Using an asterisk (<code>*</code>) as a filename before an extension, e.g. <code>&#8209;&#8209;image "tmp/*.png"</code> will result in that asterisk being treated as a <code>{basename}</code> substitution.
737   </p>
738
739   <p>
740   Using an asterisk (<code>*</code>) before a file separator (usually </code>/</code>), e.g. <code>&#8209;&#8209;image "tmp/*/file1.png"</code> will result in that asterisk being treated as a <code>{dirname}</code> substitution.
741   </p>
742
743   <p>
744   You can combine these, using an asterisk (<code>*</code>) before and after the last file separator, e.g. <code>&#8209;&#8209;image "tmp/*/*.png"</code> will result in being substituted like <code>tmp/{dirname}/{basename}.png</code>.
745   </p>
746
747   <p>
748   For example, to achieve the same as the thumbnails example above, you could use
749   <pre>
750   jalview --open */*.fa --image "*/*.png" --colour gecos-flower --width 256 --height 256 --close --headless
751   </pre>
752   Here we move the <code>&#8209;&#8209;colour</code> argument after the <code>&#8209;&#8209;output</code> argument (it will still be applied before the image export or file output) so that it is included after the implied <code>&#8209;&#8209;all</code> argument.  The thumbnails will be placed in the same directory as the alignment file with the same filename except for a different extension of <code>.png</code>.
753   </p>
754
755   <p>
756   For a simple conversion of many fasta files into Stockholm format, simply use
757   <pre>
758   jalview --open all_my_fasta_files/*.fa --output "*.stk" --close --headless
759   </pre>
760   </p>
761
762   <p>
763   <strong>Important!</strong>  Please note that using a bareword <code>*.ext</code> (i.e. without an escape or quotation marks) in a shell command line will potentially be expanded by the shell to a list of all the files in the current directory ending with <code>.ext</code> <em>before</em> this value is passed to Jalview.  This will result in the first of these files being overwritten (multiple times)!  If you shell-escape the <code>*</code> (usually with a backslash '\') or enclose the value in quotation marks (<code>"*.ext"</code> - that's including the quotation marks) then the shell will not expand the wildcard.
764   </p>
765
766   <p>
767   An alternative is to use an equals sign ('=') with no spaces between the argument and the value, <code>&#8209;&#8209;output=*.ext</code>, which Jalview will interpret the same, but the shell will not automatically expand before it is sent to Jalview, e.g.
768   <pre>
769   jalview --open all_my_fasta_files/*.fa --output=*.stk --close --headless
770   </pre>
771   </p>
772
773   <hr/>
774   Continue to <a href="clarguments-advanced.html">Command Line: advanced usage</a>.
775   <br/>
776   <a href="clarguments-reference.html">Command Line: reference</a>
777
778 </body>
779 </html>