[BioSQL-l] bioperl-db bugs

Hilmar Lapp hlapp at gmx.net
Sun Mar 9 23:38:18 UTC 2008


Hi Chris,

I added comments to both bug reports. This belongs to BioPerl,  
though, as it has only to do with its language binding.

The tidbit may be worth keeping in mind for a general BioSQL audience  
is that bioentry namespace (foreign key to biodatabase) is part of  
the (compound) bioentry unique keys. The identifier column used to be  
unique by itself (and could still be made such in a local instance,  
there's a comment to this effect in the DDL), but that was changed a  
while ago. (Also, if one uses any of the Bio* language bindings,  
changing a unique key constraint to something that differs from what  
the language binding assumes may be asking for a lot of trouble.  
Bioperl-db will expect the combination of primary_id() and namespace 
() to match if the latter is provided.)

	-hilmar

On Mar 5, 2008, at 6:24 PM, Chris Fields wrote:

> Hilmar,
>
> I think I have two bioperl-db bugs sorted out, but I'm trying to  
> determine whether the solution is a side-effect, a feature, or a  
> bug.  Dmitry has filed two bug reports which are somewhat related:
>
> http://bugzilla.open-bio.org/show_bug.cgi?id=2280
> http://bugzilla.open-bio.org/show_bug.cgi?id=2281
>
> I have added my comments to it, but maybe you can shed some more  
> light on this.  What he is trying to do is copy a persistent Seq  
> object to a different namespace; load_seqdatabase.pl won't let him  
> do that directly using the same sequence file.  If he changes the  
> namespace() and store()s it using a script, the seq is moved to the  
> new namespace, not updated.
>
> My reasoning is this is a feature (by not changing the primary_key,  
> you don't store a new sequence but update the current one).   
> However, if the primary_key is unset (undef), then it appears you  
> can copy the sequence over (from Dmitry's script, with my addition  
> noted):
>
> ...
> my $ns1 = 'space1';
> my $ns2 = 'space2';
>
> my $seqadp = $db->get_object_adaptor('Bio::SeqI');
> my $aux_seq = Bio::Seq::RichSeq->new(
>     -accession_number => 'NC_005982',
>     -version => 1,
>     -namespace => $ns1);
> my $seq = $seqadp->find_by_unique_key($aux_seq);
>
> # store the found sequence in the second biodatabase:
> my $pseq = $seqadp->create_persistent($ns2);
> $pseq->namespace('bioperl2');
> $pseq->primary_key(undef);  # my addition, which appears to work
> $pseq->store();
> $seqadp->commit;
> ...
>
> My question: is this an intended effect?  The ability to assign  
> undef to primary_key seems intentional based on the method code,  
> but I'm a bit uncertain here.
>
> chris
> _______________________________________________
> BioSQL-l mailing list
> BioSQL-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biosql-l

-- 
===========================================================
: Hilmar Lapp  -:-  Durham, NC  -:-  hlapp at gmx dot net :
===========================================================






More information about the BioSQL-l mailing list