ensembl-hive
2.8.0
|
This is a generic RunnableDB module for creating batches of similar jobs using dataflow mechanism (a fan of jobs is created in one branch and the funnel in another). Make sure you wire this buliding block properly from outside. You can supply as parameter one of 4 sources of ids from which the batches will be generated: param('inputlist'); The list is explicitly given in the parameters, can be abbreviated: 'inputlist' => ['a'..'z'] param('inputfile'); The list is contained in a file whose name is supplied as parameter: 'inputfile' => 'myfile.txt' param('inputquery'); The list is generated by an SQL query (against the production database by default) : 'inputquery' => 'SELECT object_id FROM object WHERE x=y' param('inputcmd'); The list is generated by running a system command: 'inputcmd' => 'find /tmp/big_directory -type f' NB for developpers: fetch_input() method is intentionally missing from JobFactory.pm . If JobFactory is subclassed (say, by a Compara RunnableDB) the child class's should use fetch_input() to set $self->param('inputlist') to whatever list of ids specific to that particular type of data (slices, members, etc). The rest functionality will be taken care for by the parent class code.
Definition at line 35 of file JobFactory.pm.
protected Bio::EnsEMBL::Hive::RunnableDB::JobFactory::_fisher_yates_shuffle_in_place | ( | ) |
Description: a private function (not a method) that shuffles a list of ids
protected Bio::EnsEMBL::Hive::RunnableDB::JobFactory::_get_rows_from_list | ( | ) |
Description: a private method that ensures the list is 2D
protected Bio::EnsEMBL::Hive::RunnableDB::JobFactory::_get_rows_from_open | ( | ) |
Description: a private method that loads ids from a given file or command pipe
protected Bio::EnsEMBL::Hive::RunnableDB::JobFactory::_get_rows_from_query | ( | ) |
Description: a private method that loads ids from a given sql query
param('db_conn'): An optional hash to pass in connection parameters to the database upon which the query will have to be run.
protected Bio::EnsEMBL::Hive::RunnableDB::JobFactory::_substitute_minibatched_rows | ( | ) |
Description: a private method that minibatches a list and transforms every minibatch using param-substitution
protected Bio::EnsEMBL::Hive::RunnableDB::JobFactory::_substitute_rows | ( | ) |
Description: a private method that goes through a list and transforms every row into a hash
public Bio::EnsEMBL::Hive::RunnableDB::JobFactory::param_defaults | ( | ) |
Undocumented method
public Bio::EnsEMBL::Hive::RunnableDB::JobFactory::run | ( | ) |
Description : Implements run() interface method of Bio::EnsEMBL::Hive::Process that is used to perform the main bulk of the job (minus input and output).
param('column_names'): Controls the column names that come out of the parser: 0 = "no names", 1 = "parse names from data", arrayref = "take names from this array"
param('delimiter'): If you set it your lines in file/cmd mode will be split into columns that you can use individually when constructing the input_id_template hash.
param('randomize'): Shuffles the rows before creating jobs - can sometimes lead to better overall performance of the pipeline. Doesn't make any sence for minibatches (step>1).
param('step'): The requested size of the minibatch (1 by default). The real size of a range may be smaller than the requested size.
param('contiguous'): Whether the key_column range of each minibatch should be contiguous (0 by default).
param('key_column'): If every line of your input is a list (it happens, for example, when your SQL returns multiple columns or you have set the 'delimiter' in file/cmd mode) this is the way to say which column is undergoing 'ranging'
# The following 4 parameters are mutually exclusive and define the source of ids for the jobs:
param('inputlist'); The list is explicitly given in the parameters, can be abbreviated: 'inputlist' => ['a'..'z']
param('inputfile'); The list is contained in a file whose name is supplied as parameter: 'inputfile' => 'myfile.txt'
param('inputquery'); The list is generated by an SQL query (against the production database by default) : 'inputquery' => 'SELECT object_id FROM object WHERE x=y'
param('inputcmd'); The list is generated by running a system command: 'inputcmd' => 'find /tmp/big_directory -type f'
public Bio::EnsEMBL::Hive::RunnableDB::JobFactory::write_output | ( | ) |
Description : Implements write_output() interface method of Bio::EnsEMBL::Hive::Process that is used to deal with job's output after the execution. Here we rely on the dataflow mechanism to create jobs.
param('fan_branch_code'): defines the branch where the fan of jobs is created (2 by default).