<commit_before>=head1 LICENSE

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2018] EMBL-European Bioinformatics Institute

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=head1 CONTACT

Please email comments or questions to the public Ensembl
developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.

Questions may also be sent to the Ensembl help desk at
<http://www.ensembl.org/Help/Contact>.

=head1 NAME

Bio::EnsEMBL::Analysis::Hive::Config::HiveRelCoDuties_conf

=head1 SYNOPSIS


=head1 DESCRIPTION


=cut

package Bio::EnsEMBL::Analysis::Hive::Config::HiveRelCoDuties_conf;

use strict;
use warnings;

use 5.014000;
use File::Spec::Functions qw(catfile catdir);
use MIME::Base64 qw(encode_base64url);

use Bio::EnsEMBL::Analysis::Tools::Utilities qw(first_upper_case);
use parent ('Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf');

=head2 default_options

 Description: It returns a hashref containing the default options for HiveGeneric_conf
 Returntype : Hashref
 Exceptions : None


=cut

sub default_options {
    my ($self) = @_;

    return {
        # inherit other stuff from the base class
        %{ $self->SUPER::default_options() },
        use_jira => 1,
        jira_user => '' || $ENV{JIRA_USER},
        jira_password => '' || $ENV{JIRA_PASS},
        ensembl_release => $ENV{ENSEMBL_RELEASE}, # Use it on the commandline: -ensembl_release XX
        #working_dir => '', # Use it on the command line or uncomment: -working_dir /path/to/my/scratch/relco_duties_87
        #user => '', # Use it on the command line or uncomment: -user mysql_rw_user
        #password => '', # Use it on the command line or uncomment: -password <PASSWORD>
        #user_r => '', # Use it on the command line or uncomment: -user_r mysql_ro_user
        pass_r => undef, # (optional) Use it on the command line: -password mysql_ro_password
        human_gencode_version => '27', # Use it on the command line: -human_gencode_version XX
        mouse_gencode_version => 'M15', # Use it on the command line: -password <PASSWORD>_rw_password
        do_human => 0,
        do_mouse => 1,
        do_pig => 0,
        do_chimpanzee => 1,
        do_rat => 0,
        do_zebrafish => 0,
#################
#        Everything below should not need modification
#################
        pipeline_name => 'relco_duties_'.$self->o('ensembl_release'),
        ensembl_analysis_dir => catdir($self->o('enscode_root_dir'), 'ensembl-analysis'),
        production_dir => catdir($self->o('enscode_root_dir'), 'ensembl-production'),
        human_cs_version => '38',
        mouse_cs_version => '38',
        human_cs_name => 'GRCh'.$self->o('human_cs_version'),
        mouse_cs_name => 'GRCm'.$self->o('mouse_cs_version'),
        human_alias => 'homo_sapiens',
        mouse_alias => 'mus_musculus',
        binary_base => catdir($ENV{LINUXBREW_HOME}, 'bin'),
        samtools => catfile($self->o('binary_base'), 'samtools'), # It might be better to give the absolute path, but I think it's ok
        webdev_nfs => '/nfs/production/panda/ensembl/production/ensemblftp/data_files',

        enscode_root_dir => $ENV{ENSCODE},
        ensembl_analysis_dir => catdir($self->o('enscode_root_dir'), 'ensembl-analysis'),
        production_dir => catdir($self->o('enscode_root_dir'), 'ensembl-production'),
        check_datafiles_script => catfile($self->o('production_dir'), 'scripts', 'datafiles', 'check_datafiles.pl'),
        compare_gencode_refseq_script => catfile($self->o('ensembl_analysis_dir'), 'scripts', 'Merge', 'compare_gencode_refseq_genes.pl'),
        overlap_gencode_refseq_script => catfile($self->o('ensembl_analysis_dir'), 'scripts', 'refseq', 'ens_refseq_comparison.pl'),
        label_gencode_basic_script => catfile($self->o('ensembl_analysis_dir'), 'scripts', 'Merge', 'label_gencode_basic_transcripts.pl'),
        update_gencode_version => catfile($self->o('ensembl_analysis_dir'), 'scripts', 'Merge', 'create_gencode_web_data_patch.pl'),

        query_delete_attributes => ['DELETE FROM transcript_attrib WHERE attrib_type_id = 510'],

        staging1_db => {
            -host   => 'mysql-ens-sta-1',
            -port   => 4519,
            -user   => $self->o('user_r'),
            -pass   => $self->o('<PASSWORD>'),
            -driver => $self->o('hive_driver'),
        },
        pre_staging1_db => {
            -host   => 'mysql-ens-vertannot-staging',
            -port   => 4573,
            -user   => $self->o('user'),
            -pass   => $self->o('password'),
            -driver => $self->o('hive_driver'),
        },
        human_ensembl_db => {
            -dbname => $self->o('human_alias').'_core_'.$self->o('ensembl_release').'_'.$self->o('human_cs_version'),
            -host   => $self->o('pre_staging1_db', '-host'),
            -port   => $self->o('pre_staging1_db', '-port'),
            -user   => $self->o('user'),
            -pass   => $self->o('password'),
            -driver   => $self->o('pre_staging1_db', '-driver'),
        },
        mouse_ensembl_db => {
            -dbname => $self->o('mouse_alias').'_core_'.$self->o('ensembl_release').'_'.$self->o('mouse_cs_version'),
            -host   => $self->o('pre_staging1_db', '-host'),
            -port   => $self->o('pre_staging1_db', '-port'),
            -user   => $self->o('user'),
            -pass   => $self->o('password'),
            -driver => $self->o('pre_staging1_db', '-driver'),
        },
        human_refseq_db => {
            -dbname => $self->o('human_alias').'_otherfeatures_'.$self->o('ensembl_release').'_'.$self->o('human_cs_version'),
            -host   => $self->o('pre_staging1_db', '-host'),
            -port   => $self->o('pre_staging1_db', '-port'),
            -user   => $self->o('user'),
            -pass   => $self->o('password'),
            -driver => $self->o('pre_staging1_db', '-driver'),
        },
        mouse_refseq_db => {
            -dbname => $self->o('mouse_alias').'_otherfeatures_'.$self->o('ensembl_release').'_'.$self->o('mouse_cs_version'),
            -host   => $self->o('pre_staging1_db', '-host'),
            -port   => $self->o('pre_staging1_db', '-port'),
            -user   => $self->o('user'),
            -pass   => $self->o('password'),
            -driver => $self->o('pre_staging1_db', '-driver'),
        },
        production_db => {
            -dbname => 'ensembl_production_'.$self->o('ensembl_release'),
            -host   => $self->o('staging1_db', '-host'),
            -port   => $self->o('staging1_db', '-port'),
            -user   => $self->o('user_r'),
            -pass   => $self->o('pass_r'),
            -driver => $self->o('staging1_db', '-driver'),
        },
    };
}


