[Bioperl-l] how to use BioQuery

Michael Thon mrthon at unity.ncsu.edu
Sat Jun 7 15:55:16 EDT 2003


I've set up a bioperldb database and loaded a few sequences with
annotations.  Now I'm trying to figure out how to perform some basic
queries using Bio::DB::Query::BioQuery.

I'm trying to write a simple script to return all sequences that have a
Bio::Annotation::SimpleValue with a tagname of 'interpro'.  I've been
looking at code in t/query.t included with bioperl-db and at
documentation in various bioperl modules but I still haven't figured out
how to use BioQuery objects.

The following lines:

my $seqadaptor = $db->get_object_adaptor('Bio::SeqI');
my $query = Bio::DB::Query::BioQuery->new(
  '-where' => ["Bio::Annotation::SimpleValue::tagname = interpro"],
  '-datacollections'   
          => ["Bio::PrimarySeqI<=>Bio::Annotation::SimpleValue"]);

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

returns this error:

------------- EXCEPTION  -------------
MSG: error while executing query in
Bio::DB::BioSQL::SeqAdaptor::find_by_query: Unknown column 'interpro' in
'where clause'
STACK Bio::DB::BioSQL::BasePersistenceAdaptor::find_by_query
/usr/lib/perl5/site_perl/5.8.0/Bio/DB/BioSQL/BasePersistenceAdaptor.pm:1200
STACK toplevel bioquery2.pl:26
 
--------------------------------------

Can anyone provide some pointers about how to perform this type of
query?
Thanks
Mike




More information about the Bioperl-l mailing list