Class UniRefQueryBuilder


  • public class UniRefQueryBuilder
    extends Object
    UniRefQueryBuilder class is for building a UniRef query for UniRef Services
    • Constructor Detail

      • UniRefQueryBuilder

        public UniRefQueryBuilder()
    • Method Detail

      • uniRefClusterDatabase

        public static Query uniRefClusterDatabase​(UniRefDatabaseType clusterDbType)
        Creates a query that searches for UniRef clusters within the given UniRef cluster database.

        Note: Use this query in conjunction with others to reduce the search space.

        Parameters:
        clusterDbType - the UniRef cluster database
        Returns:
        a query that will be run against the search engine
      • clusterId

        public static Query clusterId​(String uniRefId)
        Creates a query that searches for clusters with the given UniRef identifier
        Parameters:
        uniRefId - the unique UniRef entry identifier
        Returns:
        a query that will be run against the search engine
      • clusterName

        public static Query clusterName​(String clusterName)
        Creates a query that searches for clusters with the given cluster name
        Parameters:
        clusterName - the name of the UniRef cluster to search for
        Returns:
        a query that will be run against the search engine
      • organismName

        public static Query organismName​(String name)
        Creates a query that searches for UniRef clusters holding members that contain the given organism name.

        The search tem can be the scientific name, the common name, or a synonym.

        The query allows you to provide partial names for searching. Terms should be whole words, i.e. bact will not hit Bacteria. An organism with spaces or forward slashes are good candidates for partial searches, e.g. searching for hanedai will hit the organism name Shewanella hanedai, or searching for Yamada will hit the organism name Variola virus (isolate Human/Japan/Yamada MS-2(A)/1946) (VARV) (Smallpox virus).

        Note: The vaguer the search terms the higher the amount of entries you will have to potentially process and filter out.

        Parameters:
        name - the name of the species to query
        Returns:
        a query that will be run against the search engine
      • taxonId

        public static Query taxonId​(int taxId)
        Creates a query that searches for UniRef clusters holding members that contain the given NCBI taxonomic identifier.

        No partial searches are supported in this query.

        Parameters:
        taxId - an NCBI taxonomic identifier
        Returns:
        a query that will be run against the search engine
      • uniprotId

        public static Query uniprotId​(String uniprotId)
        Creates a query that searches for UniRef clusters holding members that contain uniprot id

        No partial searches are supported in this query.

        Parameters:
        taxId - an NCBI taxonomic identifier
        Returns:
        a query that will be run against the search engine
      • uniparcId

        public static Query uniparcId​(String uniparcId)
        Creates a query that searches for UniRef clusters holding members that contain uniparc id

        No partial searches are supported in this query.

        Parameters:
        taxId - an NCBI taxonomic identifier
        Returns:
        a query that will be run against the search engine
      • representativeId

        public static Query representativeId​(String representativeId)
      • representativeAccession

        public static Query representativeAccession​(String accession)
      • memberTaxonId

        public static Query memberTaxonId​(int taxId)
      • query

        public static Query query​(UniRefField.Search field,
                                  String value)
        Creates a simple query on the specified search field, based on some input text.
        Parameters:
        field - the search field on which to perform the query
        value - the search term that the results must satisfy
        Returns:
        a query that will be run against the search engine
      • and

        public static Query and​(Query... subQueries)
        The Query composition of the specified subQueries using 'and'.
        Parameters:
        subQueries - varargs of queries.
        Returns:
        the resulting universal conjunctive query
        Throws:
        IllegalArgumentException - of no queries are handed to the method
      • or

        public static Query or​(Query... subQueries)
        The Query composition of the specified subQueries using 'or'.
        Parameters:
        subQueries - varargs of queries.
        Returns:
        the resulting universal disjunctive query
        Throws:
        IllegalArgumentException - of no queries are handed to the method
      • not

        public static Query not​(UniRefField.Search field,
                                String value)
        Creates a query where the search field does not match the value specification.
        Parameters:
        field - the search field on which to perform the query
        value - the criteria that must not be satisfied
        Returns:
        a query that will be run against the search engine