[Bioperl-l] how to use BioQuery
Juguang Xiao
juguang at tll.org.sg
Mon Jun 9 12:27:25 EDT 2003
>
> How to use BioQuery is the most undocumented piece of the story.
> t/query.t is probably the single most useful place to get a grasp of
> what the ideas are. It may also be useful to check in the
> Bio/DB/BioSQL directory for adaptors that implement (i.e., override)
> attach_children() and attach_foreign_key_objects() to how to find
> objects by foreign key or by association.
>
In which module the mapping from bioperl module name, say Bio::SeqI, to
schema table name, bioentry (I guess) is defined?
> Also, the mapping and translation code in BioQuery.pm is not very
> robust. I had to write it in a crunch and have since never found the
> time to rewrite it such that it becomes at least remotely
> comprehensible. There may be lots of bugs lurking, as it is not really
> tested beyond what t/query.t and the adaptors test.
I have the similar sick code to use BioQuery. Can dear doctor help to
diagnose it? :-) Thanks.
The scripts:
use Bio::DB::BioDB;
my $db = Bio::DB::BioDB->new(
-database => 'biosql',
-host => 'mysql-dev',
-dbname => 'juguang_biosql_embl',
-driver => 'mysql',
-user => 'root'
);
use Bio::DB::Query::BioQuery;
my $query = Bio::DB::Query::BioQuery->new(
-datacollections => [
'Bio::SeqI seq', 'Bio::Species=>Bio::SeqI sp'],
-where => ['sp.name like ?']
);
my $seq_adaptor = $db->get_object_adaptor('Bio::SeqI');
my $result = $seq_adaptor->find_by_query($query,
-values => ['house mouse']
);
while(my $seq = $result->next_object){
print ref($seq) ."\n";
}
######################################
The error message:
------------- EXCEPTION -------------
MSG: slot 'name' not mapped to column for table taxon_name
STACK Bio::DB::Query::BioQuery::_map_slot_to_col
/Home_R1/juguang/src/bioperl-db//Bio/DB/Query/BioQuery.pm:487
STACK Bio::DB::Query::BioQuery::_map_constraint_slots_to_columns
/Home_R1/juguang/src/bioperl-db//Bio/DB/Query/BioQuery.pm:369
STACK Bio::DB::Query::BioQuery::translate_query
/Home_R1/juguang/src/bioperl-db//Bio/DB/Query/BioQuery.pm:305
STACK Bio::DB::BioSQL::BaseDriver::translate_query
/Home_R1/juguang/src/bioperl-db//Bio/DB/BioSQL/BaseDriver.pm:1097
STACK Bio::DB::BioSQL::BasePersistenceAdaptor::find_by_query
/Home_R1/juguang/src/bioperl-db//Bio/DB/BioSQL/
BasePersistenceAdaptor.pm:1154
STACK toplevel find_by_species.pl:22
Juguang
More information about the Bioperl-l
mailing list