[Bioperl-l] Getting refseq (contigs) from Genbank

Wiepert, Mathieu Wiepert.Mathieu@mayo.edu
Wed, 31 Oct 2001 11:05:59 -0600

Thanks for the help, still no luck?  I tried this now

use Bio::DB::GenBank;
use Bio::SeqIO;

$gb = new Bio::DB::GenBank(-retrievaltype => 'tempfile' ,
                               -format => 'Fasta');
my $seq = $gb->get_Seq_by_acc('NT_004348');

$out = Bio::SeqIO->new('-file' => ">NT_004348.seq",
                         '-format' => 'fasta');

But get:
-------------------- EXCEPTION --------------------
MSG: Attempting to set the sequence to [<html] which does not look healthy
STACK Bio::PrimarySeq::seq
STACK Bio::PrimarySeq::new
STACK Bio::Seq::new /usr/lib/perl5/site_perl/5.6.0/Bio/Seq.pm:132
STACK Bio::SeqIO::fasta::next_primary_seq
STACK Bio::SeqIO::fasta::next_seq
STACK Bio::DB::WebDBSeqI::get_Seq_by_acc
STACK toplevel getcontigs.pl:8

I tried with and without the $gb->request_format('fasta'); line, same error.
I got that from the help on DB::GenBank

"Note that when querying for GenBank accessions starting with 'NT_' you will
need to call $gb->request_format('fasta') beforehand, because in GenBank
format (the default) the sequence part will be left out (the reason is that
NT contigs are rather annotation with references to clones). "