R query for colocalizations

I am really new to using the API and was curious if someone could help me? I am attempting to obtain all possible colocalizations in a particular gene and I believe the first thing I needed was to obtain studyLocusID .
Would anyone know how to do that in R and subsequently loop over credibleSet to obtain all the colocalization results?

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

I don’t think the API is the best tool for your use case, especially if you are going to iterate over the colocalisation.

You might find it easier to use the colocalisation datasets directly, and limit the genomic ranges to your gene of interest.

Hi, we actually found that querying the colocalization results for a given gene through API was very useful on OTG. Can you share if it is still possible to query this info in the new platform and how? Thank you.

We managed to do this by downloading the data instead of querying the API and found it useful as well. I tried to use AI-scripting tools to help me with writing out API querying code on R but I kept needing to query the older OTG (not the newly released OpenTargets) link in my query.

1 Like

Thank you Kumar. We had the API working with the old OTG. I guess we will have to download the data locally for the new platform.

Hi Mauro,

we are currently working on implementing an API query (and relevant front end implementation) to retrieve colocalization results for a given target in the Platform.
You can check this issue for more info!

Thank you,

Annalisa