diff variant_effect_predictor/Bio/EnsEMBL/Variation/Pipeline/RebuildIndexes.pm @ 0:1f6dce3d34e0

Uploaded
author mahtabm
date Thu, 11 Apr 2013 02:01:53 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/variant_effect_predictor/Bio/EnsEMBL/Variation/Pipeline/RebuildIndexes.pm	Thu Apr 11 02:01:53 2013 -0400
@@ -0,0 +1,25 @@
+package Bio::EnsEMBL::Variation::Pipeline::RebuildIndexes;
+
+use strict;
+use warnings;
+
+use base qw(Bio::EnsEMBL::Variation::Pipeline::BaseVariationProcess);
+
+sub run {
+
+    my $self = shift;
+    
+    my $tables = $self->param('tables');
+
+    my $var_dba = $self->get_species_adaptor('variation');
+
+    my $dbc = $var_dba->dbc;
+
+    for my $table (@$tables) {
+        $dbc->do("ALTER TABLE $table ENABLE KEYS")
+            or warn "Failed to enable keys on $table";
+    }
+}
+
+1;
+