This module is an implementation of Bio::EnsEMBL::LookUp that uses a local hash to store information about available Ensembl Genomes data. It can be constructed in a number of different ways: A remote cache file containing a JSON representation of the hash can be supplied: my $lookup = Bio::EnsEMBL::LookUp::LocalLookUp->new(-URL=>'http://bacteria.ensembl.org/registry.json'); Alternatively, a local file containing the required JSON can be specified instead: my $lookup = Bio::EnsEMBL::LookUp::LocalLookUp->new(-FILE=>"/path/to/reg.json"); Finally, a Registry already loaded with core databases can be supplied: my $lookup = Bio::EnsEMBL::LookUp::LocalLookUp->new(-REGISTRY=>'Bio::EnsEMBL::Registry'); If the standard Registry is used, the argument can be omitted completely: my $lookup = Bio::EnsEMBL::LookUp::LocalLookUp->new(); To populate the registry with just the Ensembl Genomes databases for the current software release on a specified server, the following method can be used: Bio::EnsEMBL::LookUp::LocalLookUp->register_all_dbs( $host, $port, $user, $pass); Once a lookup has been created, it can be used as specified in Bio::EnsEMBL::LookUp
protected Bio::EnsEMBL::LookUp::LocalLookUp::_add_aliases | ( | ) |
Description : Registry all aliases Argument : Species name Argument : Arrayref of alias strings
protected Bio::EnsEMBL::LookUp::LocalLookUp::_check_name | ( | ) |
Description : Check that the name is not longer than 64 characters Argument : Name to check
protected Bio::EnsEMBL::LookUp::LocalLookUp::_dba_id | ( | ) |
Undocumented method
protected Bio::EnsEMBL::LookUp::LocalLookUp::_dba_to_locator | ( | ) |
Description : return a hash key for a DBAdaptor Argument : Bio::EnsEMBL::DBAdaptor
protected Bio::EnsEMBL::LookUp::LocalLookUp::_dbc_to_locator | ( | ) |
Description : return a hash key for a DBConnection Argument : Bio::EnsEMBL::DBConnection
protected Bio::EnsEMBL::LookUp::LocalLookUp::_get_dbc_meta | ( | ) |
Undocumented method
protected Bio::EnsEMBL::LookUp::LocalLookUp::_hash_dba | ( | ) |
Description : Add details from a DBAdaptor to the internal hashes of details Argument : Bio::EnsEMBL::DBAdaptor Argument : (optional) If set to 1, do not update from a DBAdaptor if already processed (allows updates of an existing LookUp instance)
protected Bio::EnsEMBL::LookUp::LocalLookUp::_hash_dba_from_values | ( | ) |
Description : Add supplied details to the internal hashes of details Argument : Bio::EnsEMBL::DBAdaptor to hash Argument : Arrayref of taxonomy IDs to use as keys Argument : Arrayref of aliases to use as keys Argument : Arrayref of ENA accessions to use as keys
protected Bio::EnsEMBL::LookUp::LocalLookUp::_intern_db_connections | ( | ) |
Description : Go through all available DBAdaptors of registry and ensure they use the same DBConnection instance. Exceptions : None Status : At Risk
protected Bio::EnsEMBL::LookUp::LocalLookUp::_invert_dba_hash | ( | ) |
Undocumented method
protected Bio::EnsEMBL::LookUp::LocalLookUp::_load_registry_from_json | ( | ) |
Description : load the registry from the supplied JSON string Argument : JSON string
protected Bio::EnsEMBL::LookUp::LocalLookUp::_login_hash | ( | ) |
Description : Generate dbadaptor login hash from supplied arguments Argument : Host Argument : Port Argument : User Argument : Password
protected Bio::EnsEMBL::LookUp::LocalLookUp::_query_multispecies_db | ( | ) |
Description : Find all species in the multispecies database
protected void Bio::EnsEMBL::LookUp::LocalLookUp::_register_dba | ( | ) |
Description : Add a single DBAdaptor to the registry and the internal hashes of details Argument : Bio::EnsEMBL::DBAdaptor Return : None
protected Bio::EnsEMBL::LookUp::LocalLookUp::_register_multispecies_core | ( | ) |
Description : Register core dbas for all species in the supplied database
protected Bio::EnsEMBL::LookUp::LocalLookUp::_register_multispecies_x | ( | ) |
Description : Register specified dba type for all species in the supplied database
protected Bio::EnsEMBL::LookUp::LocalLookUp::_register_singlespecies_core | ( | ) |
Description : Register core dbas for all species in the supplied database
protected Arrayref Bio::EnsEMBL::LookUp::LocalLookUp::_registry_to_hash | ( | ) |
Description : Generate a hash array structure for the current registry and species details for turning to JSON Returns : Arrayref of hashes
protected Bio::EnsEMBL::LookUp::LocalLookUp::_registry_to_json | ( | ) |
Undocumented method
protected Bio::EnsEMBL::LookUp::LocalLookUp::_runtime_include | ( | ) |
Description : Load the specified module (usually a DatabaseAdaptor) Argument : Module name
public File Bio::EnsEMBL::LookUp::LocalLookUp::cache_file | ( | ) |
Arg [1] : File to use for local caching Description : Sets and retrieves the local cache file Returntype : File name if set; otherwise undef Status : Stable
public Bio::EnsEMBL::LookUp::LocalLookUp::clear_cache | ( | ) |
Undocumented method
public Arrayref Bio::EnsEMBL::LookUp::LocalLookUp::dba_to_args | ( | ) |
Description : Dump the arguments needed for contructing a DBA Argument : Bio::EnsEMBL::DBAdaptor Return : Arrayref of args
public Arrayref Bio::EnsEMBL::LookUp::LocalLookUp::get_all | ( | ) |
Description : Return all database adaptors that have been retrieved from registry Argument : None Exceptions : None Return type : Arrayref of Bio::EnsEMBL::DBSQL::DatabaseAdaptor
public Arrayref Bio::EnsEMBL::LookUp::LocalLookUp::get_all_accessions | ( | ) |
Description : Return list of all INSDC sequence accessions (or other seq_region names) registered with the helper Exceptions : None Return type : Arrayref of strings
public Arrayref Bio::EnsEMBL::LookUp::LocalLookUp::get_all_assemblies | ( | ) |
Description : Return list of all INSDC assembly accessions registered with the helper Exceptions : None Return type : Arrayref of strings
public Arrayref Bio::EnsEMBL::LookUp::LocalLookUp::get_all_by_accession | ( | ) |
Description : Returns the database adaptor(s) that contains a seq_region with the supplied INSDC accession (or other seq_region name) Argument : Int Exceptions : None Return type : Arrayref of Bio::EnsEMBL::DBSQL::DatabaseAdaptor
public Arrayref Bio::EnsEMBL::LookUp::LocalLookUp::get_all_by_dbname | ( | ) |
Description : Returns all database adaptors that have the supplied dbname Argument : String Exceptions : None Return type : Arrayref of Bio::EnsEMBL::DBSQL::DatabaseAdaptor
public Arrayref Bio::EnsEMBL::LookUp::LocalLookUp::get_all_by_name_pattern | ( | ) |
Description : Return all database adaptors that have an alias/name that match the supplied regexp Argument : String Exceptions : None Return type : Arrayref of Bio::EnsEMBL::DBSQL::DatabaseAdaptor
public Bio::EnsEMBL::LookUp::LocalLookUp::get_all_by_taxon_branch | ( | ) |
Undocumented method
public Arrayref Bio::EnsEMBL::LookUp::LocalLookUp::get_all_by_taxon_id | ( | ) |
Description : Returns all database adaptors that have the supplied taxonomy ID Argument : Int Exceptions : None Return type : Arrayref of Bio::EnsEMBL::DBSQL::DatabaseAdaptor
public Arrayref Bio::EnsEMBL::LookUp::LocalLookUp::get_all_DBConnections | ( | ) |
Description : Return all database connections used by the DBAs retrieved from the registry Argument : None Exceptions : None Return type : Arrayref of Bio::EnsEMBL::DBSQL::DBConnection
public Arrayref Bio::EnsEMBL::LookUp::LocalLookUp::get_all_dbnames | ( | ) |
Description : Return all database names used by the DBAs retrieved from the registry Argument : None Exceptions : None Return type : Arrayref of strings
public Arrayref Bio::EnsEMBL::LookUp::LocalLookUp::get_all_names | ( | ) |
Description : Return list of all species names registered with the helper Exceptions : None Return type : Arrayref of strings
public Arrayref Bio::EnsEMBL::LookUp::LocalLookUp::get_all_taxon_ids | ( | ) |
Description : Return list of all taxon IDs registered with the helper Exceptions : None Return type : Arrayref of integers
public Arrayref Bio::EnsEMBL::LookUp::LocalLookUp::get_all_versioned_accessions | ( | ) |
Description : Return list of all versioned INSDC sequence accessions (or other seq_region names) registered with the helper Exceptions : None Return type : Arrayref of strings
public Arrayref Bio::EnsEMBL::LookUp::LocalLookUp::get_all_versioned_assemblies | ( | ) |
Description : Return list of all versioned INSDC assembly accessions registered with the helper Exceptions : None Return type : Arrayref of strings
public Bio::EnsEMBL::DBSQL::DatabaseAdaptor Bio::EnsEMBL::LookUp::LocalLookUp::get_by_assembly_accession | ( | ) |
Description : Returns the database adaptor that contains the assembly with the supplied INSDC assembly accession Argument : Int Exceptions : None Return type : Bio::EnsEMBL::DBSQL::DatabaseAdaptor
public Arrayref Bio::EnsEMBL::LookUp::LocalLookUp::get_by_name_exact | ( | ) |
Description : Return all database adaptors that have the supplied string as an alias/name Argument : String Exceptions : None Return type : Arrayref of Bio::EnsEMBL::DBSQL::DatabaseAdaptor
public Bio::EnsEMBL::LookUp::LocalLookUp::load_registry_from_file | ( | ) |
Undocumented method
public Bio::EnsEMBL::LookUp::LocalLookUp::load_registry_from_url | ( | ) |
Undocumented method
public Bio::EnsEMBL::LookUp::LocalLookUp::new | ( | ) |
Undocumented method
public void Bio::EnsEMBL::LookUp::LocalLookUp::register_all_dbs | ( | ) |
Description : Helper method to load the registry with all multispecies core databases on the supplied server Argument : Host Argument : Port Argument : User Argument : Password Argument : (optional) String with database regexp (default is _collection_core_[0-9]_eVersion_[0-9]+) Exceptions : None Return type : None
public Registry Bio::EnsEMBL::LookUp::LocalLookUp::registry | ( | ) |
Arg [1] : Registry module to use (default is Bio::EnsEMBL::Registry) Description : Sets and retrieves the Registry Returntype : Registry if set; otherwise undef Exceptions : if an attempt is made to set the value more than once Status : Stable
public Bio::EnsEMBL::LookUp::LocalLookUp::taxonomy_adaptor | ( | ) |
Undocumented method
public Bio::EnsEMBL::LookUp::LocalLookUp::update_from_registry | ( | ) |
Description : Update internal hashes of database adaptors by name/taxids from the registry. Invoke when registry has been updated independently. Argument : (optional) If set to 1, do not update from a DBAdaptor if already processed (allows updates of an existing LookUp instance) Exceptions : None
public void Bio::EnsEMBL::LookUp::LocalLookUp::write_registry_to_file | ( | ) |
Description : Write the contents of the registry and species lists to a JSON file Argument : File name Return : None