Jalview Command Line Arguments: advanced usage

Jalview Command Line Arguments: summary
Jalview Command Line Arguments: introduction
Jalview Command Line Arguments: basic usage
Jalview Command Line Arguments: advanced usage
Jalview Command Line Arguments: argfiles


Alignment linked IDs

Jalview's alignment related arguments are linked together using a linked ID. In all of the basic usage examples this linked ID is assigned using a default formula of JALVIEW:n where n starts at 0 and increments every time there is an --opened file (or a first use of --append) or the --newargument is used.

When another alignment related argument is used, it is assigned the same linked ID. When the --all argument is used, following alignment related arguments are applied to all linked IDs (made so far).

You can assign your own linked IDs to alignments that are opened from the command-line. To do this put the linked ID in square brackets ('[', ']') immediately following the argument (i.e. before any space or equals sign) like this:

  jalview --open[myId1] file1.fa --open[myId2] file2.fa --open[myId3] file3.fa --colour[myId1] gecos-flower --colour[myId2] gecos-blossom --colour[myId3] zappo --image "*.png" --headless
  

As you can see the arguments for one alignment do not need to be adjacent as they are when using the default assigned linked ID.

More substitutions

In the basic usage document we have a list of special strings that get replaced in output filename values with parts of input filename values.

There is also an incrementor integer value {n} that can be put into both linked IDs and filenames and works across different linked IDs. Whenever you use {n} in a linked ID or filename value it is replaced with the current value of n. The initial value is 0, and it can be incremented by using the argument --npp or --n++, or using a another substitution {++n} in either a linked ID or filename value which increments the value and is replaced with the new incremented value of n.

In the same way that the --all argument enables (some) following arguments to apply to all opened alignments so far, the special linked ID {*} will also apply an individual argument to all opened linked IDs.

  jalview --open[myId1] fileA.fa --open[myId2] fileB.fa --open[myId3] fileC.fa --colour[{*}] taylor --all --image tmp/image-{++n}.png --headless
  
The above will produce an image image-0.png for the alignment in fileA.fa, an image image-1.png for the alignment in fileB.fa, etc.

Equals separator and file globs

When a Jalview command-line argument requires one (or more) values, you can use the usual space separation, which allows the shell to expand any filename "globs" (or wildcards representing multiple files). To Jalview this appears like a list of filenames supplied to the argument.

There is a limitation to shell expansion of file globs, as the length of a single command is limited (to different amounts depending on your shell and its configuration).

Jalview will also recognise values supplied to arguments (that expect one or more value) that are separated by an equals sign ("="). There should be no spaces around the equals sign, e.g.

  jalview --open=examples/uniref50*.fa --colour=clustal --all --image=*.png --scale=2.5 --headless
  

One benefit of this is seen above in the --image argument, the special "alloutput" wildcard filename *.png will not be expanded by the shell, so does not need to be escaped or surrounded with quotation marks.

Another benefit is that the input filename


Continue to Jalview Command Line Arguments: argfiles.
Return to Jalview Command Line Arguments: summary.