[Bioperl-l] Bio::DB::SeqFeature::Store delete() not working

Sendu Bala bix at sendu.me.uk
Wed Jan 31 14:47:03 UTC 2007


Sendu Bala wrote:
> Hi,
> 
> I'm trying to use Bio::DB::SeqFeature::Store delete() on a list of 
> Bio::SeqFeature::Annotated retrieved from the database. It doesn't work. 
> I presume I'm falling foul of the issue pointed out in the docs:
> 
> "WARNING: The current DBI::mysql implementation has some issues that
> need to be resolved, namely (1) normalized subfeatures are NOT
> recursively deleted; and (2) the deletions are not performed in a
> transaction."
> 
> Is there a trick to avoid the problem? Or, how might someone go about 
> improving the implementation so that it worked?

Actually, it was just a simple bug in 
Bio::DB::SeqFeature::Store::DBI::mysql::_deleteid()

I've committed a fix that I hope won't break anything; all I did was 
have it return the number of rows deleted, since 
Bio::DB::SeqFeature::Store::delete() needs a true return from 
_deleteid() or it will only delete the first feature supplied to it.
(I've left the current implementation for delete() which effectively 
gives up the moment a feature fails to be deleted, instead of trying to 
delete the remaining features it was supplied.)

I propose changing delete() to return the number of features it 
successfully deletes instead of boolean, to match store() behaviour. But 
that isn't so important.



More information about the Bioperl-l mailing list