Skip to contents

Pure. The discovery direction: the genes Open Targets associates with a disease, each with its overall association score.

Usage

opentargets_parse_targets(body, disease_id = NA_character_)

Arguments

body

A parsed Open Targets GraphQL response body.

disease_id

The disease id that was queried, used to build source_url.

Value

A tibble of symbol, ensembl_id, score, and source_url, or NULL when the disease is absent or has no associations.

Examples

body <- list(data = list(disease = list(
  name = "NF1",
  associatedTargets = list(count = 1, rows = list(
    list(score = 0.9, target = list(id = "ENSG00000196712", approvedSymbol = "NF1"))
  ))
)))
opentargets_parse_targets(body, "MONDO_0018975")
#> # A tibble: 1 × 4
#>   symbol ensembl_id      score source_url                                       
#>   <chr>  <chr>           <dbl> <chr>                                            
#> 1 NF1    ENSG00000196712   0.9 https://platform.opentargets.org/evidence/ENSG00…