[Bioperl-l] Downloading a sequence in genbank format
Barry Moore
barry.moore at genetics.utah.edu
Tue May 15 23:17:39 UTC 2007
Diogo-
write_seq expects to be given a Bio::Seq object, not a Bio::SeqIO
object. Try this
use strict;
use warnings;
use Bio::Seq;
use Bio::SeqIO;
use Bio::DB::GenBank;
my $query = Bio::DB::Query::GenBank->new
(-query =>'Leishmania major
[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 => '>>teste6.gb');
while (my $seq = $seqio->next_seq) {
$out->write_seq($seq);
}
Barry
On May 15, 2007, at 4:44 PM, Diogo Tschoeke wrote:
> Dear All,
>
> I need to download a lot of sequence of Leishmania major in genbank
> format...
> But i can't download on the page of NCBI, because the downloaded
> file are
> corrupted... when i use a browser to download this sequences
> And them i looking for some script to download that`s file and fink
> something like that:
>
>
> #########################################################
> use strict;
> use warnings;
>
> use Bio::Seq;
> use Bio::SeqIO;
> use Bio::DB::GenBank;
>
> my $query = Bio::DB::Query::GenBank->new
> (-query =>'Leishmania major
> [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 => '>>teste6.gb');
> $out->write_seq($seqio);
> #########################################################
>
> And the system return me this erros
> [diogo1 at genome perl]$ perl teste6.pl
>
> -------------------- WARNING ---------------------
> MSG: Bio::SeqIO::genbank=HASH(0x96c0f08) is not a SeqI compliant
> module.
> Attempting to dump, but may fail!
> ---------------------------------------------------
> Can't locate object method "seq" via package "Bio::SeqIO::genbank" at
> /usr/lib/perl5/site_perl/5.8.8/Bio/SeqIO/genbank.pm line 692.
>
> Any Ideia?
>
> Thank`s
>
> Diogo Tschoeke
> Laboratory of Molecular Biology of Trypanosomatides
> Fundação Osvaldo Cruz - Fiocruz RJ, Brazil
> http:biowebdb.org <http://www.ncbs.res.in/>
>
> _______________________________________________
> 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