ensembl-hive  2.8.1
CompressFiles_conf.pm
Go to the documentation of this file.
1 =pod
2 
3 =head1 NAME
4 
6 
7 =head1 SYNOPSIS
8 
9  init_pipeline.pl Bio::EnsEMBL::Hive::Examples::Factories::PipeConfig::CompressFiles_conf -password <your_password>
10 
11  seed_pipeline.pl -url <url> -logic_name find_files -input_id "{ 'directory' => 'dumps' }"
12 
13 =head1 DESCRIPTION
14 
15  This is an example pipeline put together from two basic building blocks:
16 
17  Analysis_1: JobFactory.pm is used to turn the list of files in a given directory into jobs
18 
19  these jobs are sent down the branch #2 into the second analysis
20 
21  Analysis_2: SystemCmd.pm is used to run these compression/decompression jobs in parallel.
22 
23 =head1 LICENSE
24 
25  See the NOTICE file distributed with this work for additional information
26  regarding copyright ownership.
27 
28  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
29  You may obtain a copy of the License at
30 
31  http://www.apache.org/licenses/LICENSE-2.0
32 
33  Unless required by applicable law or agreed to in writing, software distributed under the License
34  is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35  See the License for the specific language governing permissions and limitations under the License.
36 
37 =head1 CONTACT
38 
39  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
40 
41 =cut
42 
43 
44 package Bio::EnsEMBL::Hive::Examples::Factories::PipeConfig::CompressFiles_conf;
45 
46 use strict;
47 use warnings;
48 
49 use base ('Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf'); # All Hive databases configuration files should inherit from HiveGeneric, directly or indirectly
50 
51 
52 =head2 pipeline_analyses
53 
54  Description : Implements pipeline_analyses() interface method of Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf that defines the structure of the pipeline: analyses, jobs, rules, etc.
55  Here it defines two analyses:
56 
57  * 'find_files' generates a list of files whose names match the pattern #only_files#
58  Each job of this analysis will dataflow (create jobs) via branch #2 into 'compress_a_file' analysis.
59 
60  * 'compress_a_file' actually performs the (un)gzipping of the files in parallel
61 
62 =cut
63 
64 sub pipeline_analyses {
65  my ($self) = @_;
66  return [
67  { -logic_name => 'find_files',
68  -module => 'Bio::EnsEMBL::Hive::RunnableDB::JobFactory',
69  -parameters => {
70  'inputcmd' => 'find #directory# -type f',
71  'column_names' => [ 'filename' ],
72  },
73  -flow_into => {
74  2 => [ 'compress_a_file' ], # will create a fan of jobs
75  },
76  },
77 
78  { -logic_name => 'compress_a_file',
79  -module => 'Bio::EnsEMBL::Hive::RunnableDB::SystemCmd',
80  -parameters => {
81  'cmd' => 'gzip #filename#',
82  },
83  -analysis_capacity => 4, # limit the number of workers that will be performing jobs in parallel
84  },
85  ];
86 }
87 
88 1;
89 
Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf
Definition: HiveGeneric_conf.pm:54
run
public run()
Bio::EnsEMBL::Hive::Examples::Factories::PipeConfig::CompressFiles_conf
Definition: CompressFiles_conf.pm:26
Bio
Definition: AltAlleleGroup.pm:4