Overall association score via graphql/API

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 via the graphql/API returns the following

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?

Hi @animesh!

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

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

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?

1 Like

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

1 Like

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”) :smiley:

1 Like

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

Looks like changing the code to

          associatedDiseases {
            rows {
              score

actually worked!

Thanks :+1:

1 Like