Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In addition to the NETWORKS block, the TREES block may also be used to define rich newick strings. However, rich newick strings defined in a TREES block may not contain hybridization nodes. The inclusion Support of the TREES block in addition as an alternate declaration to the NETWORKS block is for increased comparability with NEXUS processing tools besides PhyloNet that also historically consume or produce TREES blocks within NEXUS files.

For example , usage of a TREES block consider the following NEXUS file that utilizes a TREES block:

Code Block
langhtml
#NEXUS

BEGIN TREES;

Tree speceiesTree = ((((a,b),c),d),e);
Tree geneTree1 = ((((a,b),c),d),e);
Tree geneTree2 = ((a,b),((c,e),d));
Tree geneTree3 = ((a,c),((b,e),d));

END;


BEGIN PHYLONET;

DeepCoalCount {speceiesTree} {geneTree1, geneTree2, geneTree3};

END;

The example script's TREES block defines four phylogenetic trees in rich newick form that are referenced by the DeepCoalCount command within the PHYLONET block.

5. Managing Output

The default behavior of PhyloNet for reporting results is to display each command's output on the console. For example given the following NEXUS file charnet.nex:

Code Block
langhtml

#NEXUS

BEGIN NETWORKS;

Network net = ((a,(b,(c)x#1)),((x#1,d),e));

END;


BEGIN PHYLONET;

Charnet net -m tree;

END;

we could execute the script by typing the following command on the console:

Code Block
langhtml

>java -jar $PHYLONET PATH/jar/PhyloNet_X.Y.Z.jar charnet.nex

which in turn would append the following output to the console:

Code Block
langhtml

>java -jar $PHYLONET PATH/jar/PhyloNet_X.Y.Z.jar charnet.nex

Charnet net -m tree
((a,(b,c)),(e,d));
((a,b),((d,c),e));

>

Note how the command and its parameters are displayed followed by the output of the command. This becomes very helpful for reading results when many commands are listed in a single NEXUS file.

Most commands, including Charnet, support an optional final parameter that specifies the name of a file where command output should be redirected to instead of the console. For example, we could modify charnet.nex to send the command's output to the file C:\temp\charnet_output.txt as follows:

Code Block
langhtml

#NEXUS

BEGIN NETWORKS;

Network net = ((a,(b,(c)x#1)),((x#1,d),e));

END;


BEGIN PHYLONET;

Charnet net -m tree "C:\temp\charnet_output.txt";

END;

Upon executing the modified script from the console we would now see a new result without any tree results displayed to the console:

Code Block
langhtml

>java -jar $PHYLONET PATH/jar/PhyloNet_X.Y.Z.jar charnet.nex

Charnet net -m tree "C:\temp\charnet_output.txt"
Writing output to C:\temp\charnet_output.txt

>

Opening the file C:\temp\charnet_output.txt would reveal the command output:

Code Block
langhtml

((a,(b,c)),(e,d));
((a,b),((d,c),e));

Each command that supports the optional file output command in a given NEXUS file can be given its own unique file parameter resulting the generation of distinct output files for each command. Alternatively, one may specify the file output parameter for only some commands in a NEXUS file. In this case those commands without the optional parameter would continue to utilize the default behavior and display their results on the console. Repeating a file output parameter for many commands in a NEXUS file is not advisable as each command's output will overwrite the previous command's output. One can however send the entire output of a PhyloNet execution to one file by using most operating systems' redirection operators.

5.1 Nexus_Out Command

PhyloNet provides a special command called Nexus_Out that allows the user to instruct PhyloNet to additionally create an output NEXUS file containing a copy of each tree result generated by all commands within the script. For example, executing the following NEXUS script:

Code Block
langhtml

#NEXUS

BEGIN NETWORKS;

Network net = ((a,(b,(c)x#1)),((x#1,d),e));

END;


BEGIN PHYLONET;

Nexus_Out "C:\temp\nexus_out.nex";
Charnet net -m tree;

END;

would cause a file C:\temp\nexus_out.nex to be generated with contents:

Code Block
langhtml

#NEXUS

BEGIN TREES;

2_Charnet_1 = ((a,(b,c)),(e,d));

2_Charnet_2 = ((a,b),((d,c),e));

END;

in addition to the usual console output of a similar file without the Nexus_Out command.

All trees recorded in the TREES section will be of the form:

Code Block
langhtml


N_Command_M = ...;

Where N is the number of the command (that is, the nth command) as it appears in the original NEXUS script, Command is the command identifier of the command that generated the tree, and M denotes the mth tree generated by the nth command.

See Also