[Bioperl-l] Bio::DB::GenBank get_seq_by_acc

Edith Schlagenhauf ediths at botinst.unizh.ch
Thu Jul 3 14:18:26 EDT 2003


Hi James,


On Thu, 3 Jul 2003, James Wasmuth wrote:

> Hi all,
>
> I using the below script:
>
>
> use Bio::DB::GenBank;
> my @query_acc = qw/AF043104 CE24123 AF172351 AF435952/;
> $embl=new Bio::DB::GenBank;
> foreach $acc (@query_acc)       {
>     print ":$acc:\n";
>     $seq = $embl->get_Seq_by_acc($acc);
>     ...
>     ...
> }

if you specify the database in query_acc array like:

my @query_acc = qw/gb|AF043104 gb|AF172351 gb|AF435952/;

# don't know what db for CE24123 entry is

it works.

I.e. the script below works in my case:

use Bio::DB::GenBank;

my @query_acc = qw/gb|AF043104 gb|AF172351 gb|AF435952/;
$embl=new Bio::DB::GenBank;
foreach $acc (@query_acc)       {
    print STDOUT "\$acc is: $acc\n";
    $seqObj = $embl->get_Seq_by_acc($acc);
    $primary_id = $seqObj->primary_id();
    print "\$primary_id is: $primary_id\n";
}



Edith


******************************************

Dr Edith Schlagenhauf
Bioinformatics
Institute of Plant Biology
University of Zurich
Zollikerstrasse 107
CH-8008 Zurich
SWITZERLAND

e-mail: ediths AT botinst DOT unizh DOT ch
Tel.:	+41 1 634 82 56
Fax :	+41 1 634 82 04

******************************************



More information about the Bioperl-l mailing list