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

zhihua li lzhtom at hotmail.com
Tue Jan 30 02:23:49 UTC 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