in reply to NCBI sequence fetching

Try catching those sequences which can't be downloaded. You can catch the BioPerl $obj->throw(); method from Bio::Root::root with a simple eval block.
Try something like this: (Not tested)
#!usr/bin/perl use English '-no_match_vars'; use strict; use warnings; use Bio::Perl; my $database = 'genbank'; my $format = 'fasta'; my @accessions = ( "bunch", "of", "accession", "numbers"); for my $i ( 0 ... 2000 ) { my $entry_id = $accessions[$i]; eval { my $sequence = get_sequence($database, $entry_id); write_sequence( '>-', $format, $sequence ); }; if ( $EVAL_ERROR ) { # Log Error here if an error occured print {*STDERR} "Could not download sequence: [$entry_id]\n"; } # If you need to keep track of count my $count = $i + 1; }

J,

Replies are listed 'Best First'.
Re^2: NCBI sequence fetching
by capemaster (Initiate) on May 12, 2009 at 10:06 UTC
    Thank you.
    I have tried the script but it has a strange behaviour: the sequences are fetched multiple times after an error.
      Hmmmmm, Do you mean after the error it continues trying to get the same sequence?
      It's in a for loop so should only try each one the entries once unless they appear multiple times in the array "@entries".
      Forgot to change this when I wrote the code but the for loop should be:
      for my $i ( 0 ... scalar @entries - 1 ) { }
      J,
        thank you, I'll test it as soon as possible...
        Happy hour time now :)

        Stefano