Archive Ensembl HomeArchive Ensembl Home
MyISAMiseTables_conf.pm
Go to the documentation of this file.
00001 
00002 =pod 
00003 
00004 =head1 NAME
00005 
00006   Bio::EnsEMBL::Compara::PipeConfig::MyISAMiseTables_conf
00007 
00008 =head1 SYNOPSIS
00009 
00010     init_pipeline.pl Bio::EnsEMBL::Compara::PipeConfig::MyISAMiseTables_conf -password <your_password>
00011 
00012 =head1 DESCRIPTION  
00013 
00014     A pipeline to turn all release tables into MyISAM
00015 
00016 =head1 CONTACT
00017 
00018   Please contact ehive-users@ebi.ac.uk mailing list with questions/suggestions.
00019 
00020 =cut
00021 
00022 package Bio::EnsEMBL::Compara::PipeConfig::MyISAMiseTables_conf;
00023 
00024 use strict;
00025 use warnings;
00026 
00027 use base ('Bio::EnsEMBL::Compara::PipeConfig::ComparaGeneric_conf');
00028 
00029 =head2 default_options
00030 
00031     Description : Implements default_options() interface method of Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf that is used to initialize default options.
00032                   In addition to the standard things it defines four options:
00033                     o('fixing_capacity')   defines how many tables can be worked on in parallel
00034                 
00035                   There are rules dependent on two options that do not have defaults (this makes them mandatory):
00036                     o('password')       your read-write password for creation and maintenance of the hive database
00037 
00038 =cut
00039 
00040 sub default_options {
00041     my ($self) = @_;
00042     return {
00043         'ensembl_cvs_root_dir' => $ENV{'ENSEMBL_CVS_ROOT_DIR'},
00044 
00045         'pipeline_name' => 'myisamise_compara_release',            # name used by the beekeeper to prefix job names on the farm
00046 
00047         'pipeline_db' => {
00048             -host   => 'compara2',
00049             -port   => 3306,
00050             -user   => 'ensadmin',
00051             -pass   => $self->o('password'),
00052             -dbname => $ENV{USER}.'_'.$self->o('pipeline_name'),
00053         },
00054 
00055         'rel_db' => {
00056             -host   => 'compara1',
00057             -port   => 3306,
00058             -user   => 'ensadmin',
00059             -pass   => $self->o('password'),
00060             -dbname => 'kb3_ensembl_compara_59',
00061         },
00062 
00063         'fixing_capacity'  => 10,                                  # how many tables can be worked on in parallel (too many will slow the process down)
00064     };
00065 }
00066 
00067 =head2 pipeline_create_commands
00068 
00069     Description : Implements pipeline_create_commands() interface method of Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf that lists the commands that will create and set up the Hive database.
00070                   In addition to the standard creation of the database and populating it with Hive tables and procedures it also creates a directory for storing the output.
00071 
00072 =cut
00073 
00074 sub pipeline_create_commands {
00075     my ($self) = @_;
00076     return [
00077         @{$self->SUPER::pipeline_create_commands},  # inheriting database and hive tables' creation
00078     ];
00079 }
00080 
00081 =head2 pipeline_analyses
00082 
00083     Description : Implements pipeline_analyses() interface method of Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf that defines the structure of the pipeline: analyses, jobs, rules, etc.
00084                   Here it defines two analyses:
00085 
00086                     * 'generate_job_list'   generates a list of tables to be copied from master_db
00087 
00088                     * 'myisamise_table'     turn that table's engine into MyISAM
00089 
00090 =cut
00091 
00092 sub pipeline_analyses {
00093     my ($self) = @_;
00094     return [
00095         {   -logic_name => 'generate_job_list',
00096             -module     => 'Bio::EnsEMBL::Hive::RunnableDB::JobFactory',
00097             -parameters => {
00098                 'db_conn'         => $self->o('rel_db'),
00099                 'fan_branch_code' => 2,
00100             },
00101             -input_ids => [
00102                 { 'inputquery' => "SELECT table_name FROM information_schema.tables WHERE table_schema ='#mysql_dbname:db_conn#' AND engine='InnoDB' " },
00103             ],
00104             -flow_into => {
00105                 2 => [ 'myisamise_table'  ],
00106             },
00107         },
00108 
00109         {   -logic_name    => 'myisamise_table',
00110             -module        => 'Bio::EnsEMBL::Hive::RunnableDB::SqlCmd',
00111             -parameters    => {
00112                 'db_conn'     => $self->o('rel_db'),
00113                 'sql'         => "ALTER TABLE #table_name# ENGINE=MyISAM",
00114             },
00115             -hive_capacity => $self->o('fixing_capacity'),       # allow several workers to perform identical tasks in parallel
00116         },
00117     ];
00118 }
00119 
00120 1;
00121