[Bioperl-l] Re: should Bio::PrimarySeq be storage-independent after bioperl-db appear?

Juguang Xiao juguang at tll.org.sg
Mon May 19 12:40:20 EDT 2003


On Saturday, May 17, 2003, at 02:11  AM, Hilmar Lapp wrote:

> Why does it make it heavy? I don't quite understand that. The adaptor 
> is a singleton, so there is only a single instance per application. I 
> don't quite see why adding a pointer to a singleton makes an object 
> heavier than it was before (like a SeqI is anyway, and most sequence 
> objects you're dealing with is SeqIs, not PrimarySeqIs).
>

Sorry, I did not notice adaptor is a singleton. I did not, and cannot 
check in memory. I was wrong that I guess memory status by observing in 
debug, since I  cannot tell whether it is a  reference or an instance 
if debugger prints:

   DB<1> x $seq
0  Bio::Seq=HASH(0x490630)
    '_root_verbose' => 0
    'primary_seq' => Bio::DB::Persistent::PrimarySeq=HASH(0x829ea4)
       '_adaptor' => Bio::DB::BioSQL::PrimarySeqAdaptor=HASH(0x829ce8)

that my simple code is like:

my $seq = Bio::Seq->new(
     -namespace => 'juguang'
     -id => 'id1'
);

my $seq_adaptor = $db->get_object_adaptor('Bio::SeqI');

my $pseq = $seq_adaptor->find_by_unique_key($seq);
$seq = $pseq->obj;
; # break point.

And now, $seq is of a Bio::PrimarySeq, not a Bio::Seq, that i cannot 
control.

> If you remove the adaptor, you are removing the persistence 
> implementation by delegation. What is your proposal to maintain 
> persistence instead? Through a naming context?
>

Even if adaptor is removed from Bio::PrimarySeq, NOT 
Bio::DB::Persistence::PrimarySeq, we can use above code to re-generate 
a same persistence, no?

Thanks.

Juguang

------------ATGCCGAGCTTNNNNCT--------------
Juguang Xiao
Temasek Life Sciences Laboratory, National University of Singapore
1 Research Link,  Singapore 117604
juguang at tll.org.sg



More information about the Bioperl-l mailing list