* sync with trunk
[bioperl-live.git] / Bio / Factory / SequenceStreamI.pm
blob7884b420d7eb5cc41b2471f53c4e0bebd966f678
1 # $Id$
3 # BioPerl module for Bio::Factory::SequenceStreamI
5 # Cared for by Jason Stajich <jason@bioperl.org>
7 # Copyright Jason Stajich
9 # You may distribute this module under the same terms as perl itself
11 # POD documentation - main docs before the code
13 =head1 NAME
15 Bio::Factory::SequenceStreamI - Interface describing the basics of a Sequence Stream.
17 =head1 SYNOPSIS
19 # get a SequenceStreamI object somehow like with SeqIO
20 use Bio::SeqIO;
21 my $in = Bio::SeqIO->new(-file => '< fastafile');
22 while( my $seq = $in->next_seq ) {
25 =head1 DESCRIPTION
27 This interface is for describing objects which produces
28 Bio::PrimarySeqI objects or processes Bio::PrimarySeqI objects to a
29 data stream.
31 =head1 FEEDBACK
33 =head2 Mailing Lists
35 User feedback is an integral part of the evolution of this and other
36 Bioperl modules. Send your comments and suggestions preferably to
37 the Bioperl mailing list. Your participation is much appreciated.
39 bioperl-l@bioperl.org - General discussion
40 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
42 =head2 Reporting Bugs
44 Report bugs to the Bioperl bug tracking system to help us keep track
45 of the bugs and their resolution. Bug reports can be submitted via the
46 web:
48 http://bugzilla.open-bio.org/
50 =head1 AUTHOR - Jason Stajich
52 Email jason@bioperl.org
54 =head1 APPENDIX
56 The rest of the documentation details each of the object methods.
57 Internal methods are usually preceded with a _
59 =cut
62 # Let the code begin...
65 package Bio::Factory::SequenceStreamI;
66 use strict;
68 use base qw(Bio::Root::RootI);
70 =head2 next_seq
72 Title : next_seq
73 Usage : $seq = stream->next_seq
74 Function: Reads the next sequence object from the stream and returns it.
76 Certain driver modules may encounter entries in the stream that
77 are either misformatted or that use syntax not yet understood
78 by the driver. If such an incident is recoverable, e.g., by
79 dismissing a feature of a feature table or some other non-mandatory
80 part of an entry, the driver will issue a warning. In the case
81 of a non-recoverable situation an exception will be thrown.
82 Do not assume that you can resume parsing the same stream after
83 catching the exception. Note that you can always turn recoverable
84 errors into exceptions by calling $stream->verbose(2).
85 Returns : a Bio::Seq sequence object
86 Args : none
88 See L<Bio::Root::RootI>
90 =cut
92 sub next_seq {
93 shift->throw_not_implemented();
96 =head2 write_seq
98 Title : write_seq
99 Usage : $stream->write_seq($seq)
100 Function: writes the $seq object into the stream
101 Returns : 1 for success and 0 for error
102 Args : Bio::Seq object
104 =cut
106 sub write_seq {
107 shift->throw_not_implemented();
110 =head2 sequence_factory
112 Title : sequence_factory
113 Usage : $seqio->sequence_factory($seqfactory)
114 Function: Get the Bio::Factory::SequenceFactoryI
115 Returns : Bio::Factory::SequenceFactoryI
116 Args : none
119 =cut
121 sub sequence_factory{
122 shift->throw_not_implemented();