ensembl-hive  2.8.1
init_pipeline.pl
Go to the documentation of this file.
1 #!/usr/bin/env perl
2 
3 # A generic script for creating eHive pipelines from PipeConfig module files (see below for docs)
4 
5 use strict;
6 use warnings;
7 
8  # Finding out own path in order to reference own components (including own modules):
9 use Cwd ();
10 use File::Basename ();
11 BEGIN {
12  $ENV{'EHIVE_ROOT_DIR'} ||= File::Basename::dirname( File::Basename::dirname( Cwd::realpath($0) ) );
13  unshift @INC, $ENV{'EHIVE_ROOT_DIR'}.'/modules';
14 }
15 
16 use Getopt::Long qw(:config pass_through no_auto_abbrev);
17 use Pod::Usage;
18 use Bio::EnsEMBL::Hive::Utils ('load_file_or_module');
20 
22 
24 
25 sub main {
26  my $deprecated_option = {};
27  my $tweaks = [];
28  my $help;
29 
30  GetOptions(
31  'analysis_topup!' => \$deprecated_option->{'analysis_topup'}, # always on
32  'job_topup!' => \$deprecated_option->{'job_topup'}, # never, use seed_pipeline.pl
33  'tweak|SET=s@' => \$tweaks,
34  'DELETE=s' => sub { my ($opt_name, $opt_value) = @_; push @$tweaks, $opt_value.'#'; },
35  'SHOW=s' => sub { my ($opt_name, $opt_value) = @_; push @$tweaks, $opt_value.'?'; },
36  'h|help!' => \$help,
37  );
38 
39  if ($help) {
40  pod2usage({-exitvalue => 0, -verbose => 2});
41  }
42 
43  if($deprecated_option->{'job_topup'}) {
44  die "-job_topup mode has been discontinued. Please use seed_pipeline.pl instead.\n";
45  }
46  if($deprecated_option->{'analysis_topup'}) {
47  die "-analysis_topup has been deprecated. Please note this script now *always* runs in -analysis_topup mode.\n";
48  }
49 
50 
51  my $file_or_module = shift @ARGV or die "ERROR: Must provide a PipeConfig name on the command-line\n";
52 
54 }
55 
56 main();
57 
58 __DATA__
59 
60 =pod
61 
62 =head1 NAME
63 
64 init_pipeline.pl
65 
66 =head1 SYNOPSIS
67 
68  init_pipeline.pl <config_module_or_filename> [<options_for_this_particular_pipeline>]
69 
70 =head1 DESCRIPTION
71 
72 init_pipeline.pl is a generic script that is used to initialise eHive pipelines (i..e create and setup the database) from PipeConfig configuration modules.
73 
74 =head1 USAGE EXAMPLES
75 
76  # get this help message:
77  init_pipeline.pl
78 
79  # initialise a generic eHive pipeline:
80  init_pipeline.pl Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf -password <yourpassword>
81 
82  # initialise the long multiplicaton pipeline by supplying not only mandatory but also optional data:
83  # (assuming your current directory is ensembl-hive/modules/Bio/EnsEMBL/Hive/PipeConfig) :
84  init_pipeline.pl LongMult_conf -password <yourpassword> -first_mult 375857335 -second_mult 1111333355556666
85 
86 =head1 OPTIONS
87 
88 =over
89 
90 =item --hive_force_init <0|1>
91 
92 If set to 1, forces the (re)creation of the eHive database even if a previous version of it is present in the server.
93 
94 =item --hive_no_init <0|1>
95 
96 If set to 1, does not run the pipeline_create_commands section of the pipeline. Useful to "top-up" an existing database.
97 
98 =item --hive_debug_init <0|1>
99 
100 If set to 1, will show the objects (analyses, data-flow rules, etc) that are parsed from the PipeConfig file.
101 
102 =item --tweak <string>
103 
104 Apply tweaks to the pipeline. See tweak_pipeline.pl for details of tweaking syntax
105 
106 =item --DELETE
107 
108 Delete pipeline parameter (shortcut for tweak DELETE)
109 
110 =item --SHOW
111 
112 Show pipeline parameter (shortcut for tweak SHOW)
113 
114 =item -h, --help
115 
116 Show this help message
117 
118 =back
119 
120 =head1 LICENSE
121 
122  See the NOTICE file distributed with this work for additional information
123  regarding copyright ownership.
124 
125  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
126  You may obtain a copy of the License at
127 
128  http://www.apache.org/licenses/LICENSE-2.0
129 
130  Unless required by applicable law or agreed to in writing, software distributed under the License
131  is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
132  See the License for the specific language governing permissions and limitations under the License.
133 
134 =head1 CONTACT
135 
136 Please subscribe to the eHive mailing list: http://listserver.ebi.ac.uk/mailman/listinfo/ehive-users to discuss eHive-related questions or to be notified of our updates
137 
138 =cut
139 
Bio::EnsEMBL::Hive::Utils
Definition: Collection.pm:4
Bio::EnsEMBL::Hive::Utils::URL::hide_url_password
public Void hide_url_password()
Bio::EnsEMBL::Hive::Utils::URL
Definition: URL.pm:11
Bio::EnsEMBL::Hive::Scripts::InitPipeline::init_pipeline
public init_pipeline()
BEGIN
public BEGIN()
Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf
Definition: HiveGeneric_conf.pm:54
run
public run()
main
public main()
Bio::EnsEMBL::Hive::Scripts::InitPipeline
Definition: InitPipeline.pm:7