This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How To Get Genbank File Using Bioperl

I currently have the following:

use Bio::SeqIO;

$seqio_obj = Bio::SeqIO->new(-file => "J01673.gb", -format => "genbank" );
$seq_obj = $seqio_obj->next_seq;

I am not able to get output using above code.

bioperl

That's because none of that code generates any output.

Have you already downloaded the file J01673.gb or are you trying to get BioPerl to download it for you? See Hernan's reply below.

1 answer

May be something like:

use Bio::DB::GenBank;
$gb = new Bio::DB::GenBank(-retrievaltype => 'tempfile' , -format => 'gb');
$seqio_object = $gb->get_Stream_by_id(['J00522']);
while( my $seq = $seqio_object->next_seq ) {
    $seqio_object->write_seq($seq);}

Log in to answer this question.