Archive Ensembl HomeArchive Ensembl Home
AncestralMerge_conf.pm
Go to the documentation of this file.
00001 
00002 =pod 
00003 
00004 =head1 NAME
00005 
00006   Bio::EnsEMBL::Compara::PipeConfig::AncestralMerge_conf
00007 
00008 =head1 SYNOPSIS
00009 
00010     init_pipeline.pl Bio::EnsEMBL::Compara::PipeConfig::AncestralMerge_conf -password <your_password>
00011 
00012 =head1 DESCRIPTION  
00013 
00014     A pipeline to create the EnsEMBL core database with ancestral sequences merged from different sources.
00015 
00016     In rel.64 it took ~30min to run.
00017     In rel.65 it took ~38min to run.
00018 
00019 =head1 CONTACT
00020 
00021   Please contact ehive-users@ebi.ac.uk mailing list with questions/suggestions.
00022 
00023 =cut
00024 
00025 package Bio::EnsEMBL::Compara::PipeConfig::AncestralMerge_conf;
00026 
00027 use strict;
00028 use warnings;
00029 
00030 use base ('Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf');   # instead of Compara tables we actually want Core tables
00031 
00032 
00033 sub default_options {
00034     my ($self) = @_;
00035     return {
00036          %{$self->SUPER::default_options},
00037 
00038         'rel'               => 66,                                                  # current release number
00039         'rel_suffix'        => '',                                                  # empty string by default
00040         'rel_with_suffix'   => $self->o('rel').$self->o('rel_suffix'),              # for convenience
00041 
00042         'pipeline_name' => 'ensembl_ancestral_'.$self->o('rel_with_suffix'),        # name used by the beekeeper to prefix job names on the farm
00043 
00044         'merge_script'  => $self->o('ensembl_cvs_root_dir').'/ensembl-compara/scripts/pipeline/copy_ancestral_core.pl',
00045 
00046         'pipeline_db' => {
00047             -host   => 'compara3',
00048             -port   => 3306,
00049             -user   => 'ensadmin',
00050             -pass   => $self->o('password'),
00051             -dbname => $ENV{'USER'}.'_'.$self->o('pipeline_name'),
00052         },
00053 
00054             'prev_ancestral_db' => 'mysql://ensadmin:' . $self->o('password') . '@compara1/mp12_ensembl_ancestral_65',
00055 #         'prev_ancestral_db' => {
00056 #             -driver => 'mysql',
00057 #             -host   => 'compara1',
00058 #             -port   => 3306,
00059 #             -user   => 'ensadmin',
00060 #             -pass   => $self->o('password'),
00061 #             -dbname => 'lg4_ensembl_ancestral_64',
00062 #         },
00063 
00064     };
00065 }
00066 
00067 
00068 sub pipeline_create_commands {
00069     my ($self) = @_;
00070     return [
00071         @{$self->SUPER::pipeline_create_commands},                                                              # inherit database and Hive tables' creation
00072 
00073         $self->db_connect_command('pipeline_db').' <'.$self->o('ensembl_cvs_root_dir').'/ensembl/sql/table.sql',     # add Core tables
00074     ];
00075 }
00076 
00077 
00078 sub resource_classes {
00079     my ($self) = @_;
00080     return {
00081          0 => { -desc => 'default',          'LSF' => '' },
00082          1 => { -desc => 'urgent',           'LSF' => '-q yesterday' },
00083          2 => { -desc => 'more_mem',         'LSF' => '-M5000000 -R "select[mem>5000] rusage[mem=5000]"' },
00084     };
00085 }
00086 
00087 
00088 sub pipeline_analyses {
00089     my ($self) = @_;
00090     return [
00091         {   -logic_name => 'copy_coord_system',
00092             -module     => 'Bio::EnsEMBL::Hive::RunnableDB::MySQLTransfer',
00093             -parameters => {
00094                 'src_db_conn'   => $self->o('prev_ancestral_db'),
00095                 'table'         => 'coord_system',
00096                 'mode'          => 'insertignore',
00097             },
00098             -input_ids  => [ {} ],
00099             -flow_into  => {
00100                 1 => [ 'generate_merge_jobs' ],
00101             },
00102             -rc_id => 1,
00103         },
00104 
00105         {   -logic_name => 'generate_merge_jobs',
00106             -module     => 'Bio::EnsEMBL::Hive::RunnableDB::JobFactory',
00107             -parameters => {
00108                 'inputlist'         => [        # this table needs to be edited prior to running the pipeline:
00109                         # copying from previous release:
00110                                         [ '505' => $self->o('prev_ancestral_db'), ],     # 3-way birds
00111                                         [ '528' => $self->o('prev_ancestral_db'), ],     # 5-way fish
00112                                         [ '548' => $self->o('prev_ancestral_db'), ],     # 6-way primates
00113                                         [ '547' => $self->o('prev_ancestral_db'), ],     # 12-way mammals
00114 
00115                         # copying from new sources:
00116 #                     [ '548' => 'mysql://ensadmin:'.$self->o('password').'@compara3/sf5_compara_6way_65_ancestral_core' ],   # 6-way primates
00117 #                     [ '547' => 'mysql://ensadmin:'.$self->o('password').'@compara3/sf5_compara_12way_65_ancestral_core' ],  # 12-way mammals
00118                 ],
00119                 'input_id'          => { 'mlss_id' => '#_0#', 'from_url' => '#_1#' },
00120                 'fan_branch_code'   => 2,
00121             },
00122             -flow_into => {
00123                 2 => [ 'merge_an_ancestor' ],
00124             },
00125             -rc_id => 1,
00126         },
00127 
00128         {   -logic_name    => 'merge_an_ancestor',
00129             -module        => 'Bio::EnsEMBL::Hive::RunnableDB::SystemCmd',
00130             -parameters    => {
00131                 'to_url' => $self->dbconn_2_url('pipeline_db'),
00132                 'cmd'    => 'perl ' . $self->o('merge_script').' --from_url #from_url# --to_url #to_url# --mlss_id #mlss_id#',
00133             },
00134             -hive_capacity  => 1,   # do them one-by-one
00135             -rc_id => 2,
00136         },
00137     ];
00138 }
00139 
00140 1;
00141