ensembl-hive  2.1
 All Classes Namespaces Files Functions Pages
Bio::EnsEMBL::Hive::Utils Class Reference

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 url2dbconn_hash ()
 
public go_figure_dbc ()
 
public throw ()
 

Detailed Description

Synopsis

# Example of an import:
use Bio::EnsEMBL::Hive::Utils 'stringify';
my $input_id_string = stringify($input_id_hash);
# Example of inheritance:
use base ('Bio::EnsEMBL::Hive::Utils', ...);
my $input_id_string = $self->stringify($input_id_hash);
# Example of a direct call:
use Bio::EnsEMBL::Hive::Utils;
my $input_id_string = Bio::EnsEMBL::Hive::Utils::stringify($input_id_hash);

Description

    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

Member Function Documentation

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:
click to view
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:
click to view
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:
click to view
public Bio::EnsEMBL::Hive::Utils::go_figure_dbc ( )

Undocumented method

Code:
click to view
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:
click to view
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:
click to view
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:
click to view
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:
click to view
public Bio::EnsEMBL::Hive::Utils::throw ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Utils::url2dbconn_hash ( )

Undocumented method

Code:
click to view

The documentation for this class was generated from the following file: