Bio::ObjectCompat

Bio::ObjectCompat offers object compatibility for phylogenetic software in OO Perl.
Download

Bio::ObjectCompat Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Rutger A. Vos
  • Publisher web site:
  • http://search.cpan.org/~rvosa/Bio-Phylo-0.17_RC6/lib/Bio/ObjectCompat.pod

Bio::ObjectCompat Tags


Bio::ObjectCompat Description

Bio::ObjectCompat offers object compatibility for phylogenetic software in OO Perl. Bio::ObjectCompat offers object compatibility for phylogenetic software in OO Perl.AbstractThis document describes the steps required to obtain object compatibility between three software packages written in object-oriented perl5: Bio::Perl, Bio::NEXUS and Bio::Phylo. Of these three, BioPerl is by far the most commonly used, largest and oldest project. We therefore suggest an approach that requires minimal, optional changes on its part, playing to the strength of its design in using interfaces such as Bio::Tree::TreeI and Bio::Tree::NodeI. We are implementing several new such interfaces, in particular for characters or character sequences, character state matrices and a character-data-and-tree object that forms a container for comparative data and phylogenetic trees. Implementation of these interfaces is largely left to Bio::NEXUS and Bio::Phylo, which thereby become compatible, such that users can draw on the strengths of both packages more easily.IntroductionPhylogenetic analysis is a field that, from a programmer's perspective, deals with a limited set of objects: trees which are comprised of nodes, matrices which are comprised of character sequences of some sort, and a containing context to describe the relationship between the two: a character-data-and-tree object.Object-oriented perl5Objects in perl5 are references to data structures 'blessed into' a package, which defines the methods implemented by the object. Perl5 allows for multiple inheritance either by using the base pragma or by manipulating the @ISA array. Runtime modification of the inheritance tree and the symbol table allows for optional implementation of java-like interfaces, so that classes from different packages can become loosely coupled through the interfaces they implement. These properties can be used to make different packages written in object-oriented perl5 object-compatible.Phylogenetic software packagesSeveral software libraries written in object-oriented perl5 now exist that all implement objects from the phylogenetic problem space - though all in slightly different ways. The largest among these packages is Bio::Perl, which is widely used by molecular biologists around the world. BioPerl's architecture is broad, with branches being maintained by many different developers who maintain compatibility with each other by implementing interfaces such as Bio::Tree::TreeI, Bio::Tree::NodeI (see also: http://search.cpan.org/~birney/bioperl-1.4/biodesign.pod). Here we will describe how two smaller packages, Bio::NEXUS and Bio::Phylo can be modified to become compatible with BioPerl so that their respective strengths become more easily accessible to the BioPerl user community. The approach we suggest may be a model for other phylogenetic software written in OO perl5, with BioPerl taking on the role of defining the standard interfaces - a kind of W3C for phyloinformatics.Interface conventions in BioPerlThe typical approach taken in BioPerl is that java-like interfaces are defined in classes whose name are suffixed with an 'I', e.g. Bio::Tree::TreeI. These classes inherit from Bio::Root::RootI, which defines exception handling methods.The interfaces are never instantiated directly. Rather, the implementation class objects such as Bio::Tree::Tree are instantiated by the IO system, in this case Bio::TreeIO.The interfaces define method names to be implemented, throwing throw_not_implemented exceptions when the code blocks are ever executed. Classes in BioPerl such as Bio::Tree::Tree implement the actual subroutines defined in the interfaces they contain in their @ISA arrays, in this case Bio::Tree::TreeI, thereby preventing these exceptions from ever being thrown.BioPerl's general design philosophy is that "complex" operations (generally, anything that is computationally intensive and/or requires external tools) are provided by separate factory classes that operate on the objects. The basic objects modelling biological data (trees, matrices) are therefore intentionally fairly concise.Optional interface inheritanceThird-party packages can become compatible with BioPerl by defining using base which BioPerl interfaces they implement (and then correctly implementing the methods defined in the interface). However, this creates a permanent compile time dependency between it and BioPerl. A more dynamic option is by testing at runtime whether an interface is installed, and only then inheriting from it by including the class in the @ISA array.I (RAV) found that in many instances the interface defined methods only differ slightly from those implemented natively by the Bio::Phylo classes (e.g. return values passed as a list versus an array reference), so implementing adaptor classes to create object compatibility with bioperl was fairly straightforward - as shown in the Bio::Phylo::Adaptor architecture.The Bio::NEXUS::Tree and Bio::NEXUS::Node object could be modified in a similar way, such that tree objects and node objects from Bio::NEXUS can similarly masquerade as BioPerl objects. Requirements: · Perl


Bio::ObjectCompat Related Software