From b2c6392de58f66fe3be76a06c789ed187e456922 Mon Sep 17 00:00:00 2001
From: Elia Stupka <elia@sanger.ac.uk>
Date: Mon, 15 May 2000 12:08:29 +0000
Subject: [PATCH] Fixed delete_Gene bug!

---
 modules/Bio/EnsEMBL/DBSQL/Obj.pm | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/modules/Bio/EnsEMBL/DBSQL/Obj.pm b/modules/Bio/EnsEMBL/DBSQL/Obj.pm
index 076cef9d57..bba0caca18 100755
--- a/modules/Bio/EnsEMBL/DBSQL/Obj.pm
+++ b/modules/Bio/EnsEMBL/DBSQL/Obj.pm
@@ -1348,14 +1348,14 @@ sub delete_Gene{
    my ($self,$geneid) = @_;
    my @trans;
    my %exon;
-   my $translation;
+   my @translation;
    # get out exons, transcripts for gene. 
 
    my $sth = $self->prepare("select id,translation from transcript where gene = '$geneid'");
    $sth->execute;
    while( my $rowhash = $sth->fetchrow_hashref) {
        push(@trans,$rowhash->{'id'});
-       $translation = $rowhash->{'translation'};
+       push(@translation,$rowhash->{'translation'});
    }
 
    foreach my $trans ( @trans ) {
@@ -1366,9 +1366,11 @@ sub delete_Gene{
        }
    }
 
-   my $sth2 = $self->prepare("delete from translation where id = '$translation'");
-   $sth2->execute;
-
+   foreach my $translation (@translation) {
+       
+       my $sth2 = $self->prepare("delete from translation where id = '$translation'");
+       $sth2->execute;
+   }
    # delete exons, transcripts, gene rows
 
    foreach my $exon ( keys %exon ) {
-- 
GitLab