[Bioperl-l] Using SeqIO

Brian Carlson bcarlson at genetics.emory.edu
Thu Mar 13 13:41:06 EST 2003


I expect that I'll have to rewind.  Since the 36'ers will be be from
several difference sequences, I expect to rewind once I find one 36'er. 
I just don't want to have to keep opening/closing the fasta file.  I'm
sorry, before when I was saying "re-read" I meant to say close &
re-open.

Brian

On Thu, 2003-03-13 at 13:34, Brian Osborne wrote:
> Brian,
> 
> So you want code that gets multiple 36 bp sequences from 1 sequence so you
> don't have to rewind?
> 
> Brian O.
> 
> 
> -----Original Message-----
> From: bioperl-l-bounces at bioperl.org [mailto:bioperl-l-bounces at bioperl.org]On
> Behalf Of Brian Carlson
> Sent: Thursday, March 13, 2003 12:40 PM
> To: bioperl
> Subject: [Bioperl-l] Using SeqIO
> 
> 
> I have the need to extract 1000's of 36bp sequences from a fasta file.
> >From previous help, I've have this sample code (snippet) extracting some
> sequence:
> 
> $in = new Bio::SeqIO ( -format=>'fasta', -file=>'mouse_T3.fasta');
> while (my $seq = $in->next_seq)
> {
>   if ($seq->desc eq $target_description)
>   {
>     print "Description : " . $seq->desc . "\n";
>     $seq = $seq->trunc($start, $stop);
>     print "BP $start-$stop : " . $seq->seq . "\n";
>     last;
>   }
> }
> 
> 
> But it would seem slow to keep re-reading the fasta each time I wanted
> to extract the sequence.  How do you just "rewind" it back to the
> beginning?  Or do I have to just re-read it?
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
> 
> 


More information about the Bioperl-l mailing list