5 Documentation, tutorial, and examples for [http://www.phylosoft.org/forester/ forester].
7 Author: [http://www.cmzmasek.net/ Christian M Zmasek], Sanford-Burnham Medical Research Institute
10 Copyright (C) 2011 Christian M Zmasek. All rights reserved.
13 = Parsing of Phylogenetic Trees and Displaying them with Archaeopteryx =
15 This needs file "forester.jar" to be in the class-path.
22 import java.io.IOException;
24 import org.forester.archaeopteryx.Archaeopteryx;
25 import org.forester.io.parsers.PhylogenyParser;
26 import org.forester.phylogeny.Phylogeny;
27 import org.forester.util.ForesterUtil;
29 public class Example1 {
31 public static void main( final String[] args ) {
32 // Reads in (a) tree(s) from a file.
33 final File treefile = new File( "/path/to/tree.xml" );
34 PhylogenyParser parser = null;
36 parser = ForesterUtil.createParserDependingOnFileType( treefile, true );
38 catch ( final IOException e ) {
41 Phylogeny[] phys = null;
43 phys = ForesterUtil.readPhylogenies( parser, treefile );
45 catch ( final IOException e ) {
48 // Display of the tree(s) with Archaeopteryx.
49 Archaeopteryx.createApplication( phys );