Class BridgedbManager

java.lang.Object
net.bioclipse.managers.BridgedbManager
All Implemented Interfaces:
IBactingManager, net.bioclipse.managers.business.IBioclipseManager

public class BridgedbManager extends Object implements IBactingManager
Bioclipse manager that provides identifier mapping functionality using the BridgeDb framework.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BridgedbManager(String workspaceRoot)
    Creates a new BridgedbManager.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bridgedb.Xref
    curie(String curie)
    Creates a Xref 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 the IDMapper for the given provider.
     
    org.bridgedb.DataSource
    getSource(String source)
    Looks up the DataSource for the given system code.
    org.bridgedb.DataSource
    Looks up the DataSource for the given Bioregistry.io prefix.
    org.bridgedb.DataSource
    Looks up the DataSource for the given full name.
    List<org.bridgedb.DataSource>
    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 Java List.
    Returns all known sources as a Java List.
    Returns IDMappers supported by Bacting.
    org.bridgedb.IDMapper
    Creates a BridgeDb IDMapper for the given Derby database location.
    map(String restService, String identifier, String source)
    Using the given connection string, it returns mappings for the given identifier.
    map(String restService, String identifier, String source, String target)
    Using the given connection string, it returns mappings for the given identifier, but only for the given target data source.
    Set<org.bridgedb.Xref>
    map(String restService, org.bridgedb.Xref identifier)
    Using the given connection string, it returns mappings for the given identifier.
    Set<org.bridgedb.Xref>
    map(String restService, org.bridgedb.Xref identifier, String target)
    Using the given connection string, it returns mappings for the given identifier, but only for the given target data source.
    map(org.bridgedb.IDMapper database, String identifier, String source)
    Using the given IDMapper string, it returns mappings for the given identifier.
    map(org.bridgedb.IDMapper database, String identifier, String source, String target)
    Using the given IDMapper 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 given IDMapper string, it returns mappings for the given identifier.
    Set<org.bridgedb.Xref>
    map(org.bridgedb.IDMapper database, org.bridgedb.Xref source, String target)
    Using the given IDMapper string, it returns mappings for the given identifier, but only for the given target data source.
    org.bridgedb.DataSource
    Creates a new DataSource based on the system code and full name.
    search(String restService, String query, int limit)
    Using the given connection string, it returns mappings for the given identifier, but only for the given target data source.
    search(org.bridgedb.IDMapper database, String query, int limit)
    Searches in the given database for hits, with a given maximum.
    org.bridgedb.Xref
    xref(String sourcedIdentifier)
    Creates a Xref object for the given identifier.
    org.bridgedb.Xref
    xref(String identifier, String source)
    Creates a Xref object for the given identifier.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BridgedbManager

      public BridgedbManager(String workspaceRoot)
      Creates a new BridgedbManager.
      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 the DataSource 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 the DataSource 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 the DataSource for the given full name.
      Parameters:
      name - the full name
      Returns:
      the matching DataSource
      Throws:
      net.bioclipse.core.business.BioclipseException
    • listAllSources

      public List<String> listAllSources()
      Returns all known sources as a Java List.
      Returns:
      a Java List
    • listAllOrganisms

      public List<org.bridgedb.bio.Organism> listAllOrganisms()
      Returns all known organisms as a Java List.
      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 BridgeDb IDMapper to search in
      query - the content to search for
      limit - 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 string
      identifier - the identifier to return mappings for
      source - 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 string
      identifier - 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 given IDMapper string, it returns mappings for the given identifier.
      Parameters:
      database - the IDMapper to get the mappings from
      identifier - the identifier to return mappings for
      source - 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 string
      identifier - the identifier to return mappings for
      source - the data source of the identifier to return mappings for
      target - 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 string
      identifier - the Xref identifier to return mappings for
      target - 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 string
      query - what to search for
      limit - 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 given IDMapper string, it returns mappings for the given identifier, but only for the given target data source.
      Parameters:
      database - the IDMapper to get the mappings from
      identifier - the identifier to return mappings for
      source - the data source of the identifier to return mappings for
      target - 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 given IDMapper string, it returns mappings for the given identifier.
      Parameters:
      database - the IDMapper to get the mappings from
      source - 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 given IDMapper string, it returns mappings for the given identifier, but only for the given target data source.
      Parameters:
      database - the IDMapper to get the mappings from
      source - the identifier to return mappings for
      target - the data source for which to return mappings
      Returns:
      a Java List of mapped identifiers
      Throws:
      net.bioclipse.core.business.BioclipseException
    • curie

      public org.bridgedb.Xref curie(String curie) throws net.bioclipse.core.business.BioclipseException
      Creates a Xref 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 a Xref 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 a Xref object for the given identifier.
      Parameters:
      identifier - the identifier to return mappings for
      source - 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 BridgeDb IDMapper 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

      public org.bridgedb.DataSource registerDataSource(String code, String name)
      Creates a new DataSource based on the system code and full name.
      Parameters:
      code - the system code for the new data source
      name - the full name for the new data source
      Returns:
      the new DataSource object
    • listIDMapperProviders

      public List<String> listIDMapperProviders()
      Returns IDMappers supported by Bacting.
      Returns:
      a List with IDMappers
    • getIDMapper

      public org.bridgedb.IDMapper getIDMapper(String provider) throws net.bioclipse.core.business.BioclipseException
      Returns the IDMapper 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

      public String getManagerName()
      Specified by:
      getManagerName in interface net.bioclipse.managers.business.IBioclipseManager
    • doi

      public List<String> doi()
      Description copied from interface: IBactingManager
      Lists the DOIs of the articles associated to this manager.
      Specified by:
      doi in interface IBactingManager
      Returns:
      a List of String with DOIs