[Bioperl-l] How to retrieve a persistent object by bioperl-db?
Hilmar Lapp
hlapp at gmx.net
Mon Jan 7 03:02:32 UTC 2008
Hi Zhihua, you didn't ever respond to Marc's link to the Persistent
Bioperl slides - did that help?
-hilmar
On Dec 6, 2007, at 11:25 PM, zhihuali wrote:
>
> 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
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
--
===========================================================
: Hilmar Lapp -:- Durham, NC -:- hlapp at gmx dot net :
===========================================================
More information about the Bioperl-l
mailing list