Python arguments are equivalent to long-option arguments (--arg), unless otherwise specified. Flags are True/False arguments in Python. The manual for any gget tool can be called from the command-line using the -h --help flag.

gget opentargets 🎯

Fetch associated diseases or drugs from OpenTargets using Ensembl IDs.
Return format: JSON/CSV (command-line) or data frame (Python).

This module was written by Sam Wagenaar.

Positional argument
ens_id
Ensembl gene ID, e.g ENSG00000169194.

Optional arguments
-r --resource
Defines the type of information to return in the output. Default: 'diseases'.
Possible resources are:

ResourceReturn ValueValid FiltersSources
diseasesAssociated diseasesNoneVarious:etc.
drugsAssociated drugsdisease_idChEMBL
tractabilityTractability dataNoneOpen Targets
pharmacogeneticsPharmacogenetic responsesdrug_idPharmGKB
expressionGene expression data (by tissues, organs, and anatomical systems)tissue_id
anatomical_system
organ
depmapDepMap gene→disease-effect data.tissue_idDepMap Portal
interactionsProtein⇄protein interactionsprotein_a_id
protein_b_id
gene_b_id

-l --limit
Limit the number of results, e.g 10. Default: No limit.
Note: Not compatible with the tractability and depmap resources.

-o --out
Path to the JSON file the results will be saved in, e.g. path/to/directory/results.json. Default: Standard out.
Python: save=True will save the output in the current working directory.

Optional filter arguments

-fd --filter_disease disease_id
Filter by disease ID, e.g. 'EFO_0000274'. Only valid for the drugs resource.

-fc --filter_drug drug_id
Filter by drug ID, e.g. 'CHEMBL1743081'. Only valid for the pharmacogenetics resource.

-ft --filter_tissue tissue_id
Filter by tissue ID, e.g. 'UBERON_0000473'. Only valid for the expression and depmap resources.

-fa --filter_anat_sys
Filter by anatomical system, e.g. 'nervous system'. Only valid for the expression resource.

-fo --filter_organ anatomical_system
Filter by organ, e.g. 'brain'. Only valid for the expression resource.

-fpa --filter_protein_a protein_a_id
Filter by the protein ID of the first protein in the interaction, e.g. 'ENSP00000304915'. Only valid for the interactions resource.

-fpb --filter_protein_b protein_b_id
Filter by the protein ID of the second protein in the interaction, e.g. 'ENSP00000379111'. Only valid for the interactions resource.

-fgb --filter_gene_b gene_b_id
Filter by the gene ID of the second protein in the interaction, e.g. 'ENSG00000077238'. Only valid for the interactions resource.

filters
Python only. A dictionary of filters, e.g.

{'disease_id': ['EFO_0000274', 'HP_0000964']}

filter_mode
Python only. filter_mode='or' combines filters of different IDs with OR logic. filter_mode='and' combines filters of different IDs with AND logic (default).

Flags
-csv --csv
Command-line only. Returns the output in CSV format, instead of JSON format. Python: Use json=True to return output in JSON format.

-q --quiet
Command-line only. Prevents progress information from being displayed.
Python: Use verbose=False to prevent progress information from being displayed.

-or --or
Command-line only. Filters are combined with OR logic. Default: AND logic.

wrap_text
Python only. wrap_text=True displays data frame with wrapped text for easy reading (default: False).

Examples

Get associated diseases for a specific gene:

gget opentargets ENSG00000169194 -r diseases -l 1
# Python
import gget
gget.opentargets('ENSG00000169194', resource='diseases', limit=1)

→ Returns the top disease associated with the gene ENSG00000169194.

idnamedescriptionscore
EFO_0000274atopic eczemaA chronic inflammatory genetically determined disease of the skin ...0.66364347241831



Get associated drugs for a specific gene:

gget opentargets ENSG00000169194 -r drugs -l 2
# Python
import gget
gget.opentargets('ENSG00000169194', resource='drugs', limit=2)

