[Bioperl-l] "jump" to the right sequence in a SeqIO object
cjfields at uiuc.edu
Mon Jan 29 22:18:53 EST 2007
On Jan 29, 2007, at 8:23 PM, zhihua li wrote:
> hi netters,
> suppose I read in a multi-fasta file to a SeqIO object:
> my $seqinput=Bio::SeqIO->new(-file=>'~/file.txt',
> 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);
> 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?
There are several flat database implementations which would do what
you want. Look at the POD for Bio::DB::Fasta, Bio::Index::Fasta, as
well as the FAQ, the tutorial, and the Flat Database HOWTO, all of
which have more information.
More information about the Bioperl-l