opentargets / issues

Issue tracker for Open Targets Platform and Open Targets Genetics Portal
https://platform.opentargets.org https://genetics.opentargets.org
Apache License 2.0
12 stars 2 forks source link

Building new facets on the Association on the Fly view - BE ticket #3239

Open buniello opened 3 months ago

buniello commented 3 months ago

As a user, I would like to be able to filter the "Associations on the fly" content by using similar facets to the ones implemented for the old associations page - left hand side of the main table. While some of the filtering functionalities have now been replaced by the new Target Prioritisation View, still most of them need to be re-thought. This ticket is to capture the BE implementation.

jdhayhurst commented 3 months ago

Proposal

User journey

  1. search for "facet(s)" to filter AOTF table rows (Bs) by
  2. select the "facet(s)" to apply the filter

Implementation

  1. a facet search index in opensearch that enables fuzzy text matching of facets, responds with facet label, facet category, facet id.
  2. updated API for target/diseaseAssociations that accepts and array of facet ids to filter with
  3. resolve facet ids -> BIDs
  4. AOTF clickhouse query with BID filter

tasks (TBC)

jdhayhurst commented 3 months ago

The facet search endpoint is available in the dev environment with a very minimal dummy dataset.

To query the endpoint, you need a query (i.e. what the user searches for) and an entity name (i.e. "target" or "disease") depending on whether the search is for target facets or disease facets. Here is an example for search for target facets with the query "ad":

query facetSearch{
  facets(queryString: "ad", entityNames: ["target"]){
    hits {
      id
      highlights
      label
      category
      entityIds
    }
    total
  }
} 

There are two results, the highest ranked is for a facet label and then there is a facet category:

{
  "data": {
    "facets": {
      "hits": [
        {
          "id": "fbVLn44BRu9hS_8PZd8Y",
          "highlights": [
            "<em>Adhesion</em>"
          ],
          "label": "Adhesion",
          "category": "Target Classes",
          "entityIds": [
            "ENSG00000168036"
          ],
          "score": 73.364746
        },
        {
          "id": "ebVLn44BRu9hS_8PZN-u",
          "highlights": [
            "<em>Advanced</em> Clinical"
          ],
          "label": "Advanced Clinical",
          "category": "Tractability Antibody",
          "entityIds": [
            "ENSG00000066468",
            "ENSG00000113721"
          ],
          "score": 69.14932
        }
      ],
      "total": 2
    }
  }
}

Please let me know if you have any questions about this.

buniello commented 2 months ago

UI feature for developed facets for AOTF should now be scoped - tagging @carcruz to initiate discussion