init_pipeline.pl 3.49 KB
Newer Older
Leo Gordon's avatar
Leo Gordon committed
1
#!/usr/bin/env perl
2

3
4
5
# A generic loader of hive pipelines.
#
# Because all of the functionality is hidden in Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf
6
7
# you can create pipelines by calling the right methods of HiveGeneric_conf directly,
# so this script is just a commandline wrapper that can conveniently find modules by their filename.
8
9

use strict;
Leo Gordon's avatar
Leo Gordon committed
10
use warnings;
11

12
13
14
15
    # Finding out own path in order to reference own components (including own modules):
use Cwd            ();
use File::Basename ();
BEGIN {
16
17
    $ENV{'EHIVE_ROOT_DIR'} = File::Basename::dirname( File::Basename::dirname( Cwd::realpath($0) ) );
    unshift @INC, $ENV{'EHIVE_ROOT_DIR'}.'/modules';
18
19
20
21
}


use Bio::EnsEMBL::Hive::Utils ('script_usage', 'load_file_or_module');
22
23

sub main {
24
    my $file_or_module = shift @ARGV or script_usage(0);
25

26
    my $config_module = load_file_or_module( $file_or_module );
27

28
29
30
    my $config_object = $config_module->new();
    $config_object->process_options();
    $config_object->run();
31
32
33
34
35
36
37
38
39
40
41
42
43
44
}

main();

__DATA__

=pod

=head1 NAME

    init_pipeline.pl

=head1 SYNOPSIS

45
    init_pipeline.pl <config_module_or_filename> [-help | [-analysis_topup | -job_topup] <options_for_this_particular_pipeline>]
46
47
48

=head1 DESCRIPTION

Leo Gordon's avatar
Leo Gordon committed
49
    init_pipeline.pl is a generic script that is used to create+setup=initialize eHive pipelines from PipeConfig configuration modules.
50
51
52

=head1 USAGE EXAMPLES

Leo Gordon's avatar
Leo Gordon committed
53
54
        # get this help message:
    init_pipeline.pl
55

Leo Gordon's avatar
Leo Gordon committed
56
57
        # initialize a generic eHive pipeline:
    init_pipeline.pl Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf -password <yourpassword>
58

Leo Gordon's avatar
Leo Gordon committed
59
60
61
        # see what command line options are available when initializing long multiplication example pipeline
        #   (assuming your current directory is ensembl-hive/modules/Bio/EnsEMBL/Hive) :
    init_pipeline.pl PipeConfig/LongMult_conf -help
62

Leo Gordon's avatar
Leo Gordon committed
63
64
65
        # initialize the long multiplicaton pipeline by supplying not only mandatory but also optional data:
        #   (assuming your current directory is ensembl-hive/modules/Bio/EnsEMBL/Hive/PipeConfig) :
    init_pipeline.pl LongMult_conf -password <yourpassword> -first_mult 375857335 -second_mult 1111333355556666 
66
67
68

=head1 OPTIONS

69
    -help            :   Gets this help message and exits
70

71
72
    -analysis_topup  :   A special initialization mode when (1) pipeline_create_commands are switched off and (2) only newly defined analyses are added to the database
                         This mode is only useful in the process of putting together a new pipeline.
73

74
75
76
    -job_topup       :   Another special initialization mode when only jobs are created - no other structural changes to the pipeline are acted upon.

    -hive_force_init :   If set to 1, forces the (re)creation of the hive database even if a previous version of it is present in the server.
77

78
79
80
81
82
83
84
85
86
87
88
89
90
=head1 LICENSE

    Copyright [1999-2013] Wellcome Trust Sanger Institute and the 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.

91
92
93
94
95
=head1 CONTACT

    Please contact ehive-users@ebi.ac.uk mailing list with questions/suggestions.

=cut
96