[BioSQL-l] adding non-positional features via bioperl to a biosql database
James Procter
jimp at compbio.dundee.ac.uk
Tue Feb 10 19:14:01 UTC 2009
Hi. Apologies if this is not the right place to post Bioperl/BioSQL
issues, feel free to tell me where to go, after you've read the following:
I have been using a sequence pipeline to add in non-positional features
to sequences whilst uploading to a bioSQL database. A fragment of the
code I tried to use is below:
sub process_seq {
my ($self, $seq) = @_;
my ($dbid, $id) = extract_dbid($seq);
my $tags = {'label'=>"".$dbid."_$id",
'notes'=>["".$dbid.":$id"]};
my $feat = Bio::SeqFeature::Generic->new(
-start=>'0',-end=>'0',
-primary_tag => 'dbref',
-tag=>$tags,
-strand => 0,
-source_tag => 'ATB');
$seq->add_SeqFeature($feat);
$seq->version('1')
$seq->alphabet('protein')
return $seq;
}
When I use this, the sequences are uploaded fine, and they have the
correct non-positional features when I look at the tables, and when I
access the database via Biojava. However, when I try to dump any of the
features with Bioperl I get the following warning :
--------------------- WARNING ---------------------
MSG: Calling end without a defined start position
---------------------------------------------------
And if I try to add any more features to the sequence and then store the
updated object I get the following exception in addition to the above
warning.
------------- EXCEPTION: Bio::Root::Exception -------------
MSG: number of slots must equal the number of values
STACK: Error::throw
STACK: Bio::Root::Root::throw
/gpfs/gjb_lab/ws-dev1/servers/lib/perl/lib/perl5/Bio/Root/Root.pm:357
STACK: Bio::DB::BioSQL::BaseDriver::update_object
/gpfs/gjb_lab/ws-dev1/servers/lib/perl/lib/perl5/Bio/DB/BioSQL/BaseDriver.pm:1075
STACK: Bio::DB::BioSQL::BasePersistenceAdaptor::store
/gpfs/gjb_lab/ws-dev1/servers/lib/perl/lib/perl5/Bio/DB/BioSQL/BasePersistenceAdaptor.pm:269
STACK: Bio::DB::Persistent::PersistentObject::store
/gpfs/gjb_lab/ws-dev1/servers/lib/perl/lib/perl5/Bio/DB/Persistent/PersistentObject.pm:271
STACK: Bio::DB::BioSQL::SeqFeatureAdaptor::store_children
/gpfs/gjb_lab/ws-dev1/servers/lib/perl/lib/perl5/Bio/DB/BioSQL/SeqFeatureAdaptor.pm:278
Can someone help me out here ? It seems that bioperl doesn't like
features with a start/end of '0' - in which case, how do I create
non-positional sequence features in a way that bioperl likes ?
I'm using a nightly build from December 2008 - but there have been
(afaict) no patches to the biosql or Feature::Generic which would fix
this behaviour.
thanks.
jim
--
-------------------------------------------------------------------
J. B. Procter (ENFIN/VAMSAS) Barton Bioinformatics Research Group
Phone/Fax:+44(0)1382 388734/345764 http://www.compbio.dundee.ac.uk
The University of Dundee is a Scottish Registered Charity, No. SC015096.
More information about the BioSQL-l
mailing list