Package net.bioclipse.managers
Class BridgedbManager
java.lang.Object
net.bioclipse.managers.BridgedbManager
- All Implemented Interfaces:
IBactingManager
,net.bioclipse.managers.business.IBioclipseManager
Bioclipse manager that provides identifier mapping functionality
using the BridgeDb framework.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.bridgedb.Xref
Creates aXref
object for the given Bioregistry.io compact identifier.doi()
Lists the DOIs of the articles associated to this manager.org.bridgedb.IDMapper
getIDMapper
(String provider) Returns theIDMapper
for the given provider.org.bridgedb.DataSource
Looks up theDataSource
for the given system code.org.bridgedb.DataSource
getSourceByPrefix
(String source) Looks up theDataSource
for the given Bioregistry.io prefix.org.bridgedb.DataSource
getSourceFromName
(String name) Looks up theDataSource
for the given full name.List<org.bridgedb.DataSource>
guessIdentifierType
(String identifier) Based on the given identifier, tries to guess what database that identifier comes from.List<org.bridgedb.bio.Organism>
Returns all known organisms as a JavaList
.Returns all known sources as a JavaList
.Returns IDMappers supported by Bacting.org.bridgedb.IDMapper
loadRelationalDatabase
(String location) Creates a BridgeDbIDMapper
for the given Derby database location.Using the given connection string, it returns mappings for the given identifier.Using the given connection string, it returns mappings for the given identifier, but only for the given target data source.Set<org.bridgedb.Xref>
Using the given connection string, it returns mappings for the given identifier.Set<org.bridgedb.Xref>
Using the given connection string, it returns mappings for the given identifier, but only for the given target data source.Using the givenIDMapper
string, it returns mappings for the given identifier.Using the givenIDMapper
string, it returns mappings for the given identifier, but only for the given target data source.Set<org.bridgedb.Xref>
map
(org.bridgedb.IDMapper database, org.bridgedb.Xref source) Using the givenIDMapper
string, it returns mappings for the given identifier.Set<org.bridgedb.Xref>
Using the givenIDMapper
string, it returns mappings for the given identifier, but only for the given target data source.org.bridgedb.DataSource
registerDataSource
(String code, String name) Creates a newDataSource
based on the system code and full name.Using the given connection string, it returns mappings for the given identifier, but only for the given target data source.Searches in the given database for hits, with a given maximum.org.bridgedb.Xref
Creates aXref
object for the given identifier.org.bridgedb.Xref
Creates aXref
object for the given identifier.
-
Constructor Details
-
BridgedbManager
Creates a newBridgedbManager
.- Parameters:
workspaceRoot
- location of the workspace, e.g. "."
-
-
Method Details
-
getSourceByPrefix
public org.bridgedb.DataSource getSourceByPrefix(String source) throws net.bioclipse.core.business.BioclipseException Looks up theDataSource
for the given Bioregistry.io prefix.- Parameters:
source
- the system code- Returns:
- the matching
DataSource
- Throws:
net.bioclipse.core.business.BioclipseException
-
getSource
public org.bridgedb.DataSource getSource(String source) throws net.bioclipse.core.business.BioclipseException Looks up theDataSource
for the given system code.- Parameters:
source
- the system code- Returns:
- the matching
DataSource
- Throws:
net.bioclipse.core.business.BioclipseException
-
getSourceFromName
public org.bridgedb.DataSource getSourceFromName(String name) throws net.bioclipse.core.business.BioclipseException Looks up theDataSource
for the given full name.- Parameters:
name
- the full name- Returns:
- the matching
DataSource
- Throws:
net.bioclipse.core.business.BioclipseException
-
listAllSources
Returns all known sources as a JavaList
.- Returns:
- a Java
List
-
listAllOrganisms
Returns all known organisms as a JavaList
.- Returns:
- a Java
List
-
search
public List<String> search(org.bridgedb.IDMapper database, String query, int limit) throws net.bioclipse.core.business.BioclipseException Searches in the given database for hits, with a given maximum.- Parameters:
database
- the BridgeDbIDMapper
to search inquery
- the content to search forlimit
- the maximum number of hits- Returns:
- the search results as a Java
List
- Throws:
net.bioclipse.core.business.BioclipseException
-
guessIdentifierType
public List<org.bridgedb.DataSource> guessIdentifierType(String identifier) throws net.bioclipse.core.business.BioclipseException Based on the given identifier, tries to guess what database that identifier comes from.- Parameters:
identifier
- the identifier to guess- Returns:
- a Java
List
is possible data sources - Throws:
net.bioclipse.core.business.BioclipseException
-
map
public List<String> map(String restService, String identifier, String source) throws net.bioclipse.core.business.BioclipseException Using the given connection string, it returns mappings for the given identifier.- Parameters:
restService
- the connection stringidentifier
- the identifier to return mappings forsource
- the data source of the identifier to return mappings for- Returns:
- a Java
List
of mapped identifiers - Throws:
net.bioclipse.core.business.BioclipseException
-
map
public Set<org.bridgedb.Xref> map(String restService, org.bridgedb.Xref identifier) throws net.bioclipse.core.business.BioclipseException Using the given connection string, it returns mappings for the given identifier.- Parameters:
restService
- the connection stringidentifier
- the identifier to return mappings for- Returns:
- a Java
List
of mapped identifiers - Throws:
net.bioclipse.core.business.BioclipseException
-
map
public List<String> map(org.bridgedb.IDMapper database, String identifier, String source) throws net.bioclipse.core.business.BioclipseException Using the givenIDMapper
string, it returns mappings for the given identifier.- Parameters:
database
- theIDMapper
to get the mappings fromidentifier
- the identifier to return mappings forsource
- the data source of the identifier to return mappings for- Returns:
- a Java
List
of mapped identifiers - Throws:
net.bioclipse.core.business.BioclipseException
-
map
public List<String> map(String restService, String identifier, String source, String target) throws net.bioclipse.core.business.BioclipseException Using the given connection string, it returns mappings for the given identifier, but only for the given target data source.- Parameters:
restService
- the connection stringidentifier
- the identifier to return mappings forsource
- the data source of the identifier to return mappings fortarget
- the data source for which to return mappings- Returns:
- a Java
List
of mapped identifiers - Throws:
net.bioclipse.core.business.BioclipseException
-
map
public Set<org.bridgedb.Xref> map(String restService, org.bridgedb.Xref identifier, String target) throws net.bioclipse.core.business.BioclipseException Using the given connection string, it returns mappings for the given identifier, but only for the given target data source.- Parameters:
restService
- the connection stringidentifier
- theXref
identifier to return mappings fortarget
- the data source for which to return mappings- Returns:
- a Java
List
of mapped identifiers - Throws:
net.bioclipse.core.business.BioclipseException
- when the connection to the REST service failed
-
search
public List<String> search(String restService, String query, int limit) throws net.bioclipse.core.business.BioclipseException Using the given connection string, it returns mappings for the given identifier, but only for the given target data source.- Parameters:
restService
- the REST server, or the full connection stringquery
- what to search forlimit
- maximal number of identifiers to be found- Returns:
- a Java
List
of found identifiers - Throws:
net.bioclipse.core.business.BioclipseException
-
map
public List<String> map(org.bridgedb.IDMapper database, String identifier, String source, String target) throws net.bioclipse.core.business.BioclipseException Using the givenIDMapper
string, it returns mappings for the given identifier, but only for the given target data source.- Parameters:
database
- theIDMapper
to get the mappings fromidentifier
- the identifier to return mappings forsource
- the data source of the identifier to return mappings fortarget
- the data source for which to return mappings- Returns:
- a Java
List
of mapped identifiers - Throws:
net.bioclipse.core.business.BioclipseException
-
map
public Set<org.bridgedb.Xref> map(org.bridgedb.IDMapper database, org.bridgedb.Xref source) throws net.bioclipse.core.business.BioclipseException Using the givenIDMapper
string, it returns mappings for the given identifier.- Parameters:
database
- theIDMapper
to get the mappings fromsource
- the identifier to return mappings for- Returns:
- a Java
List
of mapped identifiers - Throws:
net.bioclipse.core.business.BioclipseException
-
map
public Set<org.bridgedb.Xref> map(org.bridgedb.IDMapper database, org.bridgedb.Xref source, String target) throws net.bioclipse.core.business.BioclipseException Using the givenIDMapper
string, it returns mappings for the given identifier, but only for the given target data source.- Parameters:
database
- theIDMapper
to get the mappings fromsource
- the identifier to return mappings fortarget
- the data source for which to return mappings- Returns:
- a Java
List
of mapped identifiers - Throws:
net.bioclipse.core.business.BioclipseException
-
curie
Creates aXref
object for the given Bioregistry.io compact identifier.- Parameters:
curie
- the identifier- Returns:
- an
Xref
object - Throws:
net.bioclipse.core.business.BioclipseException
- when the compact identifier format is not recognized
-
xref
public org.bridgedb.Xref xref(String sourcedIdentifier) throws net.bioclipse.core.business.BioclipseException Creates aXref
object for the given identifier.- Parameters:
sourcedIdentifier
- the identifier- Returns:
- an
Xref
object - Throws:
net.bioclipse.core.business.BioclipseException
-
xref
public org.bridgedb.Xref xref(String identifier, String source) throws net.bioclipse.core.business.BioclipseException Creates aXref
object for the given identifier.- Parameters:
identifier
- the identifier to return mappings forsource
- the data source of the identifier to return mappings for- Returns:
- an
Xref
object - Throws:
net.bioclipse.core.business.BioclipseException
-
loadRelationalDatabase
public org.bridgedb.IDMapper loadRelationalDatabase(String location) throws net.bioclipse.core.business.BioclipseException Creates a BridgeDbIDMapper
for the given Derby database location.- Parameters:
location
- the location of the Derby file- Returns:
- the
IDMapper
object - Throws:
net.bioclipse.core.business.BioclipseException
-
registerDataSource
Creates a newDataSource
based on the system code and full name.- Parameters:
code
- the system code for the new data sourcename
- the full name for the new data source- Returns:
- the new
DataSource
object
-
listIDMapperProviders
Returns IDMappers supported by Bacting.- Returns:
- a
List
withIDMapper
s
-
getIDMapper
public org.bridgedb.IDMapper getIDMapper(String provider) throws net.bioclipse.core.business.BioclipseException Returns theIDMapper
for the given provider.- Parameters:
provider
- name of the provider, for example "Gene ID Mapping Database (Homo sapiens)"- Returns:
- the IDMapper for the given provider
- Throws:
net.bioclipse.core.business.BioclipseException
- when the mapping database could not be properly loaded
-
getManagerName
- Specified by:
getManagerName
in interfacenet.bioclipse.managers.business.IBioclipseManager
-
doi
Description copied from interface:IBactingManager
Lists the DOIs of the articles associated to this manager.- Specified by:
doi
in interfaceIBactingManager
- Returns:
- a
List
of String with DOIs
-