The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Bio::Phylo::Adaptor - Object adaptor for compatibility

SYNOPSIS

 # load adaptor class
 use Bio::Phylo::Adaptor;

 # going to build Bio::Phylo tree
 use Bio::Phylo::Forest::Tree;
 my $tree = Bio::Phylo::Forest::Tree->new;

 $Bio::Phylo::COMPAT = 'Bioperl';

 my $bptree = Bio::Phylo::Adaptor->new($tree);

 # $tree is now bioperl compatible
 print "bioperl compatible!" if $bptree->isa('Bio::Tree::TreeI'); 

DESCRIPTION

The adaptor architecture is used to make Bio::Phylo objects compatible with other software (currently only bioperl) using the Adaptor design pattern (e.g. see the page on the Portland Pattern Repository: http://www.c2.com/cgi/wiki?AdapterPattern). The compatibility mode can be defined globally at compile time by specifying:

 use Bio::Phylo compat => 'Bioperl';

In which case all objects are instantiated as adapted objects automatically from within their respective constructors. Alternatively, adapted objects can be created by setting the $Bio::Phylo::COMPAT variable and passing 'raw' Bio::Phylo objects to the Bio::Phylo::Adaptor constructor.

METHODS

CONSTRUCTOR

new
 Type    : Constructor
 Title   : new
 Usage   : my $adapted = Bio::Phylo::Adaptor->new($obj);
 Function: Instantiates an adapted Bio::Phylo object.
 Returns : An object compatible with whatever $Bio::Phylo::COMPAT
           is set to.
 Args    : An object to adapt
 Comments: This method depends on a correct setting of the global
           $Bio::Phylo::COMPAT setting.

SEE ALSO

Bio::Phylo::Manual

Also see the manual: Bio::Phylo::Manual.

REVISION

 $Id: Adaptor.pm 4265 2007-07-20 14:14:44Z rvosa $