Package org.bridgedb

Interface AttributeMapper

  • All Known Implementing Classes:
    IDMapperStack

    public interface AttributeMapper
    AttributeMapper knows about attributes for Xrefs.
    • Field Detail

      • MATCH_ID

        static final String MATCH_ID
        use this magic constant as the attrType parameter to also search for identifiers.
        See Also:
        Constant Field Values
    • Method Detail

      • getAttributes

        Set<String> getAttributes​(Xref ref,
                                  String attrType)
                           throws IDMapperException
        Get attributes for an entity, such as gene Symbol.
        Parameters:
        ref - the entity to get the attribute for
        attrType - the attribute to look for, e.g. 'Symbol' or 'Description'.
        Returns:
        the attribute, or null if nothing was found
        Throws:
        IDMapperException - if the mapping service is (temporarily) unavailable
      • getAttributes

        Map<String,​Set<String>> getAttributes​(Xref ref)
                                             throws IDMapperException
        Get all attributes for an entity. Usually this method is more efficient if you want to query several attributes in a sequence.
        Parameters:
        ref - the entity to get the attributes for
        Returns:
        a Map where attribute names are the keys and attribute values are the values.
        Throws:
        IDMapperException - if the mapping service is (temporarily) unavailable
      • isFreeAttributeSearchSupported

        boolean isFreeAttributeSearchSupported()
        Returns:
        true if free attribute search is supported, false otherwise.
      • freeAttributeSearch

        Map<Xref,​String> freeAttributeSearch​(String query,
                                                   String attrType,
                                                   int limit)
                                            throws IDMapperException
        free text search for matching attributes.
        Parameters:
        query - The text to search for
        attrType - the attribute to look for, e.g. 'Symbol' or 'Description'. If you use the special MATCH_ID constant, it will query the identifier instead.
        limit - The number of results to limit the search to
        Returns:
        map references and attribute values that match the query
        Throws:
        IDMapperException - if the mapping service is (temporarily) unavailable
      • freeAttributeSearchEx

        Map<Xref,​Set<String>> freeAttributeSearchEx​(String query,
                                                          String attrType,
                                                          int limit)
                                                   throws IDMapperException
        Improved version of free text search for matching attributes. Unlike freeAttributeSearch, this method may return multiple results per xref.
        Parameters:
        query - The text to search for
        attrType - the attribute to look for, e.g. 'Symbol' or 'Description'. If you use the special MATCH_ID constant, it will query the identifier instead.
        limit - The number of results to limit the search to
        Returns:
        map of references and attribute values that match the query
        Throws:
        IDMapperException - if the mapping service is (temporarily) unavailable
      • getAttributeSet

        Set<String> getAttributeSet()
                             throws IDMapperException
        Set of attributes provided by this AttributeMapper. There is no guarantee that a specific Xref has these attributes.
        Returns:
        set of available attributes in this AttributeMapper. If there are none available, returns an empty set.
        Throws:
        IDMapperException - if the mapping service is (temporarily) unavailable