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

Hilmar Lapp hlapp at gmx.net
Tue Aug 19 17:56:42 UTC 2008

On Aug 18, 2008, at 4:53 PM, Mark Johnson wrote:

>    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::Annotation::DBLink with attached comments loose  
> the comment.
> [...]
> $query->where(["s.display_id like DEBUG%'"]);

There's a single quote missing here, but I'm assuming that's a result  
of copy/paste editing?

> [...]
>    Is bioperl-db / BioSQL trying to tell me that I shouldn't be using
> Bio::Annotation::SimpleValue and Bio::Annotation::StructuredValue?

Your example code doesn't contain an example for where you are getting  
the B::A::StructuredValue object from. If you didn't create that  
yourself, it would be good to know what you did to end up with that.  
Chris Fields has written B::A::Tagtree which would be way forward, and  
if you created the object yourself, can you take a look at that and  
see whether that class wouldn't serve your purpose as well or even  

In order to be stored in BioSQL structured (hierarchical, nested)  
annotation is flattened into a string representation, because BioSQL  
can't store nested annotation collections natively. Right now if I am  
not mistaken upon retrieval this is not converted back into a  
B::A::Tagtree object but rather left flat. This is being worked on  
though, we've just discussed some issues connected with that.

I could make B::A::StructuredValue work the same way, but I'm not sure  
what it provides that B::A::Tagtree doesn't. The latter uses  
Data::Stag under the hood, which is much cleaner, and more extensible  
in the future.

As for SimpleValue annotation versus tag/value annotation for  
seqfeatures, yes right now these are treated interchangeably for the  
purposes of BioSQL and Bioperl-db. You can do this easily too on your  
end by using Bio::SeqFeature::AnnotationAdaptor.

> Is there even a place in the BioSQL schema for a comment to be  
> attached
> to a DBLink?

No there isn't. I thought it is but it turns out that this isn't yet  
one of the desirable extensions to BioSQL from 1.1.x onwards, as  
documented on the wiki:


I'll add it (but feel free to do so yourself, especially if you have  
other enhancmenets).

: Hilmar Lapp  -:-  Durham, NC  -:-  hlapp at gmx dot net :

More information about the Bioperl-l mailing list