From 3d88df8e1ed7153de9323871340b319acfc0d560 Mon Sep 17 00:00:00 2001 From: "cmzmasek@gmail.com" Date: Thu, 9 Jun 2011 22:43:34 +0000 Subject: [PATCH] Edited wiki page forester through web user interface. --- wiki/forester.wiki | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/wiki/forester.wiki b/wiki/forester.wiki index 501ce08..ca89628 100644 --- a/wiki/forester.wiki +++ b/wiki/forester.wiki @@ -145,7 +145,7 @@ public class Example2 { -= Using iterators to visit tree nodes in certain orders= += Using iterators to visit tree nodes in certain orders = This needs file "forester.jar" to be in the class-path. @@ -198,4 +198,65 @@ public class Example3 { } } -}}} \ No newline at end of file +}}} + + + + + + + + + += Creating a basic gene tree (with branch lengths) = + +This needs file "forester.jar" to be in the class-path. + +{{{ + +package examples; + +import org.forester.archaeopteryx.Archaeopteryx; +import org.forester.phylogeny.Phylogeny; +import org.forester.phylogeny.PhylogenyNode; +import org.forester.phylogeny.data.Sequence; +import org.forester.phylogeny.data.Taxonomy; + +public class Example5 { + + public static void main( final String[] args ) { + // Creating a new rooted tree with two external nodes. + final Phylogeny phy = new Phylogeny(); + final PhylogenyNode root = new PhylogenyNode(); + final PhylogenyNode d1 = new PhylogenyNode(); + final PhylogenyNode d2 = new PhylogenyNode(); + // Setting of distances. + d1.setDistanceToParent( 1.2 ); + d2.setDistanceToParent( 2.4 ); + // Adding species information. + final Taxonomy t1 = new Taxonomy(); + t1.setScientificName( "Nematostella vectensis" ); + d1.getNodeData().addTaxonomy( t1 ); + final Taxonomy t2 = new Taxonomy(); + t2.setScientificName( "Monosiga brevicollis" ); + d2.getNodeData().addTaxonomy( t2 ); + // Adding gene names. + final Sequence s1 = new Sequence(); + s1.setName( "Bcl-2" ); + d1.getNodeData().addSequence( s1 ); + final Sequence s2 = new Sequence(); + s2.setName( "Bcl-2" ); + d2.getNodeData().addSequence( s2 ); + root.addAsChild( d1 ); + root.addAsChild( d2 ); + phy.setRoot( root ); + phy.setRooted( true ); + // Displaying the newly created tree with Archaeopteryx. + Archaeopteryx.createApplication( phy ); + } +} + +}}} + + + -- 1.7.10.2