[Bioperl-l] Re: undef strand and biosql

Hilmar Lapp hlapp at gnf.org
Mon Mar 1 14:57:51 EST 2004


Hm. Strand being undef is a soft violation, in the sense that there is  
a value defined for 'unknown strand' (namely 0).

Bottom line is that an undef strand should not lead to failure. I'll  
either fix bioperl-db to automatically substitute 0 for undef, or we  
could fix bioperl to return 0 if the strand hasn't been set yet.

The latter is risky because then it is difficult to impossible to ask  
whether the strand has already been set but is unknown, or whether it's  
never been set and therefore you want to set a default.

Any votes from the bioperl'ers out there on this question? I'm afraid  
my vote would go for not returning 0 by default in the location object.

Actually, we could also put a DEFAULT 0 in the column definition in the  
schema DDL. That doesn't necessarily fix it in all RDBMSs though if you  
directly assign NULL to the column (e.g., in Oracle). Any votes on that  
from the biosql community?

	-hilmar

On Monday, March 1, 2004, at 09:21  AM, matthieu CONTE wrote:

> I solve the problem of 'source_term_id'  by create -source_tag =>  
> 'tigr'...and it seems to be ok......
>
> "$seq->add_SeqFeature(new Bio::SeqFeature::Generic(
> 		-primary => 'RIGHT_UTR',
> 		-source_tag => 'tigr',
> 		-start   ..........
> "
> But it still have a  problem of undef column 'strand'
> Maybe in :
> $loc->add_sub_Location(new Bio::Location::Simple(
> 		-start => $e->{'start'},
> 		-end   => $e->{'end'},
>                                -strand => ????
> ));
> but I’m also confuse with the tag: “strand” of Bio::SeqFeature::Generic
>
> I have this warning:
> -------------------- WARNING ---------------------
> MSG: insert in Bio::DB::BioSQL::LocationAdaptor (driver) failed,  
> values were ("1","318","","1") FKs (16957,<NULL>)
> Column 'strand' cannot be null
> ---------------------------------------------------
> Could not store 8356.t04040:
> ------------- EXCEPTION  -------------
> MSG: create: object (Bio::Location::Simple) failed to insert or to be  
> found by unique key
> STACK Bio::DB::BioSQL::BasePersistenceAdaptor::create  
> /usr/local/ActivePerl-5.8/lib/site_perl/5.8.0/Bio/DB/BioSQL/ 
> BasePersistenceAdaptor.pm:207
> STACK Bio::DB::BioSQL::BasePersistenceAdaptor::store  
> /usr/local/ActivePerl-5.8/lib/site_perl/5.8.0/Bio/DB/BioSQL/ 
> BasePersistenceAdaptor.pm:253
> STACK Bio::DB::Persistent::PersistentObject::store  
> /usr/local/ActivePerl-5.8/lib/site_perl/5.8.0/Bio/DB/Persistent/ 
> PersistentObject.pm:270
> STACK Bio::DB::BioSQL::SeqFeatureAdaptor::store_children  
> /usr/local/ActivePerl-5.8/lib/site_perl/5.8.0/Bio/DB/BioSQL/ 
> SeqFeatureAdaptor.pm:278
> STACK Bio::DB::BioSQL::BasePersistenceAdaptor::create  
> /usr/local/ActivePerl-5.8/lib/site_perl/5.8.0/Bio/DB/BioSQL/ 
> BasePersistenceAdaptor.pm:215
> STACK Bio::DB::BioSQL::BasePersistenceAdaptor::store  
> /usr/local/ActivePerl-5.8/lib/site_perl/5.8.0/Bio/DB/BioSQL/ 
> BasePersistenceAdaptor.pm:253
> STACK Bio::DB::Persistent::PersistentObject::store  
> /usr/local/ActivePerl-5.8/lib/site_perl/5.8.0/Bio/DB/Persistent/ 
> PersistentObject.pm:270
> STACK Bio::DB::BioSQL::SeqAdaptor::store_children  
> /usr/local/ActivePerl-5.8/lib/site_perl/5.8.0/Bio/DB/BioSQL/ 
> SeqAdaptor.pm:246
> STACK Bio::DB::BioSQL::BasePersistenceAdaptor::create  
> /usr/local/ActivePerl-5.8/lib/site_perl/5.8.0/Bio/DB/BioSQL/ 
> BasePersistenceAdaptor.pm:215
> STACK Bio::DB::BioSQL::BasePersistenceAdaptor::store  
> /usr/local/ActivePerl-5.8/lib/site_perl/5.8.0/Bio/DB/BioSQL/ 
> BasePersistenceAdaptor.pm:253
> STACK Bio::DB::Persistent::PersistentObject::store  
> /usr/local/ActivePerl-5.8/lib/site_perl/5.8.0/Bio/DB/Persistent/ 
> PersistentObject.pm:270
> STACK (eval) load_seqdatabase.pl:517
> STACK toplevel load_seqdatabase.pl:500
>
>
>
>
> -----------------------------------------------------------
> Matthieu CONTE
> M. Sc. in Bioinformatics from SIB
>
> CIRAD-Biotrop TA40/03
> Avenue Agropolis
> 34398 Montpellier Cedex 5
> FRANCE
>
> m_conte at hotmail.com
> tel: (33)04 67 61 60 21
> fax :(33) 4 67 61 56 05
>
> -----------------------------------------------------------
>
>
>
>
>
>> From: Hilmar Lapp <hlapp at gnf.org>
>> To: Josh Lauricha <laurichj at cs.ucr.edu>
>> CC: "matthieu CONTE" <m_conte at hotmail.com>, bioperl-l at bioperl.org
>> Subject: Re: [Bioperl-l] Re: Bio ::seqIO ::tigr
>> Date: Fri, 27 Feb 2004 16:45:13 -0800
>>
>>
>> On Thursday, February 26, 2004, at 09:45  AM, Josh Lauricha wrote:
>>
>>> Does the source_term_id refer to the source_tag()?
>>
>> Yes.
>>
>>>
>>> On Feb 26, 2004, at 9:08 AM, matthieu CONTE wrote:
>>>
>>>> [conte at bearn biosql]$ perl load_seqdatabase.pl --dbuser biosql  
>>>> --dbpass biosql --namespace orysa_tigr --format tigr  
>>>> /home/conte/pipeline_orthologues/data/orysa_tigr/chr07.xml
>>>> Loading /home/conte/pipeline_orthologues/data/orysa_tigr/chr07.xml  
>>>> ...
>>>>
>>>> -------------------- WARNING ---------------------
>>>> MSG: insert in Bio::DB::BioSQL::SeqFeatureAdaptor (driver) failed,  
>>>> values were ("","1") FKs (26216,37,<NULL>)
>>>> Column 'source_term_id' cannot be null
>>>> ---------------------------------------------------
>>>>
>>
>> What this means is that there was no $feat->source_tag set, and  
>> looking up undef resulted in undef for the foreign key :-)
>>
>> While bioperl doesn't enforce it, for biosql the source_tag() as well  
>> as the primary_tag() of a feature are mandatory and cannot be undef.  
>> Most SeqIO parsers set source_tag() to a static default if there is  
>> no value, e.g. 'EMBL/GenBank/SwissProt' if you're using FTHelper.pm.
>>
>> 	-hilmar
>> --
>> -------------------------------------------------------------
>> Hilmar Lapp                            email: lapp at gnf.org
>> GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
>> -------------------------------------------------------------
>>
>>
>
> _________________________________________________________________
> MSN Messenger : discutez en direct avec vos amis !  
> http://www.msn.fr/msger/default.asp
>
>
-- 
-------------------------------------------------------------
Hilmar Lapp                            email: lapp at gnf.org
GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
-------------------------------------------------------------





More information about the Bioperl-l mailing list