* sync with trunk
[bioperl-live.git] / Bio / AnalysisParserI.pm
bloba537ab76d36035b17982adb05a39b8ba7e3fc934
1 #---------------------------------------------------------------
2 # $Id$
4 # BioPerl module Bio::AnalysisParserI
6 # Cared for by Steve Chervitz <sac@bioperl.org>
8 # Derived from Bio::SeqAnalysisParserI by Jason Stajich, Hilmar Lapp.
10 # You may distribute this module under the same terms as perl itself
11 #---------------------------------------------------------------
13 =head1 NAME
15 Bio::AnalysisParserI - Generic analysis output parser interface
17 =head1 SYNOPSIS
19 # get a AnalysisParserI somehow.
20 # Eventually, there may be an Bio::Factory::AnalysisParserFactory.
21 # For now a SearchIO object, an implementation of AnalysisParserI, can be created
22 # directly, as in the following:
23 my $parser = Bio::SearchIO->new(
24 '-file' => 'inputfile',
25 '-format' => 'blast');
27 while( my $result = $parser->next_result() ) {
28 print "Result: ", $result->analysis_method,
29 ", Query: ", $result->query_name, "\n";
31 while( my $feature = $result->next_feature() ) {
32 print "Feature from ", $feature->start, " to ",
33 $feature->end, "\n";
37 =head1 DESCRIPTION
39 AnalysisParserI is a interface for describing generic analysis
40 result parsers. This module makes no assumption about the nature of
41 analysis being parsed, only that zero or more result sets can be
42 obtained from the input source.
44 This module was derived from Bio::SeqAnalysisParserI, the differences being
46 =over 4
48 =item 1. next_feature() was replaced with next_result().
50 Instead of flattening a stream containing potentially multiple
51 analysis results into a single set of features, AnalysisParserI
52 segments the stream in terms of analysis result sets
53 (Bio::AnalysisResultI objects). Each AnalysisResultI can then be
54 queried for its features (if any) as well as other information
55 about the result
57 =item 2. AnalysisParserI is a pure interface.
59 It does not inherit from Bio::Root::RootI and does not provide a new()
60 method. Implementations are free to choose how to implement it.
62 =back
64 =head2 Rationale (copied from Bio::SeqAnalysisParserI)
66 The concept behind this interface is to have a generic interface in sequence
67 annotation pipelines (as used e.g. in high-throughput automated
68 sequence annotation). This interface enables plug-and-play for new analysis
69 methods and their corresponding parsers without the necessity for modifying
70 the core of the annotation pipeline. In this concept the annotation pipeline
71 has to rely on only a list of methods for which to process the results, and a
72 factory from which it can obtain the corresponding parser implementing this
73 interface.
75 =head2 TODO
77 Create Bio::Factory::AnalysisParserFactoryI and
78 Bio::Factory::AnalysisParserFactory for interface and an implementation.
79 Note that this factory could return Bio::SearchIO-derived objects.
81 =head1 FEEDBACK
83 =head2 Mailing Lists
85 User feedback is an integral part of the evolution of this
86 and other Bioperl modules. Send your comments and suggestions preferably
87 to one of the Bioperl mailing lists.
88 Your participation is much appreciated.
90 bioperl-l@bioperl.org - General discussion
91 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
93 =head2 Reporting Bugs
95 Report bugs to the Bioperl bug tracking system to help us keep track
96 the bugs and their resolution. Bug reports can be submitted via the
97 web:
99 http://bugzilla.open-bio.org/
101 =head1 AUTHOR - Steve Chervitz, Jason Stajich, Hilmar Lapp
103 Email sac@bioperl.org
105 Authors of Bio::SeqAnalysisParserI on which this module is based:
106 Email jason@bioperl.org
107 Email hlapp@gmx.net
109 =head1 COPYRIGHT
111 Copyright (c) 2001 Steve Chervitz. All Rights Reserved.
113 =head1 DISCLAIMER
115 This software is provided "as is" without warranty of any kind.
117 =head1 APPENDIX
119 The rest of the documentation details each of the object methods.
120 Internal methods are usually preceded with a _
122 =cut
124 package Bio::AnalysisParserI;
125 use strict;
128 use base qw(Bio::Root::RootI);
130 =head2 next_result
132 Title : next_result
133 Usage : $result = $obj->next_result();
134 Function: Returns the next result available from the input, or
135 undef if there are no more results.
136 Example :
137 Returns : A Bio::Search::Result::ResultI implementing object,
138 or undef if there are no more results.
139 Args : none
141 =cut
143 sub next_result {
144 my ($self);
145 $self->throw_not_implemented;
150 __END__
152 NOTE (sac): My ten-month old son Russell added the following line.
153 It doesn't look like it will compile so I'm putting it here:
154 mt6 j7qa