Class GoTermsWebService

java.lang.Object
ubic.gemma.rest.GoTermsWebService

@Service @Path("/goTerms") public class GoTermsWebService extends Object
RESTful interface for reverse GO-term lookup: GO term URI → genes annotated with it. Companion to GET /genes/{id}/goTerms (gene → its GO terms).

Drives the dataset Visualize tab's "pick genes by GO term" mode — visitor types a GO term, the UI calls /goTerms/{termUri}/genes and renders the candidate gene list for selection.

GO-term TYPEAHEAD is not a new endpoint; the existing GET /annotations/search?query=...&prefixes=GO_ already covers it (filters the Lucene index to GO URIs, ranks by Lucene score).

  • Constructor Details

    • GoTermsWebService

      public GoTermsWebService()
  • Method Details

    • getGenesByGoTerm

      @GET @Path("/{termUri}/genes") @Produces("application/json") public PaginatedResponseDataObject<GeneValueObject> getGenesByGoTerm(@PathParam("termUri") String termUri, @QueryParam("taxon") TaxonArg<?> taxonArg, @QueryParam("offset") @DefaultValue("0") OffsetArg offsetArg, @QueryParam("limit") @DefaultValue("100") LimitArg limitArg, @QueryParam("propagate") @DefaultValue("false") boolean propagate, @QueryParam("maxTerms") @DefaultValue("0") int maxTerms)
      Reverse lookup: genes annotated with the given GO term. termUri is the full OBO-style URI (http://purl.obolibrary.org/obo/GO_0006915); URL-encoded into the path segment.

      When propagate=true (default false) the lookup also includes the union of genes annotated to any subClassOf descendant of termUri — the natural semantic for a parent term like "regulation of apoptotic process" where the caller wants every gene under that umbrella. propagate=true requires the GO ontology to be loaded in the OntologyService; if it isn't, the call falls back to exact-term-only and logs a warning rather than 503-ing.

    • countGenesByGoTerm

      @GET @Path("/{termUri}/genes/count") @Produces("application/json") public ResponseDataObject<GoTermsWebService.GoTermGeneCountValueObject> countGenesByGoTerm(@PathParam("termUri") String termUri, @QueryParam("taxon") TaxonArg<?> taxonArg, @QueryParam("propagate") @DefaultValue("false") boolean propagate, @QueryParam("maxTerms") @DefaultValue("0") int maxTerms)
      Distinct-gene count for the given GO term, optionally including descendants. Cheap — goes through countByGOTermUris, which runs COUNT(DISTINCT gene.id) without materializing Gene rows. Use this in place of fetching the full gene list just to display "N genes annotated to {term}" badges.