Python functions for opentargets.org API

Overview

What is opy_Targets?

Opentargets.org uses GraphQL API to explore it's content via coding. This ensemble of functions aim is to make it easy to use the API via our beloved coding language - python <3

Python dependencies

(requires Python 3)

  • pandas
  • requests
  • json

Usage

Example:

Lets say you want to get SNPS of gene you think is related to a disease

import opy_targets as opy

ENDOMETRIOSIS_EFO_ID = 'EFO_0001065'
SNP_ESNG_ID = ENSG00000196208

opy.get_snp_data(SNP_ESNG_ID,ENDOMETRIOSIS_ID).head(4)

output:

variantRsId variantId studyId studySampleSize publicationFirstAuthor label chr location disease_ID gene_related
0 rs11674184 2_11581409_T_G GCST004549 208903 Sapkota Y intron_variant 2 11581409 EFO_0001065 ENSG00000196208
1 rs11674184 2_11581409_T_G GCST004549_2 208903 Sapkota Y intron_variant 2 11581409 EFO_0001065 ENSG00000196208
2 rs13394619 2_11587381_G_A GCST001720 13997 Nyholt DR intron_variant 2 11587381 EFO_0001065 ENSG00000196208
3 rs77294520 2_11520829_G_C GCST004549_2 208903 Sapkota Y intergenic_variant 2 11520829 EFO_0001065 ENSG00000196208

Most of the chances you don't know the genes related to the disease. NO PROBLEM!

Lets say you want to know which SNP associate with a disease you study

import opy_targets as opy

#

ENDOMETRIOSIS_EFO_ID = 'EFO_0001065'

opy.get_SNP_df(ENDOMETRIOSIS_ID).head()

output:

variantRsId variantId studyId studySampleSize publicationFirstAuthor label chr location disease_ID gene_related
0 rs11674184 2_11581409_T_G GCST004549 208903 Sapkota Y intron_variant 2 11581409 EFO_0001065 ENSG00000196208
1 rs13394619 2_11587381_G_A GCST001720 13997 Nyholt DR intron_variant 2 11587381 EFO_0001065 ENSG00000196208
2 rs77294520 2_11520829_G_C GCST004549_2 208903 Sapkota Y intergenic_variant 2 11520829 EFO_0001065 ENSG00000196208
3 rs58502716 2_11592421_G_GAATCAC FINNGEN_R5_N14_ENDOMETRIOSIS 77257 FINNGEN_R5 intron_variant 2 11592421 EFO_0001065 ENSG00000196208

You can change parameters such as the amount of genes retrived for each disease (25 default) and the sorting method of them (genetic association). check the functions docstring.

Enjoy ;)

You might also like...
Python functions to run WASS stereo wave processing executables, and load and post process WASS output files.

wass-pyfuns Python functions to run the WASS stereo wave processing executables, and load and post process the WASS output files. General WASS (Waves

A Telegram Music Bot with proper functions written in Python with Pyrogram and Py-Tgcalls.
A Telegram Music Bot with proper functions written in Python with Pyrogram and Py-Tgcalls.

⭐️ Yukki Music Bot ⭐️ A Telegram Music Bot written in Python using Pyrogram and Py-Tgcalls Ready to use method A Support Group and ready-to-use runnin

An example of matrix addition, demonstrating the basic method of Python calling C library functions

Example for Python call C functions An example of matrix addition, demonstrating the basic method of Python calling C library functions. How to run Bu

ShadowMusic - A Telegram Music Bot with proper functions written in Python with Pyrogram and Py-Tgcalls.

⭐️ Shadow Music ⭐️ A Telegram Music Bot written in Python using Pyrogram and Py-Tgcalls Ready to use method A Support Group, Updates Channel and ready

Source Code for our bot that manages time and other functions of the server 3

Komi San wants you to study This repo contains the source code for our bot that manages time and other functions of the server 3 Features Your study

A suite of utilities for AWS Lambda Functions that makes tracing with AWS X-Ray, structured logging and creating custom metrics asynchronously easier

A suite of utilities for AWS Lambda Functions that makes tracing with AWS X-Ray, structured logging and creating custom metrics asynchronously easier

GitHub action to deploy serverless functions to YandexCloud

YandexCloud serverless function deploy action Deploy new serverless function version (including function creation if it does not exist). Inputs yc_acc

Automated AWS account hardening with AWS Control Tower and AWS Step Functions
Automated AWS account hardening with AWS Control Tower and AWS Step Functions

Automate activities in Control Tower provisioned AWS accounts Table of contents Introduction Architecture Prerequisites Tools and services Usage Clean

Criando Lambda Functions para Ingerir Dados de APIs com AWS CDK

LIVE001 - AWS Lambda para Ingerir Dados de APIs Fazer o deploy de uma função lambda com infraestrutura como código Lambda vai numa API externa e extra

Owner
null
A small repository with convenience functions for working with the Notion API.

Welcome! Within this respository are a few convenience functions to assist with the pulling and pushing of data from the Notion API.

null 10 Jul 9, 2022
Exchange indicators & Basic functions for Binance API.

binance-ema Exchange indicators & Basic functions for Binance API. This python library has been written to calculate SMA, EMA, MACD etc. functions wit

Emre MENTEŞE 24 Jan 6, 2023
Script for downloading Coursera.org videos and naming them.

Coursera Downloader Coursera Downloader Introduction Features Disclaimer Installation instructions Recommended installation method for all Operating S

Coursera Downloader 9k Jan 2, 2023
Data from popular CS:GO website hltv.org

Welcome to hltv-data ?? ?? Data from popular CS:GO website hltv.org Install pip install hltv-data Usage The public methods can be reached using HLTVCl

Dariusz Choruży 28 Dec 23, 2022
a discord bot that pulls the latest or most relevant research papers from arxiv.org

AI arxiver a discord bot that pulls the latest or most relevant research papers from arxiv.org invite link : Arxiver bot link works in progress Usage

Ensias AI 14 Sep 3, 2022
Telegram Link Wayback Bot. This bot archives a web page thrown at itself with wayback Machine (Archive.org).

Telegram Link Wayback Bot. This bot archives a web page thrown at itself with wayback Machine (Archive.org).

Hüzünlü Artemis [HuzunluArtemis] 11 Feb 18, 2022
ETL for tononkira.serasera.org

python-tononkiramalagasy-api Api Endpoints: ### get artists - /artists/<int:page> [page_offset = 20] ### get artist's songs, index was given by

Titosy Manankasina 1 Dec 24, 2021
Upload comma-delimited files to biglocalnews.org in your GitHub Action

Upload comma-delimited files to biglocalnews.org in your GitHub Action Inputs api-key: Your biglocalnews.org API token. project-id: The identifier of

biglocalnews 1 Apr 20, 2022
Get some python in google cloud functions

[NOTE]: This is a highly experimental (and proof of concept) library so do not expect all python packages to work flawlessly. Also, cloud functions ar

Martin Abelson Sahlen 200 Nov 24, 2022
A python library for creating Slack slash commands using AWS Lambda Functions

slashbot Slashbot makes it easy to create slash commands using AWS Lambda functions. These can be handy for creating a secure way to execute automated

Eric Brassell 17 Oct 21, 2022