→ Returns the top 2 drugs associated with the gene ENSG00000169194.

idnametypeaction_mechanismdescriptionsynonymstrade_namesdisease_iddisease_nametrial_phasetrial_statustrial_idsapproved
CHEMBL1743081TRALOKINUMABAntibodyInterleukin‑13 inhibitorAntibody drug with a maximum clinical trial phase of IV ...['CAT-354', 'Tralokinumab']['Adbry', 'Adtralza']EFO_0000274atopic eczema4[]True
CHEMBL4297864CENDAKIMABAntibodyInterleukin‑13 inhibitorAntibody drug with a maximum clinical trial phase of III ...[ABT-308, Abt-308, CC-93538, Cendakimab, RPC-4046][]EFO_0004232eosinophilic esophagitis3Recruiting[NCT04991935]False

Note: Returned trial_ids are ClinicalTrials.gov identifiers



Get tractability data for a specific gene:

gget opentargets ENSG00000169194 -r tractability
# Python
import gget
gget.opentargets('ENSG00000169194', resource='tractability')

→ Returns tractability data for the gene ENSG00000169194.

labelmodality
High-Quality PocketSmall molecule
Approved DrugAntibody
GO CC high confAntibody
UniProt loc med confAntibody
UniProt SigP or TMHMMAntibody



Get pharmacogenetic responses for a specific gene:

gget opentargets ENSG00000169194 -r pharmacogenetics -l 1
# Python
import gget
gget.opentargets('ENSG00000169194', resource='pharmacogenetics', limit=1)

→ Returns pharmacogenetic responses for the gene ENSG00000169194.

rs_idgenotype_idgenotypevariant_consequence_idvariant_consequence_labeldrugsphenotypegenotype_annotationresponse_categorydirect_targetevidence_levelsourceliterature
rs12956865_132660151_T_T,TTTSO:0002073no_sequence_alteration    id        name
0  None  hepatitis vaccines
increased risk for non‑immune response to the hepatitis B vaccinePatients with the TT genotype may be at increased risk for non-immune response to the hepatitis B vaccine...efficacyFalse3pharmgkb[21111021]

Note: Returned literature ids are Europe PMC identifiers



Get tissues where a gene is most expressed:

gget opentargets ENSG00000169194 -r expression -l 2
# Python
import gget
gget.opentargets('ENSG00000169194', resource='expression', limit=2)

→ Returns the top 2 tissues where the gene ENSG00000169194 is most expressed.

tissue_idtissue_namerna_zscorerna_valuerna_unitrna_levelanatomical_systemsorgans
UBERON_0000473testis510263[reproductive system][reproductive organ, reproductive structure]
CL_0000542EBV‑transformed lymphocyte1542[hemolymphoid system, immune system, lymphoid system][immune organ]



Get DepMap gene-disease effect data for a specific gene:

gget opentargets ENSG00000169194 -r depmap
# Python
import gget
gget.opentargets('ENSG00000169194', resource='depmap')

→ Returns DepMap gene-disease effect data for the gene ENSG00000169194.

depmap_idexpressioneffecttissue_idtissue_namecell_line_namedisease_cell_line_iddisease_namemutation
ACH‑0015320.1763230.054950UBERON_0002113kidneyJMU-RTK-2NoneRhabdoid CancerNone



Get protein-protein interactions for a specific gene:

gget opentargets ENSG00000169194 -r interactions -l 2
# Python
import gget
gget.opentargets('ENSG00000169194', resource='interactions', limit=2)

→ Returns the top 2 protein-protein interactions for the gene ENSG00000169194.

evidence_scoreevidence_countsource_dbprotein_a_idgene_a_idgene_a_symbolrole_ataxon_aprotein_b_idgene_b_idgene_b_symbolrole_btaxon_b
0.9993stringENSP00000304915ENSG00000169194IL13unspecified role9606ENSP00000379111ENSG00000077238IL4Runspecified role9606
0.9993stringENSP00000304915ENSG00000169194IL13unspecified role9606ENSP00000360730ENSG00000131724IL13RA1unspecified role9606



