Bio::SeqIO
raw
Toolbar
Summary
Bio::SeqIO::raw - raw sequence file input/output stream
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
Do not use this module directly. Use it via the
Bio::SeqIO class.
Description
This object can transform Bio::Seq objects to and from raw flat
file databases.
Methods
Methods description
Title : next_seq Usage : $seq = $stream->next_seq() Function: returns the next sequence in the stream Returns : Bio::Seq object Args : |
Title : write_qual Usage : $stream->write_qual($seq) Function: writes the $seq object into the stream Returns : 1 for success and 0 for error Args : Bio::Seq object |
Title : write_seq Usage : $stream->write_seq($seq) Function: writes the $seq object into the stream Returns : 1 for success and 0 for error Args : Array of Bio::PrimarySeqI objects |
Methods code
sub _initialize
{ my($self,@args) = @_;
$self->SUPER::_initialize(@args);
if( ! defined $self->sequence_factory ) {
$self->sequence_factory(new Bio::Seq::SeqFactory
(-verbose => $self->verbose(),
-type => 'Bio::Seq'));
} } |
sub next_seq
{ my ($self,@args) = @_;
my $nextline = $self->_readline();
if( !defined $nextline ){ return undef; }
my $sequence = uc($nextline);
$sequence =~ s/\W//g;
return $self->sequence_factory->create(-seq => $sequence); } |
sub write_qual
{ my ($self,@seq) = @_;
my @qual = ();
foreach (@seq) {
unless ($_->isa("Bio::Seq::SeqWithQuality")){
warn("You cannot write raw qualities without supplying a Bio::Seq::SeqWithQuality object! You passed a ", ref($_), "\n");
next;
}
@qual = @{$_->qual};
if(scalar(@qual) == 0) {
$qual[0] = "\n";
}
$self->_print (join " ", @qual,"\n") or return;
}
return 1;
}
1; } |
sub write_seq
{ my ($self,@seq) = @_;
foreach my $seq (@seq) {
$self->throw("Must provide a valid Bio::PrimarySeqI object")
unless defined $seq && ref($seq) && $seq->isa('Bio::PrimarySeqI');
$self->_print($seq->seq, "\n") or return;
}
$self->flush if $self->_flush_on_write && defined $self->_fh;
return 1; } |
General documentation
User feedback is an integral part of the evolution of this
and other Bioperl modules. Send your comments and suggestions preferably
to one of the Bioperl mailing lists.
Your participation is much appreciated.
bioperl-l@bioperl.org - General discussion
http://www.bioperl.org/MailList.shtml - About the mailing lists
Report bugs to the Bioperl bug tracking system to help us keep track
the bugs and their resolution.
Bug reports can be submitted via email or the web:
bioperl-bugs@bio.perl.org
http://bugzilla.bioperl.org/
Ewan Birney <birney@ebi.ac.uk>
Lincoln Stein <lstein@cshl.org>
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _