public class DBRegistry extends Object implements Registry
Modifier and Type | Method and Description |
---|---|
boolean |
addSessionAlias(Species sp,
String alias) |
boolean |
addSessionAlias(String ensembl_genus_species_name,
String alias)
Method for an adhoc alias to be added by the user in this session.
|
static DBRegistry |
createEmptyRegistry() |
static DBRegistry |
createRegistryForConfiguration(RegistryConfiguration conf) |
static DBRegistry |
createRegistryForDataSource(DBConnection.DataSource type) |
static DBRegistry |
createRegistryForDataSourceAtReleaseVersion(DBConnection.DataSource type,
Integer release) |
static DBRegistry |
createRegistryForDataSourceCurrentRelease(DBConnection.DataSource type) |
static DBRegistry |
createUninitializedRegistryForConfiguration(RegistryConfiguration conf) |
static DBRegistry |
createUninitializedRegistryForDataSource(DBConnection.DataSource type) |
String |
findMybatisSchemaForSchemaVersion(DatabaseType type,
String schema_version) |
Set<? extends CollectionSpecies> |
getBacterialSpeciesForAliasBeginning(String alias) |
Set<? extends CollectionSpecies> |
getBacterialSpeciesForAliasContaining(String alias) |
StringBuilder |
getBriefRegistryReport()
Reports the connection and available database versions etc. for an initialized Registry.
|
DBCollection |
getCollection(String name,
String dbVersion) |
Collection<DBCollection> |
getCollectionRegistriesByName(String name) |
List<DBCollection> |
getCollections() |
Collection<DBCollection> |
getCollectionsByDBVersion(String dbVersion) |
List<DBCollectionSpecies> |
getCollectionSpecies()
Returns the combined list of DBCollectionSpecies that are indexed by
dbstylename (old_style_ and those indexed by GCAssemblyAccession (new
style, post v16)
|
ComparisonDatabase |
getComparaDatabase(EnsemblComparaDivision comparaDivision,
String db_version) |
Properties |
getConfigProperties() |
DBCollectionSpecies |
getCSpeciesByGCAccessionStem(String key) |
DBDatabase |
getDatabase(String species_name_or_alias) |
DBDatabase |
getDatabase(String speciesNameOrAlias_collectionName_comparaDivision,
DatabaseType database_type,
String db_version) |
DBDatabase |
getDatabase(String species_name_or_alias,
String db_version) |
DBDatabase |
getDatabaseForFullName(String fullname) |
TreeSet<DBDatabase> |
getDatabasesByType(DatabaseType type) |
DBConnection.DataSource |
getDatasourceType() |
TranscriptionEngine |
getDefaultTranscriptionEngine()
note by default translation by this default engine is configured to
convert non-Methionine initiations to Methionine
|
String |
getEnsemblNameForAlias(String alias)
Looks up the ensembl_genus_species_name for the given alias from the
ensemblNameForAliasHash hash of aliases in this Registry.
|
Set<String> |
getEnsemblNamesForAliasBeginning(String alias) |
Set<String> |
getEnsemblNamesForAliasContaining(String alias) |
List<DBCollectionSpecies> |
getGCAccessionedCollectionSpecies()
Utility method to return only those DBCOllectionSpecies that possess and
are indexed by a GCAssemblyAccession(Stem or Chain)
|
String |
getGCAssemblyAccessionForAlias(String alias)
Looks up the GC_assembly_accession_stem for the given alias of a
collectionspecies.
|
Set<String> |
getGCAssemblyAccessionsForAliasBeginning(String alias) |
Set<String> |
getGCAssemblyAccessionsForAliasContaining(String alias) |
int |
getHighestEnsemblSchemaVersion() |
int |
getHighestReleaseVersion() |
TreeSet<Integer> |
getKnownSchemaVersions() |
DBCollection |
getMostRecentCollection(String name) |
String |
getMostRecentDBVersion(String speciesOrCollection) |
String |
getMostRecentEnsemblVersion() |
DBSpecies |
getMostRecentSpeciesByAlias(String alias_or_name)
Returns the most recent Species matching the alias.
|
List<DBCollectionSpecies> |
getNamedCollectionSpecies()
Utility method to return only those DBCOllectionSpecies that do not
possess and are therefore not indexed by a GCAssemblyAccession but bey
dbstylename
|
Set<? extends CollectionSpecies> |
getOldStyleBacterialSpeciesForAliasBeginning(String alias) |
Set<? extends CollectionSpecies> |
getOldStyleBacterialSpeciesForAliasContaining(String alias) |
Set<DBSpecies> |
getPanComparaSpecies(String dbVersion) |
File |
getRegistryReport()
Reports the connection, available database versions, species and actual database names for an initialized Registry.
|
HashMap<String,String> |
getRenamedDBs() |
Collection<? extends Species> |
getSetOfEverySpeciesByAlias(String alias_or_name)
Returns a HashSet
|
Collection<? extends Species> |
getSetOfSpeciesByAlias(String alias_or_name)
Returns a HashSet
|
List<DBSpecies> |
getSpecies()
Fetches the list of all DBSpecies objects for this Registry.
|
DBSpecies |
getSpeciesByAlias(String alias_or_name)
Wraps getSetOfSpeciesByAlias(String alias_or_name) to return a single
species if the returned Collection has only one member.
|
DBSpecies |
getSpeciesByAlias(String alias_or_name,
String version)
Wraps getSetOfEverySpeciesByAlias(String alias_or_name) to return a
single species if the returned Collection has only one member with the
desired alias and version.
|
DBSpecies |
getSpeciesByEnsemblName(String ensemblName) |
Set<? extends Species> |
getSpeciesForAliasBeginning(String alias) |
Set<? extends Species> |
getSpeciesForAliasContaining(String alias) |
TranscriptionEngine |
getTranscriptionEngine(Integer codonTable) |
StringBuilder |
getVersionReport()
Reports the available database versions for this Registry.
|
void |
initialize(Integer release)
private initialisation method for the registry which connects to ensembl
via a DBDatasourceDAO and retrieves details on all the current tables and
creates database objects of the appropriate type for each.
|
boolean |
isSpeciesInPanHomology(Species querySpecies,
String dbVersion) |
DBDatabase |
makeDatabase(String db_name) |
void |
setConfiguration(DBConnection.DataSource type) |
void |
setConfiguration(RegistryConfiguration conf) |
void |
setSpeciesMetadata(CoreDatabase db)
should only be called for non current singlespecies core databases
|
protected org.apache.ibatis.session.SqlSessionFactory sqlMapper
protected Properties configProperties
protected SchemaVersion schemaVersion
protected DBConnection dbConnection
protected TreeSet<Integer> knownSchemaVersions
protected TreeMap<String,DBSpecies> speciesHash
protected TreeMap<String,DBCollectionSpecies> oldstyle_collectionspeciesHashByDBName
protected TreeMap<String,DBCollectionSpecies> collectionspeciesHashByGCAccession
protected List<DBCollection> collections
protected TreeMap<String,TreeMap<String,DBCollection>> collectionNameDBVersionHash
protected TreeMap<String,String> ensemblNameForAliasHash
protected TreeMap<String,String> assemblyAccessionStemForAliasHash
protected TreeSet<DBDatabase> allDatabases
protected TreeSet<DBSingleSpeciesDatabase> singleSpeciesDatabases
protected TreeSet<DBComparisonDatabase> comparisonDatabases
protected HashMap<EnsemblComparaDivision,HashMap<String,DBComparisonDatabase>> comparaDBByDivision
protected TreeSet<DBCollectionDatabase> collectionDatabases
protected StringBuilder tooNewDB
protected StringBuilder unknownDB
protected RegistryConfiguration regConfig
protected boolean alreadyInitialized
protected boolean alreadyParsed
protected HashMap<String,String> renamedDBs
public static DBRegistry createEmptyRegistry()
public static DBRegistry createRegistryForDataSource(DBConnection.DataSource type) throws ConfigurationException, DAOException
ConfigurationException
DAOException
public static DBRegistry createUninitializedRegistryForDataSource(DBConnection.DataSource type) throws ConfigurationException, DAOException
ConfigurationException
DAOException
public static DBRegistry createRegistryForConfiguration(RegistryConfiguration conf) throws ConfigurationException, DAOException
ConfigurationException
DAOException
public static DBRegistry createUninitializedRegistryForConfiguration(RegistryConfiguration conf) throws ConfigurationException, DAOException
ConfigurationException
DAOException
public static DBRegistry createRegistryForDataSourceCurrentRelease(DBConnection.DataSource type) throws ConfigurationException, DAOException
ConfigurationException
DAOException
public static DBRegistry createRegistryForDataSourceAtReleaseVersion(DBConnection.DataSource type, Integer release) throws ConfigurationException, DAOException
ConfigurationException
DAOException
public void setConfiguration(RegistryConfiguration conf) throws ConfigurationException, DAOException
ConfigurationException
DAOException
public void setConfiguration(DBConnection.DataSource type) throws ConfigurationException, DAOException
ConfigurationException
DAOException
public void initialize(Integer release) throws DAOException, ConfigurationException
release
- DAOException,
- ConfigurationExceptionConfigurationException
DAOException
public StringBuilder getVersionReport()
getVersionReport
in interface Registry
public StringBuilder getBriefRegistryReport()
getBriefRegistryReport
in interface Registry
public File getRegistryReport() throws IOException
getRegistryReport
in interface Registry
IOException
public Properties getConfigProperties()
getConfigProperties
in interface Registry
public String getMostRecentEnsemblVersion()
getMostRecentEnsemblVersion
in interface Registry
public String getMostRecentDBVersion(String speciesOrCollection) throws NonUniqueException
NonUniqueException
public TreeSet<Integer> getKnownSchemaVersions()
public int getHighestEnsemblSchemaVersion() throws DAOException, ConfigurationException
getHighestEnsemblSchemaVersion
in interface Registry
DAOException
ConfigurationException
public int getHighestReleaseVersion() throws DAOException, ConfigurationException
getHighestReleaseVersion
in interface Registry
DAOException
ConfigurationException
public DBDatabase getDatabase(String species_name_or_alias) throws NonUniqueException
getDatabase
in interface Registry
NonUniqueException
public DBDatabase getDatabase(String species_name_or_alias, String db_version) throws NonUniqueException
getDatabase
in interface Registry
NonUniqueException
public DBDatabase getDatabase(String speciesNameOrAlias_collectionName_comparaDivision, DatabaseType database_type, String db_version) throws NonUniqueException
getDatabase
in interface Registry
NonUniqueException
public ComparisonDatabase getComparaDatabase(EnsemblComparaDivision comparaDivision, String db_version)
getComparaDatabase
in interface Registry
public DBDatabase getDatabaseForFullName(String fullname)
getDatabaseForFullName
in interface Registry
public TreeSet<DBDatabase> getDatabasesByType(DatabaseType type)
getDatabasesByType
in interface Registry
public String findMybatisSchemaForSchemaVersion(DatabaseType type, String schema_version)
findMybatisSchemaForSchemaVersion
in interface Registry
public String getEnsemblNameForAlias(String alias) throws NonUniqueException
getEnsemblNameForAlias
in interface Registry
alias
- StringNonUniqueException
public String getGCAssemblyAccessionForAlias(String alias) throws NonUniqueException
alias
- StringNonUniqueException
public Set<String> getEnsemblNamesForAliasBeginning(String alias)
getEnsemblNamesForAliasBeginning
in interface Registry
public Set<String> getEnsemblNamesForAliasContaining(String alias)
getEnsemblNamesForAliasContaining
in interface Registry
public Set<String> getGCAssemblyAccessionsForAliasBeginning(String alias)
getGCAssemblyAccessionsForAliasBeginning
in interface Registry
public Set<String> getGCAssemblyAccessionsForAliasContaining(String alias)
getGCAssemblyAccessionsForAliasContaining
in interface Registry
public Set<? extends Species> getSpeciesForAliasBeginning(String alias)
getSpeciesForAliasBeginning
in interface Registry
public Set<? extends Species> getSpeciesForAliasContaining(String alias)
getSpeciesForAliasContaining
in interface Registry
public Set<? extends CollectionSpecies> getBacterialSpeciesForAliasBeginning(String alias)
getBacterialSpeciesForAliasBeginning
in interface Registry
public Set<? extends CollectionSpecies> getBacterialSpeciesForAliasContaining(String alias)
getBacterialSpeciesForAliasContaining
in interface Registry
public Set<? extends CollectionSpecies> getOldStyleBacterialSpeciesForAliasBeginning(String alias)
getOldStyleBacterialSpeciesForAliasBeginning
in interface Registry
public Set<? extends CollectionSpecies> getOldStyleBacterialSpeciesForAliasContaining(String alias)
getOldStyleBacterialSpeciesForAliasContaining
in interface Registry
public boolean addSessionAlias(String ensembl_genus_species_name, String alias) throws Exception
addSessionAlias
in interface Registry
ensembl_genus_species_name
- Ensmebl databse dbVersion of the name,
e.g. 'homo_sapiens'alias
- any string the user wants to use an alias for thisException
- if update fails, with meaning full messagepublic boolean addSessionAlias(Species sp, String alias) throws Exception
addSessionAlias
in interface Registry
Exception
public Collection<? extends Species> getSetOfSpeciesByAlias(String alias_or_name)
getSetOfSpeciesByAlias
in interface Registry
alias_or_name
- public Collection<? extends Species> getSetOfEverySpeciesByAlias(String alias_or_name)
getSetOfEverySpeciesByAlias
in interface Registry
alias_or_name
- public DBSpecies getSpeciesByAlias(String alias_or_name) throws NonUniqueException
getSpeciesByAlias
in interface Registry
alias_or_name
- NonUniqueException
public DBSpecies getSpeciesByAlias(String alias_or_name, String version) throws NonUniqueException
getSpeciesByAlias
in interface Registry
alias_or_name
- NonUniqueException
public DBSpecies getMostRecentSpeciesByAlias(String alias_or_name) throws NonUniqueException
getMostRecentSpeciesByAlias
in interface Registry
alias_or_name
- NonUniqueException
public DBSpecies getSpeciesByEnsemblName(String ensemblName)
getSpeciesByEnsemblName
in interface Registry
public DBCollectionSpecies getCSpeciesByGCAccessionStem(String key)
public DBCollection getMostRecentCollection(String name)
getMostRecentCollection
in interface Registry
public DBCollection getCollection(String name, String dbVersion)
getCollection
in interface Registry
public Collection<DBCollection> getCollectionRegistriesByName(String name)
getCollectionRegistriesByName
in interface Registry
public Collection<DBCollection> getCollectionsByDBVersion(String dbVersion)
getCollectionsByDBVersion
in interface Registry
public List<DBCollection> getCollections()
getCollections
in interface Registry
public List<DBSpecies> getSpecies()
getSpecies
in interface Registry
public List<DBCollectionSpecies> getCollectionSpecies()
getCollectionSpecies
in interface Registry
public List<DBCollectionSpecies> getGCAccessionedCollectionSpecies()
public List<DBCollectionSpecies> getNamedCollectionSpecies()
public DBConnection.DataSource getDatasourceType()
getDatasourceType
in interface Registry
public DBDatabase makeDatabase(String db_name) throws ConfigurationException
makeDatabase
in interface Registry
ConfigurationException
public void setSpeciesMetadata(CoreDatabase db) throws DAOException
setSpeciesMetadata
in interface Registry
db
- DAOException
public TranscriptionEngine getDefaultTranscriptionEngine()
getDefaultTranscriptionEngine
in interface Registry
public TranscriptionEngine getTranscriptionEngine(Integer codonTable)
getTranscriptionEngine
in interface Registry
public HashMap<String,String> getRenamedDBs()
getRenamedDBs
in interface Registry
public boolean isSpeciesInPanHomology(Species querySpecies, String dbVersion)
isSpeciesInPanHomology
in interface Registry
public Set<DBSpecies> getPanComparaSpecies(String dbVersion)
JEnsembl: A Java API for Ensembl Data Access v1.78
© Roslin Institute 2010-14. GNU General Public License, version3