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

Displaying sumstats info (yes/no) for each study to facilitate data sorting for users #2627

Closed buniello closed 2 years ago

buniello commented 2 years ago

Following up from the feedback on OTG functionalities provided by BMS on 8-6-22.

As a user, I need to be able to select/sort studies with summary stats even before clicking on the "gene prioritisation" tab. This will allow a better user experience with quicker navigation through the data. This should be a straightforward task.

Tasks

1) On the Target/gene page: add this next to each row in the L2G table and the coloc table (see example below)

Screenshot 2022-06-13 at 09 56 06

2) On the Variant page: add this in the tables (see example below)

Screenshot 2022-06-13 at 10 09 37

3) On the gene prioritisation page: add this in the ‘Association Summary’ section, under "study details" (see example below)

Screenshot 2022-06-13 at 10 25 09

Acceptance tests

How do we know the task is complete?

  1. When the pages/tables mentioned above display the "has sumstats - yes/no" field
  2. Test
bruno-ariano commented 2 years ago

On the cloud and also in this link: ftp://ftp.ebi.ac.uk/pub/databases/opentargets/genetics/latest/lut/study-index/

there are the annotations for each study. In this table there is also a column called "has_sumstats" which indicates whether a study has summary statistics or not

buniello commented 2 years ago

For use-case #1 above (Target/Gene page - Study Table and Coloc Table):

Example of API query (includes calls for both tables in Gene page) :

query GenePageQuery { geneInfo(geneId: "ENSG00000169174") { id symbol chromosome start end bioType typename } studiesAndLeadVariantsForGeneByL2G(geneId: "ENSG00000169174") { pval yProbaModel study { studyId traitReported pubAuthor pubDate pmid nInitial nReplication hasSumstats typename } variant { rsId id typename } odds { oddsCI oddsCILower oddsCIUpper typename } beta { betaCI betaCILower betaCIUpper direction typename } typename } colocalisationsForGene(geneId: "ENSG00000169174") { leftVariant { id rsId typename } study { studyId traitReported pubAuthor pubDate pmid hasSumstats typename } qtlStudyId phenotypeId tissue { id name typename } h3 h4 log2h4h3 typename } }

EXAMPLE RESPONSE for one study: "study": { "studyId": "GCST002221", "traitReported": "Cholesterol, total", "pubAuthor": "Willer CJ", "pubDate": "2013-10-06", "pmid": "PMID:24097068", "nInitial": 94595, "nReplication": 93982, "hasSumstats": true, "__typename": "Study" },

buniello commented 2 years ago

For use-case #3 above: Gene prioritisation page (evidence page) -add sumstats info in the Association Summary’ section, under "study details": -this is possible as endpoint "hasSumstats" is queried API query:


query StudyLocusHeaderQuery($studyId: String!, $variantId: String!) {
  studyInfo(studyId: $studyId) {
    studyId
    traitReported
    pubAuthor
    pubDate
    pubJournal
    pmid
    nInitial
    nReplication
    nCases
    hasSumstats
    __typename
  }
  variantInfo(variantId: $variantId) {
    rsId
    id
    __typename
  }
}

Example response:


{
  "data": {
    "studyInfo": {
      "studyId": "GCST002222",
      "traitReported": "LDL cholesterol",
      "pubAuthor": "Willer CJ",
      "pubDate": "2013-10-06",
      "pubJournal": "Nat Genet",
      "pmid": "PMID:24097068",
      "nInitial": 94595,
      "nReplication": 93982,
      "nCases": null,
      "hasSumstats": true,
      "__typename": "Study"
    },
    "variantInfo": {
      "rsId": "rs7254892",
      "id": "19_44886339_G_A",
      "__typename": "Variant"
    }
  }
}
buniello commented 2 years ago

For use-case #2 above: Variant page

buniello commented 2 years ago

Visualisation specs (for consistency with current style of table in Portal): HEADER: Sumstats VALUE: yes/no

N.B.: currently, the studies with sumstats are also visualised in blue in the searchbox dropdown when searching for a study. This visualisation will not be modified for now.

LucaFumis commented 2 years ago

I can see the data (hasSumstats) is available - I'll start working on this

buniello commented 2 years ago

I have reviewed @LucaFumis work pre-view and all looks good!