This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Efetch from nuccore db using URL / Perl fails with Bad Gateway error for GenBank, but succeeds for FASTA.

Hello all,

My previously working perl script to fetch a given region suddenly has failed. I use the Bio::DB::EUtilities library as shown below.

    use strict;
    use warnings;
    use Bio::DB::EUtilities;

    my $result = Bio::DB::EUtilities->new(                  -eutil => 'efetch',
                                            -db => 'nucleotide',
                                            -rettype => 'gb',
                                            -email => 'validemail@gmail.com'
                                            );

    $result->set_parameters(     -id => '568815579',
                             -seq_start => '1',
                             -seq_stop => '100',
                             -strand => '2'
                            );

    $result->get_Response(-file => 'result.gb');

However, the above code works if I change the "rettype" parameter from gb to fasta. I tried the web (URL) version to debug and I noticed similar behavior. The same URL with FASTA as rettype worked, but if the rettype was changed to gb it failed with a bad gateway error.

This URL below works for the FASTA format

    https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nuccore&id=568815579&strand=2&seq_start=1&seq_stop=100&rettype=fasta&retmode=text

This URL for GB format fails with a Bad Gateway error after a few minutes

https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nuccore&id=568815579&strand=2&seq_start=1&seq_stop=100&rettype=gb&retmode=text

Can some one please advice on what I'm doing wrong, or if anything has changed recently in efetch usage?

Thank you

Senthil

eftech nuccore nucelotide

0 answers

No answers yet.

Log in to answer this question.