[Bioperl-l] Bio::DB::DBFetch question

Sean O'Keeffe seanok at gsf.de
Thu May 27 11:23:40 EDT 2004


Hi There,
I'm trying to convert a list of genbank/est ids to fasta sequences. I 
want to use the Bio::DB::DBFetch module.
Script I have written/plagiarised is as follows:

#!/usr/bin/perl

use lib "/usr/local/ensembl-20/bioperl-live";
use Bio::DB::DBFetch;
use Bio::SeqIO;

open (IN, "est-id.txt") || die "can't open input file $! \n";     # get 
filehandle to file containing list of id's

my $db = Bio::DB::DBFetch->new();    # make a new connection to DBFetch

my $seqio = $db->get_Stream_by_id(<IN>);    # get stream obj using 
filehandle

my $out = Bio::SeqIO->new(-file => ">est-id.fa", -format => 'Fasta');    
# specify output format

while ( my $seq = $seqio->next_seq() ) {$out->write_seq($seq); }    # do 
the conversion




Error to stdout is as follows:

"Can't use string ("") as a HASH ref while "strict refs" in use at 
/usr/local/ensembl-20/bioperl-live/Bio/DB/DBFetch.pm line 286, <IN> line 
4515188."


I've used the filename, filehandle (as shown) as well as an array 
reference to the id list.
A sample of the file list is below

AA000575
AA001887
AA002222
AA003931
AA004784
AA009419
AA009723
AA010084
AA010160
AA010193
AA010220
AA010230
AA012989
AA014259
AA018136
AA018184
AA018858
AA019868
AA020505
AA022701
AA023333

Can anyone open my eyes?
Thanks,
Sean.





More information about the Bioperl-l mailing list