=head2 pipeline_analyses

 Arg [1]    : None
 Description: Returns a hashref containing the analyses to run
 Returntype : Hashref
 Exceptions : None

=cut

sub pipeline_analyses {
  my ($self) = @_;

  my %jira_tickets;
  my @default_tickets;
  my $user = $self->o('jira_user');
  my $password = $self->o('<PASSWORD>');
  if ($self->o('use_jira') eq '1') {
    %jira_tickets = (
      version_ticket_name => 'Update release ENSEMBL_RELEASE in genebuild.sh to '.$self->o('ensembl_release'),
      release_ticket_name  => 'Genebuild Relco release '.$self->o('ensembl_release'),
      species_ticket_name  => 'GENCODE scripts release '.$self->o('ensembl_release'),
      datafile_ticket_name => 'Check data_file scripts release '.$self->o('ensembl_release'),
      base64 => encode_base64url($user.':'.$password),
    );
    @default_tickets = (
      'Update ENSEMBL_RELEASE to '.$self->o('ensembl_release').' in genebuild.sh',
      'Delete databases from previous release from mysql-ens-vertannot-staging',
      'Clean old healthchecks before handover',
      'Human cDNA update release '.$self->o('ensembl_release'),
      'Mouse cDNA update release '.$self->o('ensembl_release'),
    );
    foreach my $species ('human', 'mouse') {
      if ($self->o('do_'.$species)) {
        push(@default_tickets, $species.' CCDS update release '.$self->o('ensembl_release'));
      }
    }
  }
  my @refseq_list;
  foreach my $species ('human', 'mouse') {
    if ($self->o('do_'.$species)) {
      push(@refseq_list, [$species, $self->o($species.'_ensembl_db'), $self->o($species.'_cs_name'), $self->o($species.'_refseq_db'), "refseq_${species}_import"]);
    }
  }
  my @analysis = (
    {
      -logic_name => 'create_release_jira',
      -module     => 'Bio::EnsEMBL::Analysis::Hive::RunnableDB::JiraTicket',<commit_msg>Removed unused data for the RelCoDuties configuration<commit_after>=head1 LICENSE

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2018] EMBL-European Bioinformatics Institute

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=head1 CONTACT

Please email comments or questions to the public Ensembl
developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.

Questions may also be sent to the Ensembl help desk at
<http://www.ensembl.org/Help/Contact>.

=head1 NAME

Bio::EnsEMBL::Analysis::Hive::Config::HiveRelCoDuties_conf

=head1 SYNOPSIS


=head1 DESCRIPTION


=cut

package Bio::EnsEMBL::Analysis::Hive::Config::HiveRelCoDuties_conf;

use strict;
use warnings;

use 5.014000;
use File::Spec::Functions qw(catfile catdir);
use MIME::Base64 qw(encode_base64url);

use Bio::EnsEMBL::Analysis::Tools::Utilities qw(first_upper_case);
use parent ('Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf');

=head2 default_options

 Description: It returns a hashref containing the default options for HiveGeneric_conf
 Returntype : Hashref
 Exceptions : None


=cut

sub default_options {
    my ($self) = @_;

    return {
        # inherit other stuff from the base class
        %{ $self->SUPER::default_options() },
        use_jira => 1,
        jira_user => '' || $ENV{JIRA_USER},
        jira_password => '' || $ENV{JIRA_PASS},
        ensembl_release => $ENV{ENSEMBL_RELEASE}, # Use it on the commandline: -ensembl_release XX
        #working_dir => '', # Use it on the command line or uncomment: -working_dir /path/to/my/scratch/relco_duties_87
        #user => '', # Use it on the command line or uncomment: -user mysql_rw_user
        #password => '', # Use it on the command line or uncomment: -password <PASSWORD>
        #user_r => '', # Use it on the command line or uncomment: -user_r mysql_ro_user
        pass_r => undef, # (optional) Use it on the command line: -password <PASSWORD>
        human_gencode_version => '27', # Use it on the command line: -human_gencode_version XX
        mouse_gencode_version => 'M15', # Use it on the command line: -password <PASSWORD>
        do_human => 0,
        do_mouse => 1,
#################
#        Everything below should not need modification
#################
        pipeline_name => 'relco_duties_'.$self->o('ensembl_release'),
        ensembl_analysis_dir => catdir($self->o('enscode_root_dir'), 'ensembl-analysis'),
        production_dir => catdir($self->o('enscode_root_dir'), 'ensembl-production'),
        human_cs_version => '38',
        mouse_cs_version => '38',
        human_cs_name => 'GRCh'.$self->o('human_cs_version'),
        mouse_cs_name => 'GRCm'.$self->o('mouse_cs_version'),
        human_alias => 'homo_sapiens',
        mouse_alias => 'mus_musculus',
        binary_base => catdir($ENV{LINUXBREW_HOME}, 'bin'),
        samtools => catfile($self->o('binary_base'), 'samtools'), # It might be better to give the absolute path, but I think it's ok
        webdev_nfs => '/nfs/production/panda/ensembl/production/ensemblftp/data_files',

        enscode_root_dir => $ENV{ENSCODE},
        ensembl_analysis_dir => catdir($self->o('enscode_root_dir'), 'ensembl-analysis'),
        production_dir => catdir($self->o('enscode_root_dir'), 'ensembl-production'),
        check_datafiles_script => catfile($self->o('production_dir'), 'scripts', 'datafiles', 'check_datafiles.pl'),
        compare_gencode_refseq_script => catfile($self->o('ensembl_analysis_dir'), 'scripts', 'Merge', 'compare_gencode_refseq_genes.pl'),
        overlap_gencode_refseq_script => catfile($self->o('ensembl_analysis_dir'), 'scripts', 'refseq', 'ens_refseq_comparison.pl'),
        label_gencode_basic_script => catfile($self->o('ensembl_analysis_dir'), 'scripts', 'Merge', 'label_gencode_basic_transcripts.pl'),
        update_gencode_version => catfile($self->o('ensembl_analysis_dir'), 'scripts', 'Merge', 'create_gencode_web_data_patch.pl'),

        query_delete_attributes => ['DELETE FROM transcript_attrib WHERE attrib_type_id = 510'],

        staging1_db => {
            -host   => 'mysql-ens-sta-1',
            -port   => 4519,
            -user   => $self->o('user_r'),
            -pass   => $self->o('pass_r'),
            -driver => $self->o('hive_driver'),
        },
        pre_staging1_db => {
            -host   => 'mysql-ens-vertannot-staging',
            -port   => 4573,
            -user   => $self->o('user'),
            -pass   => $self->o('password'),
            -driver => $self->o('hive_driver'),
        },
        human_ensembl_db => {
            -dbname => $self->o('human_alias').'_core_'.$self->o('ensembl_release').'_'.$self->o('human_cs_version'),
            -host   => $self->o('pre_staging1_db', '-host'),
            -port   => $self->o('pre_staging1_db', '-port'),
            -user   => $self->o('user'),
            -pass   => $self->o('password'),
            -driver   => $self->o('pre_staging1_db', '-driver'),
        },
        mouse_ensembl_db => {
            -dbname => $self->o('mouse_alias').'_core_'.$self->o('ensembl_release').'_'.$self->o('mouse_cs_version'),
            -host   => $self->o('pre_staging1_db', '-host'),
            -port   => $self->o('pre_staging1_db', '-port'),
            -user   => $self->o('user'),
            -pass   => $self->o('password'),
            -driver => $self->o('pre_staging1_db', '-driver'),
        },
        human_refseq_db => {
            -dbname => $self->o('human_alias').'_otherfeatures_'.$self->o('ensembl_release').'_'.$self->o('human_cs_version'),
            -host   => $self->o('pre_staging1_db', '-host'),
            -port   => $self->o('pre_staging1_db', '-port'),
            -user   => $self->o('user'),
            -pass   => $self->o('password'),
            -driver => $self->o('pre_staging1_db', '-driver'),
        },
        mouse_refseq_db => {
            -dbname => $self->o('mouse_alias').'_otherfeatures_'.$self->o('ensembl_release').'_'.$self->o('mouse_cs_version'),
            -host   => $self->o('pre_staging1_db', '-host'),
            -port   => $self->o('pre_staging1_db', '-port'),
            -user   => $self->o('user'),
            -pass   => $self->o('password'),
            -driver => $self->o('pre_staging1_db', '-driver'),
        },
        production_db => {
            -dbname => 'ensembl_production_'.$self->o('ensembl_release'),
            -host   => $self->o('staging1_db', '-host'),
            -port   => $self->o('staging1_db', '-port'),
            -user   => $self->o('user_r'),
            -pass   => $self->o('<PASSWORD>'),
            -driver => $self->o('staging1_db', '-driver'),
        },
    };
}


=head2 pipeline_analyses

 Arg [1]    : None
 Description: Returns a hashref containing the analyses to run
 Returntype : Hashref
 Exceptions : None

=cut

sub pipeline_analyses {
  my ($self) = @_;

  my %jira_tickets;
  my @default_tickets;
  my $user = $self->o('jira_user');
  my $password = $self->o('jira_password');
  if ($self->o('use_jira') eq '1') {
    %jira_tickets = (
      version_ticket_name => 'Update release ENSEMBL_RELEASE in genebuild.sh to '.$self->o('ensembl_release'),
      release_ticket_name  => 'Genebuild Relco release '.$self->o('ensembl_release'),
      species_ticket_name  => 'GENCODE scripts release '.$self->o('ensembl_release'),
      datafile_ticket_name => 'Check data_file scripts release '.$self->o('ensembl_release'),
      base64 => encode_base64url($user.':'.$password),
    );
    @default_tickets = (
      'Delete databases from previous release from mysql-ens-vertannot-staging',
      'Human cDNA update release '.$self->o('ensembl_release'),
      'Mouse cDNA update release '.$self->o('ensembl_release'),
    );
    foreach my $species ('human', 'mouse') {
      if ($self->o('do_'.$species)) {
        push(@default_tickets, $species.' CCDS update release '.$self->o('ensembl_release'));
      }
    }
  }
  my @refseq_list;
  foreach my $species ('human', 'mouse') {
    if ($self->o('do_'.$species)) {
      push(@refseq_list, [$species, $self->o($species.'_ensembl_db'), $self->o($species.'_cs_name'), $self->o($species.'_refseq_db'), "refseq_${species}_import"]);
    }
  }
  my @analysis = (
    {
      -logic_name => 'create_release_jira',
      -module     => 'Bio::EnsEMBL::Analysis::Hive::RunnableDB::JiraTicket',
{'fraction_non_alphanumeric': 0.16737430167597767, 'fraction_numerical': 0.009832402234636871, 'mean_word_length': 3.1189599631845377, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 342, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '828209', 'n_tokens_mistral': 5988, 'n_tokens_neox': 5772, 'n_words': 1190}