Get protein-protein interactions for a specific gene, filtering by protein and gene IDs:

gget opentargets ENSG00000169194 -r interactions -fpa P35225 --filter_gene_b ENSG00000077238
# Python
import gget
gget.opentargets('ENSG00000169194', resource='interactions', filters={'protein_a_id': 'P35225', 'gene_b_id': 'ENSG00000077238'})

→ Returns protein-protein interactions for the gene ENSG00000169194, where the first protein is P35225 and the second gene is ENSG00000077238.

evidence_scoreevidence_countsource_dbprotein_a_idgene_a_idgene_a_symbolrole_ataxon_aprotein_b_idgene_b_idgene_b_symbolrole_btaxon_b
None3reactomeP35225ENSG00000169194IL13unspecified role9606P24394ENSG00000077238IL4Runspecified role9606
None2signorP35225ENSG00000169194IL13regulator9606P24394ENSG00000077238IL4Rregulator target9606



Get protein-protein interactions for a specific gene, filtering by protein or gene IDs:

gget opentargets ENSG00000169194 -r interactions -fpa P35225 --filter_gene_b ENSG00000077238 ENSG00000111537 --or -l 5
# Python
import gget
gget.opentargets(
    'ENSG00000169194',
    resource='interactions',
    filters={'protein_a_id': 'P35225', 'gene_b_id': ['ENSG00000077238', 'ENSG00000111537']},
    filter_mode='or',
    limit=5
)

→ Returns protein-protein interactions for the gene ENSG00000169194, where the first protein is P35225 or the second gene is either ENSG00000077238 or ENSG00000111537.

evidence_scoreevidence_countsource_dbprotein_a_idgene_a_idgene_a_symbolrole_ataxon_aprotein_b_idgene_b_idgene_b_symbolrole_btaxon_b
0.9993stringENSP00000304915ENSG00000169194IL13unspecified role9606ENSP00000379111ENSG00000077238IL4Runspecified role9606
0.9612stringENSP00000304915ENSG00000169194IL13unspecified role9606ENSP00000229135ENSG00000111537IFNGunspecified role9606
0.8009intactP35225ENSG00000169194IL13unspecified role9606Q14627ENSG00000123496IL13RA2unspecified role9606
0.7406intactP35225ENSG00000169194IL13unspecified role9606P78552ENSG00000131724IL13RA1unspecified role9606
0.4001intactP35225ENSG00000169194IL13unspecified role9606Q86XT9ENSG00000149932TMEM219stimulator9606

More examples

References

If you use gget opentargets in a publication, please cite the following articles:

  • Luebbert, L., & Pachter, L. (2023). Efficient querying of genomic reference databases with gget. Bioinformatics. https://doi.org/10.1093/bioinformatics/btac836

  • Ochoa D, Hercules A, Carmona M, Suveges D, Baker J, Malangone C, Lopez I, Miranda A, Cruz-Castillo C, Fumis L, Bernal-Llinares M, Tsukanov K, Cornu H, Tsirigos K, Razuvayevskaya O, Buniello A, Schwartzentruber J, Karim M, Ariano B, Martinez Osorio RE, Ferrer J, Ge X, Machlitt-Northen S, Gonzalez-Uriarte A, Saha S, Tirunagari S, Mehta C, Roldán-Romero JM, Horswell S, Young S, Ghoussaini M, Hulcoop DG, Dunham I, McDonagh EM. The next-generation Open Targets Platform: reimagined, redesigned, rebuilt. Nucleic Acids Res. 2023 Jan 6;51(D1):D1353-D1359. doi: 10.1093/nar/gkac1046. PMID: 36399499; PMCID: PMC9825572.