[Bioperl-l] Error writing SequenceProcessor to associate GO terms in biosql database

Hilmar Lapp hlapp at drycafe.net
Sat Aug 20 01:02:12 UTC 2011


Hi Adam 

I'm not sure whether you've received a response to this. Apologies if not. There is indeed a NOT NULL constraint on seqfeature_qualifier_value.value. The only other metadata association table in BioSQL that does this is location_qualifier_value. In the latter case there is arguably some sense to that (at least originally for locations the purpose of that table was pretty much to store the fuzzy location start/end properties), but for seqfeatures this looks like a bug to me. I'll post this to the BioSQL list and fix it f there are no objections, but feel free to drop the NOT NULL on that column yourself in the meantime.

The INSERT query gets constructed in the innards of Bioperl-db. There is no reason to mess with that for this problem though - just drop the NOT NULL constraint.

-hilmar

Sent with a tap.

On Jul 26, 2011, at 10:07 AM, Adam Witney <awitney at sgul.ac.uk> wrote:

> 
> Hi,
> 
> I'm trying to write a SequenceProcessor for a genbank file to associate GO terms to the GO data preloaded in my biosql database. The command looks like this:
> 
> perl load_seqdatabase.pl --dbname=biosql --driver=Pg --host=myhost --port= 5432 --dbuser=user --dbpass=pass -format genbank -namespace testing -pipeline 'GOSequenceProcessor' --debug S_sonnei.EB1_s_sonnei.dat
> 
> The SequenceProcessor process_seq looks like this:
> 
> sub process_seq{
>    my ($self,$seq) = @_;
>    
>       my @features = $seq->get_SeqFeatures();
>       foreach my $feat ( @features ) {
>        if ( $feat->has_tag('db_xref') ) {
>            my @db_xrefs = $feat->get_tag_values('db_xref');
>            
>            foreach my $db_xref (@db_xrefs) {
>                if ( $db_xref =~ m/^GO:/ ) {
>                    my $term = Bio::Annotation::OntologyTerm->new(-identifier => $db_xref,
>                                                                    -ontology => 'Gene Ontology');
>                    $feat->annotation->add_Annotation($term);    
>                }
>            }
>        }
>    }    
>    
>    return ($seq);
> }
> 
> But this gives this error:
> 
> preparing INSERT statement: INSERT INTO seqfeature_qualifier_value (seqfeature_id, term_id, rank) VALUES (?, ?, ?)
> TermAdaptor::add_assoc: binding column 1 to "935181" (FK to Bio::SeqFeature::Generic)
> TermAdaptor::add_assoc: binding column 2 to "50253" (FK to Bio::Annotation::OntologyTerm)
> TermAdaptor::add_assoc: binding column 3 to "1" (rank)
> 
> --------------------- WARNING ---------------------
> MSG: TermAdaptor::add_assoc: unexpected failure of statement execution: ERROR:  null value in column "value" violates not-null constraint
>        name: INSERT ASSOC [1] Bio::SeqFeature::Generic;Bio::Annotation::OntologyTerm
> STACK Bio::DB::BioSQL::BasePersistenceAdaptor::add_association /var/users/adam/BioPerl/bioperl-db/lib//Bio/DB/BioSQL/BasePersistenceAdaptor.pm:458
> STACK Bio::DB::BioSQL::AnnotationCollectionAdaptor::add_association /var/users/adam/BioPerl/bioperl-db/lib//Bio/DB/BioSQL/AnnotationCollectionAdaptor.pm:468
> STACK Bio::DB::BioSQL::SeqFeatureAdaptor::store_children /var/users/adam/BioPerl/bioperl-db/lib//Bio/DB/BioSQL/SeqFeatureAdaptor.pm:304
> STACK Bio::DB::BioSQL::BasePersistenceAdaptor::create /var/users/adam/BioPerl/bioperl-db/lib//Bio/DB/BioSQL/BasePersistenceAdaptor.pm:227
> STACK Bio::DB::BioSQL::BasePersistenceAdaptor::store /var/users/adam/BioPerl/bioperl-db/lib//Bio/DB/BioSQL/BasePersistenceAdaptor.pm:264
> STACK Bio::DB::Persistent::PersistentObject::store /var/users/adam/BioPerl/bioperl-db/lib//Bio/DB/Persistent/PersistentObject.pm:284
> STACK Bio::DB::BioSQL::SeqAdaptor::store_children /var/users/adam/BioPerl/bioperl-db/lib//Bio/DB/BioSQL/SeqAdaptor.pm:257
> STACK Bio::DB::BioSQL::BasePersistenceAdaptor::create /var/users/adam/BioPerl/bioperl-db/lib//Bio/DB/BioSQL/BasePersistenceAdaptor.pm:227
> STACK Bio::DB::BioSQL::BasePersistenceAdaptor::store /var/users/adam/BioPerl/bioperl-db/lib//Bio/DB/BioSQL/BasePersistenceAdaptor.pm:264
> STACK Bio::DB::Persistent::PersistentObject::store /var/users/adam/BioPerl/bioperl-db/lib//Bio/DB/Persistent/PersistentObject.pm:284STACK (eval) /var/users/adam/BioPerl/bioperl-db/scripts/biosql/load_seqdatabase.pl:630
> STACK toplevel /var/users/adam/BioPerl/bioperl-db/scripts/biosql/load_seqdatabase.pl:612
> 
> As you can see it generates an INSERT against seqfeature_qualifier_value without including a 'value' field, which is of course defined as NOT NULL.
> 
> Firstly, is this the best way to achieve this? And secondly, where is the INSERT statement put together, I can't seem to find it in the object hierarchy
> 
> Thanks
> 
> adam
> 
> 
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l




More information about the Bioperl-l mailing list