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

Adam Witney awitney at sgul.ac.uk
Tue Jul 26 15:07:05 UTC 2011


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







More information about the Bioperl-l mailing list