Russell Smithies | 21 Jul 22:03 2013

Re: MSG: Response Error STACK: Error::throw when trying to download genbank files using GI

I think you'll only get the sequence back from the CDS feature so that may be the source of one of your first
error, try adding a test:

                if ( $feat_object->primary_tag eq "CDS" ) {
                        my $sequence_string  = $feat_object->spliced_seq->seq;

The second one is probably NCBI timing out. It's generally better to do a bulk download then post-process
with BioPerl to avoid this problem.


-----Original Message-----
From: bioperl-l-bounces <at> [mailto:bioperl-l-bounces <at>] On
Behalf Of Shaghayegh Hosseini
Sent: Saturday, 20 July 2013 1:29 a.m.
To: bioperl-l <at>
Subject: [Bioperl-l] MSG: Response Error STACK: Error::throw when trying to download genbank files
using GI


I am trying to fetch genebank features,here is the script

use strict;

use warnings;

use Bio::SeqIO;

use Bio::DB::EUtilities;

my $gi="385220095";

my  $factoryID = Bio::DB::EUtilities->new(-eutil => 'efetch',

                                          -db =>'protein',

                                          -rettype=> 'gbwithparts',

                                          -email=> 'x <at>',

                                          -id=>$gi) ;

my $gbfile="$gi.gbk";

$factoryID->get_Response(-file =>$gbfile);

my $seqio_object = Bio::SeqIO->new(-file =>"$gbfile",'protein');

while ( my $seq_object=$seqio_object->next_seq){

    for my $feat_object ($seq_object->get_SeqFeatures) {

        my $sequence_string = $feat_object->spliced_seq->seq;



I have got 2 problems

1. For some GIs I am getting (MSG: seq doesn' t validate, mismatch or MSG:
Got a sequence with no letters in it cannot guess alphabet )which is  annoying since I have about 2000 GIs  and
for half of them this warnings are there BUT  it  does the job.

2. After  downloading lets say 1000 file I am getting Error (MSG: Response Error STACK: Error::throw or Bad Gateway)

Please let me know what I have done wrong

This  is the ERROR for First problem

--------------------- WARNING ---------------------

MSG: seq doesn't validate, mismatch is 266299291214720428459636348159


------------- EXCEPTION: Bio::Root::Exception -------------

MSG: Attempting to set the sequence to [266299291214720428459636348159] which does not look healthy

STACK: Error::throw

STACK: Bio::Root::Root::throw /Bioperl/1.6.1/lib/perl5/Bio/Root/

STACK: Bio::PrimarySeq::seq /Bioperl/1.6.1/lib/perl5/Bio/

STACK: Bio::PrimarySeq::new Bioperl/1.6.1/lib/perl5/Bio/

STACK: Bio::Seq::new /Bioperl/1.6.1/lib/perl5/Bio/

STACK: Bio::SeqFeatureI::spliced_seq

Bioperl-l mailing list
Bioperl-l <at>

Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.