<code>phylip</code> (<code>phy</code>),
<br/>
<code>jalview</code> (<code>jvp, jar</code>).
+ </p>
<p>
For example, to open a FASTA file, append another FASTA file and then save the concatenation as a Stockholm file, do
<pre>
<em>Important!</em> If you use <code>--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>--headless</code>). To use Jalview with <code>--output</code> and not assume headless mode, use the <code>--gui</code> or <code>--noheadless</code> argument (the order doesn't matter).
</p>
+ <p>
+ 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.
+ </p>
+ <p>
+ For example, to open a Stockholm file and pipe it to another command as a Block file, do
+ <pre>
+ jalview --open alignment1.stk --output - --format blc | another_command
+ </pre>
+ or equivalently
+ <pre>
+ jalview alignment1.stk --output=[format=blc]- | another_command
+ </pre>
+ </p>
+
<h3><a name="format"></a><code>--format</code></h3>
<p>
+ "turn-propensity,\n" + "buried-index,\n"
+ "nucleotide,\n" + "nucleotide-ambiguity,\n"
+ "purine-pyrimidine,\n" + "rna-helices,\n"
- + "t-coffee-scores,\n" + "sequence-id.\n"
- +"\n"
+ + "t-coffee-scores,\n" + "sequence-id.\n" + "\n"
+ "Names of user defined colourschemes will also work,\n"
- +"and jalview colourscheme specifications like\n"
- +"--colour=\"D,E=red; K,R,H=0022FF; C,c=yellow\"",
+ + "and jalview colourscheme specifications like\n"
+ + "--colour=\"D,E=red; K,R,H=0022FF; C,c=yellow\"",
Opt.STRING, Opt.LINKED, Opt.ALLOWALL),
FEATURES(Type.OPENING, "Add a feature file or URL to the open alignment.",
Opt.STRING, Opt.LINKED, Opt.MULTI, Opt.ALLOWSUBSTITUTIONS),
+ "clustal (aln),\n" + "phylip (phy),\n"
+ "jalview (jvp, jar).",
Opt.STRING, Opt.LINKED, Opt.ALLOWSUBSTITUTIONS, Opt.ALLOWALL,
- Opt.REQUIREINPUT, Opt.OUTPUTFILE, Opt.PRIMARY),
+ Opt.REQUIREINPUT, Opt.OUTPUTFILE, Opt.STDOUT, Opt.PRIMARY),
FORMAT(Type.OUTPUT,
"Sets the format for the preceding --output file. Valid formats are:\n"
+ "fasta,\n" + "pfam,\n" + "stockholm,\n" + "pir,\n"
*/
OUTPUTFILE("output file --headless will be assumed unless --gui used"),
/*
+ * A STDOUT Arg can take an output filename that can be '-' to mean print to STDOUT.
+ */
+ STDOUT("allows the output filename '" + ArgParser.STDOUTFILENAME
+ + "' to mean output to STDOUT"),
+ /*
* A STORED Arg resets and creates a new set of "opened" linkedIds
*/
STORED(null),
// not a bootstrap arg
// make a check for an output going to stdout
- if (a != null && a.hasOption(Opt.OUTPUTFILE))
+ if (a != null && a.hasOption(Opt.OUTPUTFILE)
+ && a.hasOption(Opt.STDOUT))
{
- if ((val == null && i + 1 < args.size()
- && ArgParser.STDOUTFILENAME.equals(args.get(i + 1)))
- || ArgParser.STDOUTFILENAME.equals(val))
+ if (val == null && i + 1 < args.size())
+ {
+ val = args.get(i + 1);
+ }
+ if (val.startsWith("[") && val.indexOf(']') > 0)
+ {
+ val = val.substring(val.indexOf(']') + 1);
+ }
+
+ if (ArgParser.STDOUTFILENAME.equals(val))
{
this.outputToStdout = true;
}