EnsemblGeneric_conf.pm 3.99 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
=pod 

=head1 NAME

    Bio::EnsEMBL::Hive::PipeConfig::EnsemblGeneric_conf

=head1 DESCRIPTION

    Generic configuration module for all Ensembl-derived pipelines.
    It extends HiveGeneric_conf with specifically Ensembl things (knows about the release number, for instance).

    So if your pipeline has anything to do with Ensembl API/schema, please inherit (directly or not) your config from this file.

=head1 LICENSE

16
    Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Brandon Walts's avatar
Brandon Walts committed
17
    Copyright [2016-2020] EMBL-European Bioinformatics Institute
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

    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 subscribe to the Hive mailing list:  http://listserver.ebi.ac.uk/mailman/listinfo/ehive-users  to discuss Hive-related questions or to be notified of our updates

=cut


package Bio::EnsEMBL::Hive::PipeConfig::EnsemblGeneric_conf;

use strict;
use warnings;

use Bio::EnsEMBL::ApiVersion ();

use base ('Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf');


=head2 default_options

    Description : Interface method that should return a hash of option_name->default_option_value pairs.
                  Please see existing PipeConfig modules for examples.

=cut

sub default_options {
    my ($self) = @_;
    return {
        %{ $self->SUPER::default_options() },   # inherit from parent

            # Please note: ENVironment variables may be "exported" to inherit from enclosing shell,
            # but if you want to *prevent* that you need to specifically say so
            #  (setting a password to empty string does exactly that - sets it to an empty string)
            #
            #   [bash]      export -n ENSEMBL_CVS_ROOT_DIR  # will stop exporting, but the value in current shell stays as it was
            #   [tcsh]      unsetenv ENSEMBL_CVS_ROOT_DIR   # will destroy the variable even in current shell, and stop exporting

        'ensembl_cvs_root_dir'  => $ENV{'ENSEMBL_CVS_ROOT_DIR'} || $self->o('ensembl_cvs_root_dir'),    # it will make sense to set this variable if you are going to use ehive with ensembl
65

66 67 68 69
        'ensembl_release'       => Bio::EnsEMBL::ApiVersion::software_version(),                        # snapshot of EnsEMBL Core API version. Please do not change if not sure.
        'rel_suffix'            => '',                                                                  # an empty string by default, a letter otherwise
        'rel_with_suffix'       => $self->o('ensembl_release').$self->o('rel_suffix'),

70 71 72 73
        'pipeline_name'         => $self->pipeline_name().'_'.$self->o('rel_with_suffix'),

        'user'                  => $ENV{'EHIVE_USER'} || 'ensadmin',
        'password'              => $ENV{'EHIVE_PASS'} // $ENV{'ENSADMIN_PSW'} // $self->o('password'),  # people will have to make an effort NOT to insert it into config files like .bashrc etc
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
    };
}


=head2 pipeline_wide_parameters

    Description : Interface method that should return a hash of pipeline_wide_parameter_name->pipeline_wide_parameter_value pairs.
                  The value doesn't have to be a scalar, can be any Perl structure now (will be stringified and de-stringified automagically).
                  Please see existing PipeConfig modules for examples.

=cut

sub pipeline_wide_parameters {
    my ($self) = @_;
    return {
89
        %{ $self->SUPER::pipeline_wide_parameters() },      # inherit from parent
90

91
#        'schema_version' => $self->o('ensembl_release'),   # commented out to avoid duplicating 'schema_version' inserted by the schema mysql file
92 93 94 95 96
    };
}

1;