#!/usr/bin/perl
use lib "./lib"; #put the full path to the directory containing the perl module here
use strict;
use JgoughPhylo;

##This written by Julian Gough 11.3.03

#parameters
my $linesize=6;
my $textspace=3;
my $imageheight=0;
my $imagewidth=400;
my $bordersize=30;
#----------

my $usage="PhyloExample.pl <treefile> <output>\n";
die "Usage: $usage" unless (@ARGV == 2);
my $treefile=$ARGV[0];
my $outfile=$ARGV[1];

#data-----------------------------------------
my @refnodes=JgoughPhylo->ReadTree($treefile);
my (%labels,%nodedata,%linesizes,%backlinesizes);
my $i=$refnodes[0];
my %nodes=%$i;
#There is an entry in %nodes for each node of the tree. You can add labels and change the widths of the inner and outer branches in the corresponding hashes: %labels,%nodedata,%linesizes,%backlinesizes
#---------------------------------------------

#Tree-Plot------------------------------------
JgoughPhylo->DrawTree($outfile,$linesize,$textspace,$imageheight,$imagewidth,$bordersize,$refnodes[0],$refnodes[1],\%labels,\%nodedata,\%linesizes,\%backlinesizes);
#---------------------------------------------
