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.archaeopteryx.Util;
26 import org.forester.io.parsers.PhylogenyParser;
27 import org.forester.phylogeny.Phylogeny;
28 import org.forester.util.ForesterUtil;
30 public class Example1 {
32 public static void main( final String[] args ) {
33 // Reads in (a) tree(s) from a file.
34 final File treefile = new File( "/path/to/trees.xml" );
35 PhylogenyParser parser = null;
37 parser = ForesterUtil.createParserDependingOnFileType( treefile, true );
39 catch ( final IOException e ) {
42 Phylogeny[] phys = null;
44 phys = Util.readPhylogenies( parser, treefile );
46 catch ( final IOException e ) {
49 // Display of the tree(s) with Archaeopteryx.
50 Archaeopteryx.createApplication( phys );