Querying using the target UniProt ID

Hi everyone,

I’m trying to retrieve all the disease associations for a selected set of targets (I took the code from one of the examples on Open Targets Platform). I was wondering if it is possible to use the UniProt ID instead of the Ensembl ID.

If this is not possible, is there a way to convert each UniProt ID to its corresponding Ensembl ID using the database’s API?

Thank you so much.
Vittorio

Hi @Vittorio_lembo and welcome to the Open Targets Community! :tada:

You can use the following query to retrieve all the disease associated for a selected set of targets using their UniProt IDs on the GraphQL API playground:

query example{
  mapIds(queryTerms: ["P37840", "P15056"]){
    mappings{
      hits{
        id
        name
        object {
        ... on Target {
          id
          associatedDiseases {
            count
            rows {
              disease {
                id
                name
              	}
              }
            }
          }
        }
      }
    }
  }
}

Hope this helps!

Best,
Prashant

Hi @Prashant_Uniyal. It works perfectly!!!

Thank you so much, have a great day :smiley:

Best,
Vittorio

1 Like