WWW::PhyloBox - Perl interface to phylobox.appspot.com
use WWW::PhyloBox; use File::Slurp qw/slurp/; my $phylobox = WWW::PhyloBox->new; # this creates a phylogenetic tree from a remote file my $tree1 = $phylobox->create( phyloUrl => 'http://www.phyloxml.org/examples/apaf.xml', response => "key", name => 'Apaf-1 gene family tree with domain architectures', ); print $tree1->name . " tree is at " . $tree1->url . "\n"; # read in PhyloXML to a string my $phyloxml = slurp("phylo.xml"); # this creates a phylogenetic tree from string data my $tree2 = $phylobox->create( phyloFile => $phyloxml, response => "key", name => "T. Rex speciation", ); print $tree2->name " has a key of " . $tree2->key . "\n";
PhyloBox is an online environment for viewing, editing, sharing, and publishing phylogenetic trees. The preferred data format for importing phylogenetic trees is PhyloXML, but the Newick format is also marginally supported.
This example sets the API root, in the case of the developer wanting to talk to a different PhyloBox instance. It also uses a zipped remote PhyloXML file.
# this is the default api_root my $phylobox = WWW::PhyloBox->new( api_root => 'http://2-0.latest.phylobox.appspot.com' ); # this creates a phylogenetic tree from a remote zipped file # Zipped Newick files are also supported my $tree = $phylobox->create( phyloUrl => "http://example.com/phylo.xml.zip", response => "key", name => 'A really big phylogenetic tree', ); print $tree->name . " tree is at " . $tree->url . "\n";
This software was initially written at the GMOD Evolutionary Biology Hackathon 2010 at the National Evolutionary Synthesis Center (NESCent, National Science Foundation Grant # EF-0905606 ) in Durham, NC.
The PhyloJSON spec
Hominid Phylogenetic Tree in PhyloBox