[Bioperl-l] Bio::Annotation issues with BioSQL

Mark Johnson johnsonm at gmail.com
Mon Aug 18 20:53:48 UTC 2008

    I'm presently refactoring an in-house protein annotation pipeline
and converting it to use BioSQL as a data store.  I've noticed some
slightly screwy behavior with regard to how some of the
Bio::Annotation classes are handled:

-Instances of Bio::Annotation::SimpleValue and
Bio::Annotation::StructuredValue attached to the annotation collection
for a sequence feature (Bio::SeqFeature::Generic) are converted to
tags/values on the feature.
-Instances of Bio::AnnotationDBLink with attached comments loose the comment.

    I'm storing and retrieving things thusly:

my $dbadp = Bio::DB::BioDB->new(
                                                   -database => 'biosql',
                                                   -user        => $user',
                                                   -pass       => $pass,
                                                   -dbname  => $ora_instance,
                                                   -driver      => 'Oracle'

my $adp = $dbadp->get_object_adaptor("Bio::SeqI");

my $seq = Bio::Seq->new(
                        -id                         => 'DEBUG001',
                        -accession_number => 'DBG001',
                        -desc                     => 'Debug Sequence',
                        -seq                      => 'GATTACA',
                        -namespace           => 'DEBUG',

my $feature = Bio::SeqFeature::Generic->new(
                                            -seq_id           => 'DEBUG001',
                                            -display_name => 'FEAT0001',
                                            -primary          => 'debug',
                                            -source           => 'test',
                                            -start              => 3,
                                            -end               => 5,
                                            -strand           => 1,

my $dblink = Bio::Annotation::DBLink->new(

-database   => 'FAKE001',

-primary_id => 'FK1234567890'',

-comment    => 'This is a fake comment',

$feature->annotation->add_Annotation('ANNO0001, $dblink);

my $pseq = $dbadp->create_persistent($seq);


my $dbadp = Bio::DB::BioDB->new(

my $adp = $dbadp->get_object_adaptor("Bio::SeqI");

my $query = Bio::DB::Query::BioQuery->new();

                         "Bio::PrimarySeqI s",

$query->where(["s.display_id like DEBUG%'"]);

my $result = $adp->find_by_query($query);

while (my $seq = $result->next_object()) {

    my @features = $seq->get_SeqFeatures();

    foreach my $feature (@features) {

        ## Contents of Bio::Annotation::SimpleValue and
Bio::Annotation::StructeredValue have
        ## migrated to tag/value pairs on $feature and are missing
from $annotation_collection.
        ## Comments have gone missing from Bio::Annotation::DBLink,
but DBLinks are otherwise intact and present.
        my $annotation_collection = $feature->annotation();



    Is bioperl-db / BioSQL trying to tell me that I shouldn't be using
Bio::Annotation::SimpleValue and Bio::Annotation::StructuredValue?  Is
there even a place in the BioSQL schema for a comment to be attached
to a DBLink?

More information about the Bioperl-l mailing list