[Bioperl-l] Inherent graph on classes in Bio::Search?

Chris Fields cjfields at illinois.edu
Sun Jun 6 19:23:44 EDT 2010


Within Bio::Search, the hierarchy is easy enough.  I'll leave out the full namespace for now to make this easier.  Each ResultI object represents a single report; it may have multiple HitI objects (the hits), which further have multiple HSPI objects (the high-scoring paired alignments).  Depending on the parser and the need for additional methods, each ResultI/HitI/HSPI may be implemented generically (GenericResult/Hit/HSP) or more specifically (e.g. ModelHit), but all observe the common interface (ResultI/HitI/HSPI) methods.  

So, you can hierarchically iterate through all the data in a report as follows:

while (my $result = $in->next_result) {
   # grab ResultI stuff here
   while (my $hit = $result->next_hit) {
      # grab HitI stuff here
      while (my $hsp = $hit->next_hsp) {
          # grab HSPI stuff here

Much of this is already in the HOWTO.  Not sure how much more we can explain to you via email.  If you are really concerned about the objects returned to look up specific methods, just check them with ref() to get the class.

Re: module usage: the module usage and inheritance graph for BioPerl is extremely complicated, but if you have a checkout of the git repo you can generate some of these using the (completely unsupported, don't ask for help :) module_usage.pl script in the maintenance folder.  I agree a simple graphic might help; feel free to contribute one if you have the time.


On Jun 6, 2010, at 5:29 PM, Peng Yu wrote:

> There are many classes defined in Bio::Search, which is confusing to
> new users. Is there an inherentance graph and a dependency graph to
> help new users understand how they work?
> http://search.cpan.org/~cjfields/BioPerl-1.6.1/Bio/Search/HSP/GenericHSP.pm
> For example, Bio::Search::HSP::GenericHSP is an implementation of
> Bio::Search::HSP::HSPI (if I'm correct), which is documented in the
> text. But I feel it would be much easier to see this relationship, if
> this is drawn graphically.
> -- 
> Regards,
> Peng
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

More information about the Bioperl-l mailing list