Get associations from different ids

Hello,

I would like to know if it is possible to query OpenTargets API to get target-disease associations using a target id different than Ensembl (e.g. HGNC approved symbol)

Also, querying by disease id, using, for instance MONDO or OMIM ids.

Thanks a lot!

Hi,

Welcome to the OpenTargets community portal! Although it is possible to retrieve association data via other than disease and target identifiers, it is not advised. You can use the search endpoint then resolve the target/disease object as follows:

  search(
    queryString: $queryString
    entityNames: ["target"]
    page: { index: 0, size: 1 }
  ) {
    hits {
      id
      entity
      object {
        ... on Target {
          id
          approvedSymbol
          approvedName
					associatedDiseases {
						rows {
              disease {
                name
              }
              datasourceScores{
                id
                score
              }
            }
          }
        }
      }
    }
  }
}

You can generalize the above example to diseases as well. But as I mentioned, I would rather map my genes to Ensembl gene identifiers first using Ensembl’s REST API for example. Please let us know more about your use case, so we can advise furhter.