Bio::Phylo::IOBio::Phylo::IO Perl module contains input and output of phylogenetic data. | |
Download |
Bio::Phylo::IO Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Rutger Vos
- Publisher web site:
- http://search.cpan.org/~rvosa/Bio-Phylo-0.17_RC6/lib/Bio/Phylo/IO.pm
Bio::Phylo::IO Tags
Bio::Phylo::IO Description
Bio::Phylo::IO Perl module contains input and output of phylogenetic data. Bio::Phylo::IO Perl module contains input and output of phylogenetic data.SYNOPSIS use Bio::Phylo::IO; # parsing a tree from a newick string my $tree_string = '(((A,B),C),D);'; my $tree = Bio::Phylo::IO->parse( '-string' => $tree_string, # old parser, always adds node labels '-format' => 'newick', )->first; # note: newick parsers return # 'Bio::Phylo::Forest'! Call # ->first to retrieve the first # tree of the forest. # prints 'Bio::Phylo::Forest::Tree' print ref $tree, "n"; # parsing a table my $table_string = qq(A,1,2|B,1,2|C,2,2|D,2,1); my $matrix = Bio::Phylo::IO->parse( '-string' => $table_string, '-format' => 'table', # Data type, see Bio::Phylo::Parsers::Table '-type' => 'STANDARD', # field separator '-fieldsep' => ',', # line separator '-linesep' => '|' ); # prints 'Bio::Phylo::Matrices::Matrix' print ref $matrix, "n"; # parsing a list of taxa my $taxa_string = 'A:B:C:D'; my $taxa = Bio::Phylo::IO->parse( '-string' => $taxa_string, '-format' => 'taxlist', '-fieldsep' => ':' ); # prints 'Bio::Phylo::Taxa' print ref $taxa, "n"; # matches taxon names in tree to $taxa object $tree->cross_reference($taxa); # likewise for matrix $matrix->cross_reference($taxa); print Bio::Phylo::IO->unparse( # pass the tree object, # crossreferenced to taxa, which # are crossreferenced to the matrix '-phylo' => $tree, '-format' => 'pagel' ); # prints a pagel data file: #4 2 #A,n1,0.000000,1,2 #B,n1,0.000000,1,2 #n1,n2,0.000000 #C,n2,0.000000,2,2 #n2,n3,0.000000 #D,n3,0.000000,2,1 Requirements: · Perl
Bio::Phylo::IO Related Software