# Getting all the LOF association to disease for a gene

**URL:** <https://community.opentargets.org/t/getting-all-the-lof-association-to-disease-for-a-gene/1508>\
**Category:** GraphQL API\
**Created:** [24 July 2024 08:44 UTC](https://community.opentargets.org/t/getting-all-the-lof-association-to-disease-for-a-gene/1508 "2024-07-24T08:44:57Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aner\_Ottolenghi](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/aner_ottolenghi/32/642_2.png) [@Aner\_Ottolenghi](https://community.opentargets.org/u/Aner_Ottolenghi)\
**Post date:** [24 July 2024 08:44 UTC](https://community.opentargets.org/t/getting-all-the-lof-association-to-disease-for-a-gene/1508/1 "2024-07-24T08:44:57Z")

</div>

Hi! I’m trying to write an API query that can return all the data of the direction of effect, of diseases associated with a target, in ClinVar and Orphant.

Grateful for any help.

---

<div class="post-metadata">

**Author:** ![Prashant\_Uniyal](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/prashant_uniyal/32/382_2.png) [@Prashant\_Uniyal](https://community.opentargets.org/u/Prashant_Uniyal)\
**Post date:** [24 July 2024 11:14 UTC](https://community.opentargets.org/t/getting-all-the-lof-association-to-disease-for-a-gene/1508/2 "2024-07-24T11:14:44Z")

</div>

Hi @Aner_Ottolenghi and welcome to the Open Targets Community! 🎉

You can use the following query to retrieve all the data of the direction of effect, of diseases associated with a target, in ClinVar and Orphanet on the [GraphQL API playground](https://api.platform.opentargets.org/api/v4/graphql/browser):

```auto
query associatedDiseasesExample {
  target(ensemblId: "ENSG00000157764") {
    id
    approvedSymbol
    associatedDiseases {
      count
      rows {
        disease {
          id
          name
          evidences(
            ensemblIds: ["ENSG00000157764"], 
            datasourceIds: ["eva", "orphanet"]
            size: 10000
            ) {
            count
            rows {
              datasourceId
              variantId
              variantRsId
              directionOnTrait
              variantEffect
            }
          }
        }
      }
    }
  }
}

```

Kindly note that there is a limit of 10000 on the API response size, post which you will have to specify the

> cursor: “WzAuOTcsIjAwYTJjZGJiMTM1NTI2ODljZGYzYmI0ZmQ5N2Q1NWYxZTQ3OGU1MTUiXQ==” along with size, specially for ClinVar.

Hope this helps!

Best,  
Prashant

---

<div class="post-metadata">

**Author:** ![Aner\_Ottolenghi](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/aner_ottolenghi/32/642_2.png) [@Aner\_Ottolenghi](https://community.opentargets.org/u/Aner_Ottolenghi)\
**Post date:** [24 July 2024 13:41 UTC](https://community.opentargets.org/t/getting-all-the-lof-association-to-disease-for-a-gene/1508/3 "2024-07-24T13:41:50Z")

</div>

> [@Prashant\_Uniyal](#):
>
> ```auto
> query associatedDiseasesExample {
> target(ensemblId: "ENSG00000157764") {
> id
> approvedSymbol
> associatedDiseases {
> count
> rows {
> disease {
> id
> name
> evidences(
> ensemblIds: ["ENSG00000157764"], 
> datasourceIds: ["eva", "orphanet"]
> size: 10000
> ) {
> count
> rows {
> datasourceId
> variantId
> variantRsId
> directionOnTrait
> variantEffect
> }
> }
> }
> }
> }
> }
> }
> 
> ```

That’s great! thank you very much!

---

<div class="post-metadata">

**Author:** ![Pankaj\_Agarwal](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/pankaj_agarwal/32/379_2.png) [@Pankaj\_Agarwal](https://community.opentargets.org/u/Pankaj_Agarwal)\
**Post date:** [25 September 2024 00:03 UTC](https://community.opentargets.org/t/getting-all-the-lof-association-to-disease-for-a-gene/1508/5 "2024-09-25T00:03:37Z")

</div>

@Prashant_Uniyal  
How do you limit the directionOnTrait to be “protect”? I can’t find where in the schema is "directionOnTrait ".

-Pankaj

---

<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 September 2024 09:14 UTC](https://community.opentargets.org/t/getting-all-the-lof-association-to-disease-for-a-gene/1508/6 "2024-09-27T09:14:12Z")

</div>

Hi Pankaj,

DirectionOnTrait is not something that you can filter for using the API.

You can either filter the query responses once you have them, or use our data downloads or BigQuery datasets (more information here: [Data access | Open Targets Platform Documentation](https://platform-docs.opentargets.org/data-access))

---

<div class="post-metadata">

**Author:** ![Pankaj\_Agarwal](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/pankaj_agarwal/32/379_2.png) [@Pankaj\_Agarwal](https://community.opentargets.org/u/Pankaj_Agarwal)\
**Post date:** [3 October 2024 17:24 UTC](https://community.opentargets.org/t/getting-all-the-lof-association-to-disease-for-a-gene/1508/7 "2024-10-03T17:24:20Z")

</div>

@hcornu Is there a list of the data downloads that have this field? -Pankaj

---

<div class="post-metadata">

**Author:** ![Prashant\_Uniyal](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/prashant_uniyal/32/382_2.png) [@Prashant\_Uniyal](https://community.opentargets.org/u/Prashant_Uniyal)\
**Post date:** [9 October 2024 11:52 UTC](https://community.opentargets.org/t/getting-all-the-lof-association-to-disease-for-a-gene/1508/8 "2024-10-09T11:52:42Z")

</div>

Hi @Pankaj_Agarwal, you can get the DirectionOnTrait data from the `Target - Disease evidence` dataset in the [downloads page](https://platform.opentargets.org/downloads).

---

<div class="post-metadata">

**Author:** ![Pankaj\_Agarwal](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/pankaj_agarwal/32/379_2.png) [@Pankaj\_Agarwal](https://community.opentargets.org/u/Pankaj_Agarwal)\
**Post date:** [9 October 2024 16:32 UTC](https://community.opentargets.org/t/getting-all-the-lof-association-to-disease-for-a-gene/1508/9 "2024-10-09T16:32:03Z")

</div>

@Prashant_Uniyal That seems to be just the literature evidence as the Target-Disease evidence points to [http://ftp.ebi.ac.uk/pub/databases/opentargets/platform/24.09/output/etl/json/literature/evidence](http://ftp.ebi.ac.uk/pub/databases/opentargets/platform/24.09/output/etl/json/literature/evidence)? I thought the DirectionOnTrait was also available for other data types.

Also this path ftp://ftp.ebi.ac.uk/pub/databases/opentargets/platform/24.09/output/etl/json/literature/evidence no longer exists. Under [Index of /pub/databases/opentargets/platform/latest/output/etl/json/literature](https://ftp.ebi.ac.uk/pub/databases/opentargets/platform/latest/output/etl/json/literature/) you do not have an “evidence” folder.

It would be useful to make DirectionOnTrait data available in a more intuitive way as I think it can be quite useful.

-Pankaj

---

<div class="post-metadata">

**Author:** ![Prashant\_Uniyal](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/prashant_uniyal/32/382_2.png) [@Prashant\_Uniyal](https://community.opentargets.org/u/Prashant_Uniyal)\
**Post date:** [10 October 2024 12:12 UTC](https://community.opentargets.org/t/getting-all-the-lof-association-to-disease-for-a-gene/1508/10 "2024-10-10T12:12:35Z")

</div>

Hi @Pankaj_Agarwal , the correct URL in the downloads page to get the DirectionOnTrait data is [this](http://ftp.ebi.ac.uk/pub/databases/opentargets/platform/24.09/output/etl/json/evidence).

Thank you for your feedback. We will look into creating a separate dataset for the DirectionOnTrait data but it might be difficult as currently it is part of multiple evidence sources.

---

<div class="post-metadata">

**Author:** ![Pankaj\_Agarwal](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/pankaj_agarwal/32/379_2.png) [@Pankaj\_Agarwal](https://community.opentargets.org/u/Pankaj_Agarwal)\
**Post date:** [10 October 2024 13:05 UTC](https://community.opentargets.org/t/getting-all-the-lof-association-to-disease-for-a-gene/1508/11 "2024-10-10T13:05:18Z")

</div>

Thanks @Prashant_Uniyal , do you at least have a list of all the evidence sources that include DirectionOnTrait?

---

<div class="post-metadata">

**Author:** ![Prashant\_Uniyal](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/prashant_uniyal/32/382_2.png) [@Prashant\_Uniyal](https://community.opentargets.org/u/Prashant_Uniyal)\
**Post date:** [10 October 2024 13:29 UTC](https://community.opentargets.org/t/getting-all-the-lof-association-to-disease-for-a-gene/1508/12 "2024-10-10T13:29:02Z")

</div>

Hi @Pankaj_Agarwal , the direction of effect analysis was done for [eight sources](https://blog.opentargets.org/open-targets-platform-24-03-release/) of target-disease association evidence. These are:

- Open Targets Genetics
- Gene Burden
- ClinVar
- ClinVar somatic
- Gene2Phenotype
- Orphanet
- IMPC
- ChEMBL

The assessment is tailored to each dataset; [this is detailed in our target-disease evidence documentation](https://platform-docs.opentargets.org/evidence#evidence-data-sources).

---

<div class="post-metadata">

**Author:** ![Pankaj\_Agarwal](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/pankaj_agarwal/32/379_2.png) [@Pankaj\_Agarwal](https://community.opentargets.org/u/Pankaj_Agarwal)\
**Post date:** [10 October 2024 18:06 UTC](https://community.opentargets.org/t/getting-all-the-lof-association-to-disease-for-a-gene/1508/13 "2024-10-10T18:06:29Z")

</div>

@Prashant_Uniyal I looked through the data in the directory and there seems to be an issue. Here are the counts of the number entries by each evidence type of DirectionOnTrait counts and those flagged as “protect”.

The ot\_genetics\_portal and gene\_burden look good. Chembl you explain is always flagged as “protect”. Otherwise, these numbers seem curious.

Are we sure there is ZERO “protect” data in cancer\_gene\_census, eva\_somatic, gene2phentoype, impc, intogen, and orphanet? There are no Gain of function mutations in any of these sources. And only 30 in eva?

|24.09/output/etl/json/evidence/|DirectionOnTrait counts|Protection counts|  
|cancer\_gene\_census| 82,754 | - |  
|chembl| 652,859 | 652,859 |  
|eva| 440,837 | 30 |  
|eva\_somatic| 10,244 | 1 |  
|gene2phenotype| 3,644 | - |  
|gene\_burden| 36,414 | 14,868 |  
|impc| 1,156,920 | - |  
|intogen| 4,359 | - |  
|orphanet| 6,271 | - |  
|ot\_genetics\_portal| 595,415 | 287,652 |

For Chembl as well, one could argue that it should imply the relationship between the target and disease. Thus an agonist and antagonists should be flagged differently.

---

<div class="post-metadata">

**Author:** ![Juan\_Roldan](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/juan_roldan/32/526_2.png) [@Juan\_Roldan](https://community.opentargets.org/u/Juan_Roldan)\
**Post date:** [14 October 2024 10:18 UTC](https://community.opentargets.org/t/getting-all-the-lof-association-to-disease-for-a-gene/1508/14 "2024-10-14T10:18:17Z")

</div>

Hi @Pankaj_Agarwal,

Thanks for your questions and ideas about the direction of effect (DoE).

I have looked into the data:

1. All evidences from ChEMBL are flagged as protective/protection because we understand that whenever you use a drug you try to protect from the disease. We do flag depending on the mechanism of action of the drug (agonists are GoF and antagonist LoF), but this is in the “variantEffect” column. I may need to discuss with the team about changing the column name “variantEffect” to something more generic like _directionOnTarget_ to avoid confusions.

2. For datasources “cancer\_gene\_census, gene2phentoype, impc, intogen, and orphanet” we make the assumption that all associations give risk. In the case of Eva germline and somatic we use the annotation “clinical significance” to inform protection/risk and I confirm that there are 30 and 1 evidences giving protection, respectively.

3. Could you please check the column of “variantEffect” and tell us whether you see something strange in terms of gain of function or loss of function numbers?

In case it can be helpful, you can find more information in the documentation (For each datasource we explain how DoE is evaluated) [Target - disease evidence | Open Targets Platform Documentation](https://platform-docs.opentargets.org/evidence)

Thanks for your feedback!! 🙂

Best,

Juan.
