|
ensembl-hive
2.3
|
Public Member Functions | |
| public | stringify () |
| public | destringify () |
| public | dir_revhash () |
| public | parse_cmdline_options () |
| public | find_submodules () |
| public | load_file_or_module () |
| public | script_usage () |
| public List | split_for_bash () |
| public | url2dbconn_hash () |
| public | go_figure_dbc () |
| public | throw () |
| public Tuple | join_command_args () |
This module provides general utility functions that can be used in different contexts through three different calling mechanisms:
import: another module/script can selectively import methods from this module into its namespace
inheritance: another module can inherit from this one and so implicitly acquire the methods into its namespace
direct call to a module's method: another module/script can directly call a method from this module prefixed with this module's name
| public Bio::EnsEMBL::Hive::Utils::destringify | ( | ) |
Description: This function takes in a string that may or may not contain a stingified Perl structure.
If it seems to contain a hash/array/quoted_string, the contents is evaluated, otherwise it is returned "as is".
This function is mainly used to read values from 'meta' table that may represent Perl structures, but generally don't have to.Callers : Bio::EnsEMBL::Hive::DBSQL::PipelineWideParametersAdaptor # destringification of general 'meta' params beekeeper.pl script # destringification of the 'pipeline_name' meta param
Code:
| public Bio::EnsEMBL::Hive::Utils::dir_revhash | ( | ) |
Description: This function takes in a string (which is usually a numeric id) and turns its reverse into a multilevel directory hash.
Please note that no directory is created at this step - it is purely a string conversion function.Callers : Bio::EnsEMBL::Hive::Worker # hashing of the worker output directories Bio::EnsEMBL::Hive::RunnableDB::JobFactory # hashing of an arbitrary id
Code:
| public Bio::EnsEMBL::Hive::Utils::find_submodules | ( | ) |
Description: This function takes one argument ("prefix" of a module name),
transforms it into a directory name from the filesystem's point of view
and finds all module names in these "directories".
Each module_name found is reported only once,
even if there are multiple matching files in different directories.Callers : scripts
Code:
| public Bio::EnsEMBL::Hive::Utils::go_figure_dbc | ( | ) |
Undocumented method
Code:
| public Tuple Bio::EnsEMBL::Hive::Utils::join_command_args | ( | ) |
Argument[0]: String or Arrayref of Strings
Description: Prepares the command to be executed by system(). It is needed if the
command is in fact composed of multiple commands.
Returns: Tuple (boolean,string). The boolean indicates whether it was needed to
join the arguments. The string is the new command-line string.
PS: Shamelessly adapted from http://www.perlmonks.org/?node_id=908096
Code:
| public Bio::EnsEMBL::Hive::Utils::load_file_or_module | ( | ) |
Description: This function takes one argument, tries to determine whether it is a module name ('::'-separated)
or a path to the module ('/'-separated), finds the module_name and dynamically loads it.Callers : scripts
Code:
| public Bio::EnsEMBL::Hive::Utils::parse_cmdline_options | ( | ) |
Description: This function reads all options from command line into a key-value hash
(keys must be prefixed with a single or double dash, the following term becomes the value).
The rest of the terms go into the list.
Command line options are not removed from , so the same or another parser can be run again if needed.Callers : scripts
Code:
| public Bio::EnsEMBL::Hive::Utils::script_usage | ( | ) |
Description: This function takes one argument (return value).
It attempts to run perldoc on the current script, and if perldoc is not present, emulates its behaviour.
Then it exits with the return value given.Callers : scripts
Code:
| public List Bio::EnsEMBL::Hive::Utils::split_for_bash | ( | ) |
Description: This function takes one argument (String) and splits it assuming it represents bash command line parameters.
It mainly splits on whitespace, except for cases when spaces are trapped between quotes or apostrophes.
In the latter case the outer quotes are removed.
Returntype : list of Strings
Code:
| public Bio::EnsEMBL::Hive::Utils::stringify | ( | ) |
Description: This function takes in a Perl data structure and stringifies it using specific configuration
that allows us to store/recreate this data structure according to our specific storage/communication requirements.Callers : Bio::EnsEMBL::Hive::DBSQL::AnalysisJobAdaptor # stringification of input_id() hash Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf # stringification of parameters() hash
Code:
| public Bio::EnsEMBL::Hive::Utils::throw | ( | ) |
Undocumented method
Code:
| public Bio::EnsEMBL::Hive::Utils::url2dbconn_hash | ( | ) |
Undocumented method
Code: