in reply to Not sure about Bio::SeqIO
Bio::SeqIO next_seq returns Bio::Seq objects. Follow the SYNOPSIS and you can't go wrong.
You can do magic stuff if you want to treat it like a filehandle too (although I doubt this is what you were trying to do)my $seqio = Bio::SeqIO->new(-format => $seqformat, -file =>$filename); while( my $seq = $seqio->next_seq ) { print "seq name is ", $seq->display_id, " desc is ", $seq->description(), "\n"; print "sequence is ", $seq->seq(), "\n"; }
You can also process filehandles (all XXIO modules in Bioperl support this if the inherit from Bio::Root::IO). Usefile if you are pipine output from a program with your script and want to capture the stream and make it Bio::Seq objects.my $fh = Bio::SeqIO->newFh(-format =>$seqformat, -file =>$filename); while(<$fh>) { my $seq = $_; # do as before }
my $fh; open($fh, "cat seqfile |") ||die $!; my $seqio = Bio::SeqIO->new(-format => $seqformat, -fh => $fh); # OR retrieve a sequence from the blast formatted db 'nt' # by GI number open(IN, "fastacmd -d nt -s 3264957 |") ||die $!; my $seqio = Bio::SeqIO->new(-format => 'fasta',-fh => \*IN); while( my $seq = $seqio->next_seq ) { #and so forth.... }
|
|---|