[Bioperl-l] Downloading a sequence in genbank format - related problem

Barry Moore barry.moore at genetics.utah.edu
Wed May 16 21:13:27 UTC 2007


Diogo,

I'd guess that this is a result of NCBI terminating the connection as  
Chris suggested previously.  There are a number of approaches you  
could use:  Download only fasta if that's all you need.  Download  
only IDs, and then use SeqHound, Batch Entrez or BioPerl to download  
those sequences or you could download the genbank files from the ftp  
site as Chris also suggested, and then run a bioperl script on each  
of those files.  I can see that you are looking at Trypanosomes, so  
doing this (on linux or  Mac OSX):

wget ftp://ftp.ncbi.nih.gov/genbank/gbinv*.seq.gz

will get you the 10 files in the invertebrate division from GenBank,  
and you could run a bioperl script  on those 10 files.

Barry

On May 16, 2007, at 2:02 PM, Diogo Tschoeke wrote:

> Dear all,
>
> The script wich i wrote with your helps is working very good ( I  
> paste the
> script in the end of e-mail).
> But I have another problem now, all the times wich I use the script  
> im every
> all the file have a diferent size...
> Any ideia? what is the problem..? My conection? Problem on Ncbi?  
> The script
> maybe?
>
> Diogo Tschoeke
> Laboratory of Molecular Biology of Trypanosomatides
> Fundação Osvaldo Cruz - Fiocruz RJ, Brazil
> http://biowebdb.org
>
> #############################################################
> use strict;
> use warnings;
> use Bio::Seq;
> use Bio::SeqIO;
> use Bio::DB::GenBank;
> my $query = Bio::DB::Query::GenBank->new
>                                 (-query   =>'Trypanosoma cruzi  
> [Organism]',
>                                 -db      => 'nucleotide');
> my $gb = new Bio::DB::GenBank;
> my $seqio = $gb->get_Stream_by_query($query);
> my $out = Bio::SeqIO->new(-format => 'genbank',
>                           -file => '>>Trypanosoma_cruzi1.gb');
> while (my $seq = $seqio->next_seq){
>          $out->write_seq($seq);
>                         }
> #########################################################
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l





More information about the Bioperl-l mailing list