# Overall association score via graphql/API

**URL:** <https://community.opentargets.org/t/overall-association-score-via-graphql-api/680>\
**Category:** GraphQL API\
**Created:** [27 June 2022 13:27 UTC](https://community.opentargets.org/t/overall-association-score-via-graphql-api/680 "2022-06-27T13:27:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![animesh](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/animesh/32/269_2.png) [@animesh](https://community.opentargets.org/u/animesh)\
**Post date:** [27 June 2022 13:27 UTC](https://community.opentargets.org/t/overall-association-score-via-graphql-api/680/1 "2022-06-27T13:27:15Z")

</div>

I am trying to get the score but i cannot see the “Overall association score” as seen in the web-interface. For example [Diseases associated with ASMTL | Open Targets Platform](https://platform.opentargets.org/target/ENSG00000169093/associations) via the graphql/API returns the following

```auto
print(api_response)
{'data': {'target': {'id': 'ENSG00000169093', 'approvedSymbol': 'ASMTL', 'associatedDiseases': {'count': 19, 'rows': [{'disease': {'id': 'EFO_0000182', 'name': 'hepatocellular carcinoma'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.6124902785937083}]}, {'disease': {'id': 'EFO_0000637', 'name': 'osteosarcoma'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.13374477547455663}]}, {'disease': {'id': 'MONDO_0009901', 'name': 'Bartsocas-Papas syndrome'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.13374477547455663}]}, {'disease': {'id': 'EFO_0000641', 'name': 'papillary thyroid carcinoma'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.10334823559397559}]}, {'disease': {'id': 'MONDO_0004975', 'name': 'Alzheimer disease'}, 'datasourceScores': [{'id': 'expression_atlas', 'score': 0.08245252311075295}]}, {'disease': {'id': 'EFO_0000571', 'name': 'lung adenocarcinoma'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.06079307976116211}]}, {'disease': {'id': 'HP_0000786', 'name': 'Primary amenorrhea'}, 'datasourceScores': [{'id': 'eva', 'score': 0.012158615952232422}]}, {'disease': {'id': 'EFO_0000676', 'name': 'psoriasis'}, 'datasourceScores': [{'id': 'expression_atlas', 'score': 0.05969030843742791}]}, {'disease': {'id': 'EFO_0000311', 'name': 'cancer'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.045594809820871586}]}, {'disease': {'id': 'MONDO_0007254', 'name': 'breast cancer'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.04255515583281348}]}, {'disease': {'id': 'EFO_0000616', 'name': 'neoplasm'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.04238628616681025}]}, {'disease': {'id': 'EFO_0000335', 'name': 'chromophobe renal cell carcinoma'}, 'datasourceScores': [{'id': 'expression_atlas', 'score': 0.03829595289970768}]}, {'disease': {'id': 'EFO_0000220', 'name': 'acute lymphoblastic leukemia'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.03647584785669726}]}, {'disease': {'id': 'MONDO_0019499', 'name': 'Turner syndrome'}, 'datasourceScores': [{'id': 'expression_atlas', 'score': 0.035391309927590923}]}, {'disease': {'id': 'EFO_0003758', 'name': 'autism'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.030396539880581056}]}, {'disease': {'id': 'MONDO_0010979', 'name': 'Timothy syndrome'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.024317231904464845}]}, {'disease': {'id': 'EFO_0000222', 'name': 'acute myeloid leukemia'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.01823792392834863}]}, {'disease': {'id': 'EFO_0000272', 'name': 'astrocytoma'}, 'datasourceScores': [{'id': 'expression_atlas', 'score': 0.016026344699840513}]}, {'disease': {'id': 'EFO_0004248', 'name': 'male infertility'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.012158615952232422}]}]}}}}

```

Is the overall score something we can calculate using the above information?

---

<div class="post-metadata">

**Author:** ![hcornu](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/hcornu/32/716_2.png) [@hcornu](https://community.opentargets.org/u/hcornu)\
**Post date:** [27 June 2022 15:02 UTC](https://community.opentargets.org/t/overall-association-score-via-graphql-api/680/2 "2022-06-27T15:02:19Z")

</div>

Hi @animesh!

You can get the overall score directly in the API using the following query for targets associated with ASMTL:

```auto
query associatedDiseases {
  target(ensemblId: "ENSG00000169093") {
    id
    approvedSymbol
    associatedDiseases {
      count
      rows {
        disease {
          id
          name
        }
        score
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![animesh](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/animesh/32/269_2.png) [@animesh](https://community.opentargets.org/u/animesh)\
**Post date:** [28 June 2022 07:29 UTC](https://community.opentargets.org/t/overall-association-score-via-graphql-api/680/3 "2022-06-28T07:29:28Z")

</div>

I tried and i get following

`{'data': {'target': {'id': 'ENSG00000169093', 'approvedSymbol': 'ASMTL', 'associatedDiseases': {'count': 19, 'rows': [{'disease': {'id': 'EFO_0000182', 'name': 'hepatocellular carcinoma'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.6124902785937083}]}, {'disease': {'id': 'EFO_0000637', 'name': 'osteosarcoma'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.13374477547455663}]}, {'disease': {'id': 'MONDO_0009901', 'name': 'Bartsocas-Papas syndrome'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.13374477547455663}]}, {'disease': {'id': 'EFO_0000641', 'name': 'papillary thyroid carcinoma'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.10334823559397559}]}, {'disease': {'id': 'MONDO_0004975', 'name': 'Alzheimer disease'}, 'datasourceScores': [{'id': 'expression_atlas', 'score': 0.08245252311075295}]}, {'disease': {'id': 'EFO_0000571', 'name': 'lung adenocarcinoma'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.06079307976116211}]}, {'disease': {'id': 'HP_0000786', 'name': 'Primary amenorrhea'}, 'datasourceScores': [{'id': 'eva', 'score': 0.012158615952232422}]}, {'disease': {'id': 'EFO_0000676', 'name': 'psoriasis'}, 'datasourceScores': [{'id': 'expression_atlas', 'score': 0.05969030843742791}]}, {'disease': {'id': 'EFO_0000311', 'name': 'cancer'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.045594809820871586}]}, {'disease': {'id': 'MONDO_0007254', 'name': 'breast cancer'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.04255515583281348}]}, {'disease': {'id': 'EFO_0000616', 'name': 'neoplasm'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.04238628616681025}]}, {'disease': {'id': 'EFO_0000335', 'name': 'chromophobe renal cell carcinoma'}, 'datasourceScores': [{'id': 'expression_atlas', 'score': 0.03829595289970768}]}, {'disease': {'id': 'EFO_0000220', 'name': 'acute lymphoblastic leukemia'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.03647584785669726}]}, {'disease': {'id': 'MONDO_0019499', 'name': 'Turner syndrome'}, 'datasourceScores': [{'id': 'expression_atlas', 'score': 0.035391309927590923}]}, {'disease': {'id': 'EFO_0003758', 'name': 'autism'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.030396539880581056}]}, {'disease': {'id': 'MONDO_0010979', 'name': 'Timothy syndrome'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.024317231904464845}]}, {'disease': {'id': 'EFO_0000222', 'name': 'acute myeloid leukemia'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.01823792392834863}]}, {'disease': {'id': 'EFO_0000272', 'name': 'astrocytoma'}, 'datasourceScores': [{'id': 'expression_atlas', 'score': 0.016026344699840513}]}, {'disease': {'id': 'EFO_0004248', 'name': 'male infertility'}, 'datasourceScores': [{'id': 'europepmc', 'score': 0.012158615952232422}]}]}}}}`

which part is referring to the overall-score? also, is there a way to extract just that part via API?

---

<div class="post-metadata">

**Author:** ![smol\_wolf](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@smol\_wolf](https://community.opentargets.org/u/smol_wolf)\
**Post date:** [28 June 2022 13:30 UTC](https://community.opentargets.org/t/overall-association-score-via-graphql-api/680/4 "2022-06-28T13:30:33Z")

</div>

I’m also interested in this question. It is basically what is shown on the “associated diseases” page and is downloadable as json/tsv.

---

<div class="post-metadata">

**Author:** ![hcornu](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/hcornu/32/716_2.png) [@hcornu](https://community.opentargets.org/u/hcornu)\
**Post date:** [28 June 2022 14:42 UTC](https://community.opentargets.org/t/overall-association-score-via-graphql-api/680/5 "2022-06-28T14:42:49Z")

</div>

Welcome to the Open Targets Community @smol_wolf!

@animesh Are you looking to extract the score for a specific target-disease association?  
The query above lists the overall association scores for each disease associated with ASMTL (“score”) 😃

---

<div class="post-metadata">

**Author:** ![animesh](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/animesh/32/269_2.png) [@animesh](https://community.opentargets.org/u/animesh)\
**Post date:** [28 June 2022 15:41 UTC](https://community.opentargets.org/t/overall-association-score-via-graphql-api/680/6 "2022-06-28T15:41:21Z")

</div>

Yes, i do see the diseases but which one is overall-score as shown in the web-interface? Is it europepmc for example?

---

<div class="post-metadata">

**Author:** ![animesh](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/animesh/32/269_2.png) [@animesh](https://community.opentargets.org/u/animesh)\
**Post date:** [28 June 2022 15:53 UTC](https://community.opentargets.org/t/overall-association-score-via-graphql-api/680/7 "2022-06-28T15:53:54Z")

</div>

Looks like changing the code to

```auto
          associatedDiseases {
            rows {
              score

```

> [@Is it possible to convert Gene Symbol to Ensembl ID?](https://community.opentargets.org/t/gene-symbol-to-ensembl-id/679/4):
>
> Hi @animesh , If you are planning to do a larger scale analysis on our data, I would highly recommend using our target index accessible via ftp as [JSON](https://community.opentargets.org/pub/databases/opentargets/platform/22.06/output/etl/json/targets) or [parquet](https://community.opentargets.org/pub/databases/opentargets/platform/22.06/output/etl/parquet/targets) format. The data is extremely rich, but has the ensembl identifier as id and HGNC gene symbol as approvedSymbol . It worth exploring. If you are fetching data via [GraphQL API requests](https://api.platform.opentargets.org/api/v4/graphql/browser?operationName=assocs&query=query%20assocs%20%7B%0A%20%20search%28queryString%3A%20%22HER3%22%2C%20entityNames%3A%22target%22%29%20%7B%0A%09%09hits%20%7B%0A%20%20%20%20%20%20id%2C%0A%20%20%20%20%20%20name%2C%0A%20%20%20%20%09entity%2C%0A%20%20%20%20%20%20object%20%7B%0A%20%20%20%20%20%20%20%20...%20on%20Target%20%7B%0A%20%20%20%20%20%20%20%20%20%20associatedDiseases%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20count%0A%20%20%20%20%20%20%20%20%20%20%20%20rows%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20score%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20datatypeScores%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09score%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20disease%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20name%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A), it is possible to retrieve data based on search query, where you specify that you are looking for a target and then expand the result on the associat…

actually worked!

Thanks 👍
