Edited wiki page forester through web user interface.
[jalview.git] / wiki / forester.wiki
1 = Introduction =
2
3 Under development!
4
5 Documentation, tutorial, and examples for [http://www.phylosoft.org/forester/ forester].
6
7 Author: [http://www.cmzmasek.net/ Christian M Zmasek], Sanford-Burnham Medical Research Institute
8
9  
10 Copyright (C) 2011 Christian M Zmasek. All rights reserved.
11
12
13 = Reading in Trees and Displaying them with Archaeopteryx =
14
15 This needs file "forester.jar" to be in the class-path.
16
17 {{{
18
19 package my.examples;
20
21 import java.io.File;
22 import java.io.IOException;
23
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;
29
30 public class Example1 {
31
32     public static void main( final String[] args ) {
33         // Reads in (a) tree(s) from a file.
34         final File treefile = new File( "/home/czmasek/tol_117_TEST.xml" );
35         PhylogenyParser parser = null;
36         try {
37             parser = ForesterUtil.createParserDependingOnFileType( treefile, true );
38         }
39         catch ( final IOException e ) {
40             e.printStackTrace();
41         }
42         Phylogeny[] phys = null;
43         try {
44             phys = Util.readPhylogenies( parser, treefile );
45         }
46         catch ( final IOException e ) {
47             e.printStackTrace();
48         }
49         // Display of the tree(s) with Archaeopteryx.
50         Archaeopteryx.createApplication( phys );
51     }
52 }
53
54 }}}