[Bioperl-l] fetch method of Bio::Index::Fasta

Simon Chan schan@xenongenetics.com
Mon, 15 Apr 2002 14:23:49 -0700


Hi All,

I'm trying to index a bunch of fasta files for easy sequence fetching.
So, I take a look at Bio::Index::Fasta

my $Index = Bio::Index::Fasta->new( -filename => "output", -write_flag => 1);

### Each element of @array contains path to fasta file
$Index->make_index(@array);


foreach my $id (@array) {

        my $line = $Index->fetch($id);  
        print "ID: " . $line->display_id() . " \n";


}



In the docs, it says that the fetch method returns a Seq object.  Thus, I can run
the Seq methods, like display_id(), desc(), etc.  However, running the fetch method
appears to not return anything to me!  Therefore, once I get to the print line, the
program dies because I'm trying to call a method on an undefined variable. That is,
$line is undefined.


Perhaps, there is more documentation to view?  I've taken a look at:
http://doc.bioperl.org/releases/bioperl-1.0/Bio/Index/AbstractSeq.html#POD2

Well, that's about it.  Many thanks for your input, All! ;-)

Simon

######################################


*************************************************************************
This email message is confidential and may contain privileged information. Any unauthorized dissemination or copying is strictly prohibited. If you have received it in error, please delete it and notify us immediately.