Class CvParameterLookupService


  • public class CvParameterLookupService
    extends Object
    Abstraction over OLSClient to autoconvert Terms to Parameters and to allow easy matching of Parameters against parent terms and their children.
    Author:
    nilshoffmann
    • Constructor Summary

      Constructors 
      Constructor Description
      CvParameterLookupService()
      Create a new instance of the lookup service with default OLS configuration.
      CvParameterLookupService​(uk.ac.ebi.pride.utilities.ols.web.service.client.OLSClient client)
      Create a new instance of the lookup service with a custom OLSClient.
      CvParameterLookupService​(uk.ac.ebi.pride.utilities.ols.web.service.config.OLSWsConfig config)
      Create a new instance of the lookup service with a custom OLSWsConfig configuration.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clearCaches()
      Clears all query result caches (parent and child).
      ParameterComparisonResult isChildOfOrSame​(de.isas.mztab2.model.Parameter parent, de.isas.mztab2.model.Parameter potentialChild)
      Compares two parameters for their parent to child relationship.
      List<de.isas.mztab2.model.Parameter> resolveChildren​(de.isas.mztab2.model.Parameter parameter)
      Resolve all children of a parameter up to an arbitrary depth.
      List<de.isas.mztab2.model.Parameter> resolveChildren​(de.isas.mztab2.model.Parameter parameter, int levels)
      Resolve all children of a parameter up to a given maximum depth (1 meaning immediate children, -1 meaning all).
      List<de.isas.mztab2.model.Parameter> resolveParents​(de.isas.mztab2.model.Parameter parameter)
      Resolve all parents of parameter up to an arbitrary depth (actually height, since we go from bottom to top).
      List<de.isas.mztab2.model.Parameter> resolveParents​(de.isas.mztab2.model.Parameter parameter, int levels)
      Resolve all parents of a parameter up to a given maximum depth (1 meaning the immediate parents, -1 meaning all).
    • Constructor Detail

      • CvParameterLookupService

        public CvParameterLookupService()
        Create a new instance of the lookup service with default OLS configuration.
      • CvParameterLookupService

        public CvParameterLookupService​(uk.ac.ebi.pride.utilities.ols.web.service.client.OLSClient client)
        Create a new instance of the lookup service with a custom OLSClient.
        Parameters:
        client - the custom OLS client
      • CvParameterLookupService

        public CvParameterLookupService​(uk.ac.ebi.pride.utilities.ols.web.service.config.OLSWsConfig config)
        Create a new instance of the lookup service with a custom OLSWsConfig configuration.
        Parameters:
        config - the custom configuration
    • Method Detail

      • clearCaches

        public void clearCaches()
        Clears all query result caches (parent and child).
      • resolveParents

        public List<de.isas.mztab2.model.Parameter> resolveParents​(de.isas.mztab2.model.Parameter parameter)
                                                            throws org.springframework.web.client.HttpClientErrorException
        Resolve all parents of parameter up to an arbitrary depth (actually height, since we go from bottom to top). Use at your own risk, the OLS service may terminate your connection if the response is too large or takes too long.
        Parameters:
        parameter - the parameter to start from
        Returns:
        a list of all parent parameters for the given parameter
        Throws:
        org.springframework.web.client.HttpClientErrorException
      • resolveParents

        public List<de.isas.mztab2.model.Parameter> resolveParents​(de.isas.mztab2.model.Parameter parameter,
                                                                   int levels)
                                                            throws org.springframework.web.client.HttpClientErrorException
        Resolve all parents of a parameter up to a given maximum depth (1 meaning the immediate parents, -1 meaning all).
        Parameters:
        parameter - the parameter to start from
        levels - maximum levels to query
        Returns:
        a list of all parent parameters for the given parameter
        Throws:
        org.springframework.web.client.HttpClientErrorException
      • resolveChildren

        public List<de.isas.mztab2.model.Parameter> resolveChildren​(de.isas.mztab2.model.Parameter parameter,
                                                                    int levels)
                                                             throws org.springframework.web.client.HttpClientErrorException
        Resolve all children of a parameter up to a given maximum depth (1 meaning immediate children, -1 meaning all).
        Parameters:
        parameter - the parameter to start from
        levels - maximum levels to query
        Returns:
        a list of all child parameters for the given parameter
        Throws:
        org.springframework.web.client.HttpClientErrorException
      • resolveChildren

        public List<de.isas.mztab2.model.Parameter> resolveChildren​(de.isas.mztab2.model.Parameter parameter)
                                                             throws org.springframework.web.client.HttpClientErrorException
        Resolve all children of a parameter up to an arbitrary depth. Use at your own risk, the OLS service may terminate your connection if the response is too large or takes too long.
        Parameters:
        parameter - the parameter to start from
        Returns:
        a list of all child parameters for the given parameter
        Throws:
        org.springframework.web.client.HttpClientErrorException
      • isChildOfOrSame

        public ParameterComparisonResult isChildOfOrSame​(de.isas.mztab2.model.Parameter parent,
                                                         de.isas.mztab2.model.Parameter potentialChild)
                                                  throws org.springframework.web.client.HttpClientErrorException
        Compares two parameters for their parent to child relationship. The result can be one of: IDENTICAL, if parent and potential child are the same node, CHILD_OF, if potentialChild is a child of parent (at least 1 level away), or NOT_RELATED, if there is no path from child to parent.
        Parameters:
        parent -
        potentialChild -
        Returns:
        the comparison result
        Throws:
        org.springframework.web.client.HttpClientErrorException