1
# $Id: pln.pm,v 1.7 2002/10/22 07:38:42 lapp Exp $
2
# BioPerl module for Bio::SeqIO::pln
4
# Cared for by Aaron Mackey <amackey@virginia.edu>
6
# Copyright Aaron Mackey
8
# You may distribute this module under the same terms as perl itself
10
# POD documentation - main docs before the code
14
Bio::SeqIO::pln - pln trace sequence input/output stream
18
Do not use this module directly. Use it via the Bio::SeqIO class.
22
This object can transform Bio::Seq objects to and from pln trace
29
User feedback is an integral part of the evolution of this and other
30
Bioperl modules. Send your comments and suggestions preferably to one
31
of the Bioperl mailing lists. Your participation is much appreciated.
33
bioperl-l@bioperl.org - General discussion
34
http://bioperl.org/MailList.shtml - About the mailing lists
38
Report bugs to the Bioperl bug tracking system to help us keep track
39
the bugs and their resolution.
40
Bug reports can be submitted via email or the web:
42
bioperl-bugs@bio.perl.org
43
http://bugzilla.bioperl.org/
45
=head1 AUTHORS - Aaron Mackey
47
Email: amackey@virginia.edu
51
The rest of the documentation details each of the object
52
methods. Internal methods are usually preceded with a _
56
# Let the code begin...
58
package Bio::SeqIO::pln;
59
use vars qw(@ISA $READ_AVAIL);
61
# Object preamble - inherits from Bio::Root::Object
64
use Bio::Seq::SeqFactory;
66
push @ISA, qw( Bio::SeqIO );
69
eval { require Bio::SeqIO::staden::read; };
73
push @ISA, "Bio::SeqIO::staden::read";
80
$self->SUPER::_initialize(@args);
81
if( ! defined $self->sequence_factory ) {
82
$self->sequence_factory(new Bio::Seq::SeqFactory(-verbose => $self->verbose(), -type => 'Bio::Seq'));
84
unless ($READ_AVAIL) {
85
Bio::Root::Root->throw( -class => 'Bio::Root::SystemException',
86
-text => "Bio::SeqIO::staden::read is not available; make sure the bioperl-ext package has been installed successfully!"
94
Usage : $seq = $stream->next_seq()
95
Function: returns the next sequence in the stream
96
Returns : Bio::SeqWithQuality object
105
my ($seq, $id, $desc, $qual) = $self->read_trace($self->_fh, 'pln');
107
# create the seq object
108
$seq = $self->sequence_factory->create(-seq => $seq,
121
Usage : $stream->write_seq(@seq)
122
Function: writes the $seq object into the stream
123
Returns : 1 for success and 0 for error
124
Args : Bio::Seq object
130
my ($self,@seq) = @_;
133
foreach my $seq (@seq) {
134
$self->write_trace($fh, $seq, 'pln');
137
$self->flush if $self->_flush_on_write && defined $self->_fh;