[Bioperl-l] "jump" to the right sequence in a SeqIO object

zhihua li lzhtom at hotmail.com
Mon Jan 29 21:23:49 EST 2007


hi netters,

suppose I read in a multi-fasta file to a SeqIO object:

my $seqinput=Bio::SeqIO->new(-file=>'~/file.txt',
                                             -format=>'Fasta');

This file contains 100 fasta sequences.  Right now I only want to deal with 
two 
of them, with the display ID "X" and "Y" respectively.
Normally what I'd do is to write a loop to "capture" these two:
my ($X, $Y);
while($seqinput->nextseq){
     if($_->id="X"){$X=$_;}
     if($_->id="Y"){$Y=$_;}
    }

My question is, is there some other way to do that? Is it possible to 
locate the two
sequences that have the display ID as "X" and "Y" directly, without looping 
through
the whole list?

Thanks a lot!

_________________________________________________________________
Ãâ·ÑÏÂÔØ MSN Explorer:   http://explorer.msn.com/lccn/  



More information about the Bioperl-l mailing list