[ensembl-dev] Deleting DnaAlignFeatures?

Andy Yates ayates at ebi.ac.uk
Thu May 17 08:50:27 BST 2012


Hi Dan,

The DnaAlignFeatureAdaptor is one way only. We've never had the need to implement a remove AFAIK. Since all Ensembl DBs have a surrogate key deletion of just the feature reasonably simple thing to do. It obviously gets a little bit harder when you propagate the delete to supporting features, if your alignment features are linked to exons/transcripts.


All the best,

Andy

Sent from my mobile.

On 16 May 2012, at 18:38, Dan Bolser <dbolser at ebi.ac.uk> wrote:

> On 16 May 2012 18:34, Dan Bolser <dbolser at ebi.ac.uk> wrote:
>> Hi,
>> 
>> How can I use a DnaAlignFeature adaptor and some DnaAlignFeatures
>> retrieved from within it to delete those features from the database?
>> 
>> Here is a snippet of code:
>> 
>> $reg->load_registry_from_db(
>> ...
>>    my $dafa = $reg->
>>      get_adaptor( $species, 'core', 'DnaAlignFeature' );
>> ...
>>            my $dafs = $dafa->fetch_all_by_hit_name( $hit_name );
>>            my @best = sort { ... } @$dafs
>> 
>>            delete_dafs_somhow( @best[1:-1] )
> 
> Sorry, I meant to say "@best[1..$#best]" obviously ;-)
> 
> 
>> ...
>> 
>> 
>> 
>> Cheers,
>> Dan.
> 
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> List admin (including subscribe/unsubscribe): http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/




More information about the Dev mailing list