[BioSQL-l] [Newbie] find_by_query() usage ?
Mark Hoebeke
mhoebeke@jouy.inra.fr
Mon, 6 Jan 2003 12:02:43 +0100
Hi all,
I just managed to load some whole genomes into my BioSQL compliant
database, but now I run into troubles when trying to retrieve them
with the following script Perl script:
<snip>
my $dbadap= Bio::DB::BioDB->new(
-database => 'biosql',
-dbname => $dbname,
-user => $dbuser,
-host => $dbhost,
-driver => $dbdriver);
my $objadap=$dbadap->get_object_adaptor("Bio::SeqI");
my $query=Bio::DB::Query::BioQuery->new();
my $result=$objadap->find_by_query();
foreach my $obj ($result->each_Object()) {
print "Id : $obj->display_id\n";
}
</snip>
This script fails in the find_bu_query() method call, with an error
message like this (topmost exeception) :
DBD::Pg::st execute failed: ERROR: parser: parse error at or near "." at character 8 at /usr/lib/perl5/site_perl/5.8.0/Bio/DB/BioSQL/BasePersistenceAdaptor.pm line 1083.
A quick investigation traced to problem to be in the SQL generation
code as the query string is as follows :
SELECT .bioentry_id, .display_id, .identifier, .accession,
.description, .entry_version, .biodatabase_id, .taxon_id FROM
Obvisously, the table name(s) is (are) missing in the query string.
I guess the creation of the Bio::DB::Query::BioQuery instance may be
wrong. I read through the POD files, and the sample scripts to find an
example based on the find_by_query() method but found none.
Thanks for any pointers showing how to use the find_by_query method.
Mark
P.S. : sorry if this message is more related to BioPerl than to BioSQL...
--
mhoebeke@jouy.inra.fr _/ _/ _/_/_/ _/_/_/
Tel : (+33) 01 34 65 28 85 _/_/ _/_/ _/ _/
Fax : (+33) 01 34 65 29 01 _/ _/ _/ _/ _/ _/_/
INRA - Unité MIG - Domaine de Vilvert _/ _/ _/ _/ _/
F - 78352 Jouy-en-Josas CEDEX _/ _/ _/_/_/ _/_/_/