[Bioperl-l] How to retrieve a persistent object by bioperl-db?

Marc Logghe Marc.Logghe at ablynx.com
Fri Dec 7 08:33:17 UTC 2007


Hi,
The BOSC presentation of Hilmar is a very good way to start with.
Have a look at http://www.open-bio.org/bosc2003/slides/Persistent_Bioperl_BOSC03.pdf
Slide 18 for instance.
Regards,
Marc
 

> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
> bounces at lists.open-bio.org] On Behalf Of zhihuali
> Sent: vrijdag 7 december 2007 5:26
> To: bioperl-l at lists.open-bio.org
> Subject: [Bioperl-l] How to retrieve a persistent object by bioperl-db?
> 
> 
> Hi netters,
> 
> I've installed BioSQL and bioperl-db, and successfully created and stored
> a persistent object:
> 
> use strict;use warnings;use Bio::Seq;use Bio::DB::BioDB;
> my $dbadp=Bio::DB::BioDB->new(-database=>'biosql',
> -user=>'annoymous',                             -dbname=>'bioseqdb');
> 
> my $seqobj=Bio::Seq->new(-accession_number=>"test",                      -
> id=>"test1",                      -seq=>"AGCTAGCT",                      -
> version=>1);my $dbobj=$dbadp->create_persistent($seqobj);$dbobj-
> >create;$dbobj->commit;
> 
> It's successful because I found corresponding rows in the bioseqdb tables.
> 
> Now I want to retrieve the object back from the database. There's not much
> documents available and I've tried find_by_unique_key/primary_key but all
> failed. Maybe I didn't use them correctly. Could anyone give me an example
> as how to retrieve the stored Bio::Seq object?
> 
> Thanks a lot!
> 
> Zhihua Li
> _________________________________________________________________
> 用 Live Search 搜尽天下资讯!
> http://www.live.com/?searchOnly=true





More information about the Bioperl-l mailing list