[BiO BB] could not get annotation for DBSOURCE in GenBank

Renxue Wang rwang at bccrc.ca
Fri Apr 29 14:29:20 EDT 2005

Hi, There, 

I am working on a project that need extract "DBSOURCE" from GenBank record. I used Bio::AnnotationCollectionI for that. But somehow I cannot get "DBSOURCE" at all. When I tried to print out $key from my script, only "comment", "reference" and "origin" showed up. Tried many different ways but could not find "DBlink" or "DBSOURCE" anywhere. Anybody has an idea what is going on? Thanks a lot. 

Here is my code,
#!/usr/bin/perl -w

use strict;
use vars qw($USAGE);
use Getopt::Long;
use Bio::SeqIO; # for importing sequences and finding annotations
use Bio::AnnotationCollectionI;

$USAGE = "./test.pl [--help] [--notstrict] [--format seqformat] --input_pt --output_nt\n";

my ($input_pt,$sequenceformat,$notstrict,$printwidth,$output_nt, $help) =
    (undef, 'genbank', undef, 50, undef,  undef);
&GetOptions('input|i=s'              => \$input_pt,
            'output|o=s'             => \$output_nt,
            'format|f=s'             => \$sequenceformat,
            'notstrict|n'            => \$notstrict,
            'help|h'                 => \$help,

my $seq_in = Bio::SeqIO->new('-file' => "<$input_pt",
                       '-format' => 'genbank');
my $seq_out = Bio::SeqIO->new('-file' => ">$output_nt",
                        '-format' => 'fasta');

while (my $inseq = $seq_in->next_seq) {
    my $annotation = $inseq->annotation;
    for my $key ( $annotation->get_all_annotation_keys ) {
        print $key, "\n";

More information about the BBB mailing list