[Bioperl-l] Bio::DB::SeqFeature::Store issues

Lincoln Stein lstein at cshl.edu
Tue Jan 23 20:08:21 UTC 2007


On 1/23/07, Sendu Bala <bix at sendu.me.uk> wrote:
>
> Hi,
>
> I'm trying to use Bio::DB::SeqFeature::Store for the first time and have
> come across some issues.
>
> Is the documentation accurate? The synopsis has:
>
> my $db = Bio::DB::SeqFeature::Store->new(-adaptor => 'DBI::mysql',
>                                           -dsn     => 'dbi:mysql:test',
>                                           -write   => 1 );
>
> but code for new() has:
>
> rearrange(['ADAPTOR',
>             'SERIALIZER',
>             'INDEX_SUBFEATURES',
>             'CACHE',
>             'COMPRESS',
>             'DEBUG',
>             'CREATE',], at _);
>
> Ie. naively -write doesn't do anything, and -create is undocumented. I
> needed to use -create to get it to work.


Some of the arguments are processed by the adaptor, in this case DBI::mysql.
Looks like the -create option needs to be documented.


Doc for store() says:
>
> Args    : list of Bio::SeqFeatureI objects
>
> But when I tried storing Bio::SeqFeature::Annotated objects I get this
> error:
>
> Transaction aborted because Can't locate object method "all_tags" via
> package "Bio::SeqFeature::Annotated" at
> /home/sendu/src/bioperl/core/Bio/DB/SeqFeature/Store/DBI/mysql.pm line
> 1300.
>
> Ie. mysql.pm _update_attribute_index() method expects a
> Bio::SeqFeature::Generic object (which has the all_tags method), not
> just a Bio::SeqFeatureI. In fact all_tags() is just an alias to
> SeqFeatureI's get_all_tags() which is deprecated. Likewise, the same
> issue applies for the Generic-specific each_tag_value() alias of the
> deprecated get_tag_values().


My error; I got confused between the old and new style deprecated. Now
fixed.


What might be the best way to resolve this? I'm thinking it would be
> harmless to at least change _update_attribute_index() to call the
> SeqFeatureI methods instead? Don't know if there's a desire to not use
> the deprecated methods at all.
>
>
Using separate annotation() objects converts a small data structure into a
large one. I use lightweight Bio::Graphics::FeatureBase as the base class
for Bio::DB::SeqFeature::NormalizedFeature, and avoiding the annotation
object allows me to store attributes in a nice normalized form in a set of
tables.

Lincoln


-- 
Lincoln D. Stein
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724
(516) 367-8380 (voice)
(516) 367-8389 (fax)
FOR URGENT MESSAGES & SCHEDULING,
PLEASE CONTACT MY ASSISTANT,
SANDRA MICHELSEN, AT michelse at cshl.edu



More information about the Bioperl-l mailing list