Inherits from:
No subclasses
Overview
SpeciesDefs - Ensembl web configuration accessor This module provides programatic access to the web site configuration data stored in the $ENSEMBL_SERVERROOT/conf/*.ini (INI) files. See $ENSEMBL_SERVERROOT/conf/ini.README for details. Owing to the overhead implicit in parsing the INI files, two levels of caching (memory, filesystem) have been implemented. To update changes made to an INI file, the running process (e.g. httpd) must be halted, and the $ENSEMBL_SERVERROOT/conf/config.packed file removed. In the absence of a cache, the INI files are automatically parsed parsed at object instantiation. In the case of the Ensembl web site, this occurs at server startup via the $ENSEMBL_SERVERROOT/conf/perl.startup script. The filesystem cache is not enabled by default; the SpeciesDefs::store method is used to do this explicitly. Example usage: use SpeciesDefs; my $speciesdefs = SpeciesDefs->new; # List all configured species my @species = $speciesdefs->valid_species(); # Test to see whether a species is configured if( scalar( $species_defs->valid_species('Homo_sapiens') ){ } # Getting a setting (parameter value/section data) from the config my $sp_name = $speciesdefs->get_config('Homo_sapiens','SPECIES_COMMON_NAME'); # Alternative setting getter - uses autoloader my $sp_bio_name = $speciesdefs->SPECIE_%S_COMMON_NAME('Homo_sapiens'); # Can also use the ENSEMBL_SPECIES environment variable ENV{'ENSEMBL_SPECIES'} = 'Homo_sapiens'; my $sp_bio_name = $speciesdefs->SPECIES_COMMON_NAME; # Getting a parameter with multiple values my( @chromosomes ) = @{$speciesdefs->ENSEMBL_CHROMOSOMES};Accessor
Constructor
Method
- _convert_date
- _format_error (EnsEMBL::Web::Root)
- _is_available_artefact
- _load_in_webtree
- _parse
- anyother_species
- de_romanize (EnsEMBL::Web::Root)
- dynamic_use (EnsEMBL::Web::Root)
- dynamic_use_failure (EnsEMBL::Web::Root)
- evaluate_bp (EnsEMBL::Web::Root)
- get_config
- get_table_size
- is_valid_module_name (EnsEMBL::Web::Root)
- make_directory (EnsEMBL::Web::Root)
- neat_sr_name (EnsEMBL::Web::Root)
- not_allowed (EnsEMBL::Web::Root)
- other_species
- parse
- pretty_date (EnsEMBL::Web::Root)
- retrieve
- round_bp (EnsEMBL::Web::Root)
- seq_region_sort (EnsEMBL::Web::Root)
- set_config
- set_write_access
- store
- temp_file_create (EnsEMBL::Web::Root)
- temp_file_name (EnsEMBL::Web::Root)
- templatize (EnsEMBL::Web::Root)
- thousandify (EnsEMBL::Web::Root)
- ticket (EnsEMBL::Web::Root)
- timer
- translate
- url (EnsEMBL::Web::Root)
- valid_species
Unknown
- DESTROY
- _expand_database_templates
- _info_line
- _info_log
- _merge_db_tree
- _merge_in_dhtml
- _munge_colours
- _parse_referer (EnsEMBL::Web::Root)
- _promote_general
- _read_in_ini_file
- compara_like_databases
- dump
- filters (EnsEMBL::Web::Root)
- get_all_das
- help_feedback (EnsEMBL::Web::Root)
- is_available (EnsEMBL::Web::Root)
- marts
- multi_hash
- multi_val
- species_dropdown
- species_label
- table_info
- table_info_other
- timer_push
Methods
- AUTOLOAD
Accessor.
View source
_convert_date
Converts a date from a species database into a human-friendly format for web display
Argument | date in format YYYY-MM with optional -string attached |
View source
_format_error
Format an error message by wrapping text to 120 columns
Inherited from EnsEMBL::Web::Root
View source
_is_available_artefact
Checks to see if a given artefact is available (or not available) in the stored configuration for a particular species
Arguments | species name (defaults to the current species), artefact to check for (string - artefact type and id, space separated) |
View source
_load_in_webtree
Load in the contents of the web tree.... Check for cached value first....
View source
_parse
Does the actual parsing of .ini files (1) Open up the DEFAULTS.ini file(s) Foreach species open up all {species}.ini file(s) merge in content of defaults load data from db.packed file make other manipulations as required Repeat for MULTI.iniReturns: boolean
View source
all_search_indexes
Accessor.
View source
anyother_species
DEPRECATED - use get_config instead
View source
colour
Accessor. return the colour associated with the $key of $set colour set (or the whole hash associated reference);
View source
de_romanize
Converts a number from roman (IV...) format to number...
Inherited from EnsEMBL::Web::Root
View source
dynamic_use
Equivalent of USE - but used at runtime
Inherited from EnsEMBL::Web::Root
View source
dynamic_use_failure
Return error message cached if use previously failed!
Inherited from EnsEMBL::Web::Root
View source
evaluate_bp
Reverse of round BP - takes a value with a K/M/G at the end and converts to integer value...
Inherited from EnsEMBL::Web::Root
View source
get_config
Arguments | species name(string), parameter name (string) |
View source
get_table_size
Accessor function for table size,
Arguments | hashref: {-db => 'database' (e.g. 'DATABASE_CORE'), -table =>'table name' (e.g. 'feature' ) } species name (string) |
View source
is_valid_module_name
returns true if valid module name...
Inherited from EnsEMBL::Web::Root
View source
make_directory
Creates a writeable directory - making sure all parents exist!
Inherited from EnsEMBL::Web::Root
View source
multi
Accessor.
Arguments | configuration type (string), species name (string) |
View source
multiX
Accessor.
Arguments | configuration type (string) |
View source
multidb
Accessor.
View source
name
Accessor. returns the name of the current species
View source
neat_sr_name
Returns seq-region name formatted neatly...
Inherited from EnsEMBL::Web::Root
View source
new
Constructor.
View source
new
Constructor. Constructs the class - as its a base class contains nothing.!
Inherited from EnsEMBL::Web::Root
View source
not_allowed
Loops through array of filters and returns the first one that fails
Inherited from EnsEMBL::Web::Root
View source
other_species
DEPRECATED - use get_config instead
View source
parse
Retrieves a stored configuration or creates a new one Caller: $self->new when filesystem and memory caches are emptyReturns: boolean
View source
pretty_date
Converts a MySQL datetime field into something human-readable
Inherited from EnsEMBL::Web::Root
View source
retrieve
Retrieves stored configuration from disk
Exceptions | The filesystem-cache file cannot be opened |
View source
round_bp
Returns #bp formatted neatly as either m/k
Inherited from EnsEMBL::Web::Root
View source
seq_region_sort
Used to sort chromosomes into a sensible order!
Inherited from EnsEMBL::Web::Root
View source
set_config
Overrides the config value for a given species and a given config key (use with care!)
Arguments | species name (string), parameter name (string), parameter value (any) |
View source
set_write_access
sets a given database adaptor to write access instead of read-only
Arguments | database type (e.g. 'core'), species name (string) |
View source
species_full_name
Accessor. returns full species name from the short name
View source
store
Creates filesystem-cache by storing config to disk.
Caller | perl.startup, on first (validation) pass of httpd.conf |
View source
temp_file_create
Creates a temporary file name and makes sure its parent directory exists
Inherited from EnsEMBL::Web::Root
View source
temp_file_name
Creates a random filename
Inherited from EnsEMBL::Web::Root
View source
templatize
Takes a string, and a template pattern and returns the string with "/" from the template inserted...
Inherited from EnsEMBL::Web::Root
View source
thousandify
Retuns comma separated version of number...
Inherited from EnsEMBL::Web::Root
View source
ticket
Returns a random ticket string
Inherited from EnsEMBL::Web::Root
View source
timer
Provides easy-access to the ENSEMBL_WEB_REGISTRY's timer
View source
translate
Dictionary functionality (not currently used)
Arguments | word to be translated (string) |
View source
url
Assembles a valid URL, adding the site's base URL and CGI-escaping any parametersreturns a URL string
Inherited from EnsEMBL::Web::Root
View source
valid_species
Filters the list of species to those configured in the object. If an empty list is passes, returns a list of all configured speciesReturns: array of configured species names
View source