Skip to content

EpiGraphDB API endpoints

This document is auto generated from EpiGraphDB API specification.

print(EPIGRAPHDB_API_URL)
1
## http://localhost:8046

Topic endpoints

GET /mr

  Return information related to Mendelian randomisation
  
  Specify at least one of `exposure_trait` and `outcome_trait`
  or both.

Params

{'exposure_trait': typing.Union[str, NoneType],
 'outcome_trait': typing.Union[str, NoneType],
 'pval_threshold': <class 'float'>}
1. Query for exposure trait

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/mr'
 params = {'exposure_trait': 'Body mass index'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (exposure:Gwas)-[mr:MR]->(outcome:Gwas) WHERE '
                        'exposure.trait = "Body mass index" AND mr.pval < 1e-05 '
                        'RETURN exposure {.id, .trait}, outcome {.id, .trait}, '
                        'mr {.b, .se, .pval, .method, .selection, .moescore} '
                        'ORDER BY mr.pval ;',
               'total_seconds': 0.298565},
  'results': [{'exposure': {'id': 'ieu-a-2', 'trait': 'Body mass index'},
               'mr': {'b': 0.034558869898319244,
                      'method': 'FE IVW',
                      'moescore': 0.9300000071525574,
                      'pval': 0.0,
                      'se': 0.002418252406641841,
                      'selection': 'DF'},
               'outcome': {'id': 'ukb-a-74',
                           'trait': 'Non-cancer illness code  self-reported: '
                                    'diabetes'}},
              {'exposure': {'id': 'ieu-a-2', 'trait': 'Body mass index'},
               'mr': {'b': 0.7241045236587524,
                      'method': 'Simple median',
                      'moescore': 0.949999988079071,
                      'pval': 0.0,
                      'se': 0.02658814564347267,
                      'selection': 'Tophits'},
               'outcome': {'id': 'ukb-a-388', 'trait': 'Hip circumference'}},
              {'exposure': {'id': 'ieu-a-2', 'trait': 'Body mass index'},
               'mr': {'b': 0.6564403176307678,
                      'method': 'Simple median',
                      'moescore': 0.9399999976158142,
                      'pval': 0.0,
                      'se': 0.024495629593729973,
                      'selection': 'Tophits'},
               'outcome': {'id': 'ukb-a-382', 'trait': 'Waist circumference'}},
              {'exposure': {'id': 'ieu-a-2', 'trait': 'Body mass index'},
               'mr': {'b': 0.1366840898990631,
                      'method': 'FE IVW',
                      'moescore': 0.9399999976158142,
                      'pval': 0.0,
                      'se': 0.007909317500889301,
                      'selection': 'Tophits'},
               'outcome': {'id': 'ukb-a-35',
                           'trait': 'Comparative height size at age 10'}},
              {'exposure': {'id': 'ieu-a-2', 'trait': 'Body mass index'},
               'mr': {'b': 0.3655795753002167,
2. Query for outcome trait

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/mr'
 params = {'outcome_trait': 'Body mass index'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (exposure:Gwas)-[mr:MR]->(outcome:Gwas) WHERE '
                        'outcome.trait = "Body mass index" AND mr.pval < 1e-05 '
                        'RETURN exposure {.id, .trait}, outcome {.id, .trait}, '
                        'mr {.b, .se, .pval, .method, .selection, .moescore} '
                        'ORDER BY mr.pval ;',
               'total_seconds': 0.165306},
  'results': [{'exposure': {'id': 'ieu-a-971', 'trait': 'Ulcerative colitis'},
               'mr': {'b': -0.011570010334253311,
                      'method': 'FE IVW',
                      'moescore': 1.0,
                      'pval': 0.0,
                      'se': 0.000540608714800328,
                      'selection': 'DF'},
               'outcome': {'id': 'ieu-a-2', 'trait': 'Body mass index'}},
              {'exposure': {'id': 'ieu-a-50', 'trait': 'Hip circumference'},
               'mr': {'b': 0.5895484089851379,
                      'method': 'FE IVW',
                      'moescore': 0.75,
                      'pval': 0.0,
                      'se': 0.03496060520410538,
                      'selection': 'DF'},
               'outcome': {'id': 'ieu-a-2', 'trait': 'Body mass index'}},
              {'exposure': {'id': 'ukb-a-344',
                            'trait': 'Difficulty not smoking for 1 day'},
               'mr': {'b': -0.12298495322465897,
                      'method': 'FE IVW',
                      'moescore': 1.0,
                      'pval': 0.0,
                      'se': 0.007653127424418926,
                      'selection': 'DF'},
               'outcome': {'id': 'ieu-a-2', 'trait': 'Body mass index'}},
              {'exposure': {'id': 'ieu-a-91', 'trait': 'Obesity class 2'},
               'mr': {'b': 0.2586517333984375,
                      'method': 'Penalised median',
                      'moescore': 0.8100000023841858,
                      'pval': 0.0,
                      'se': 0.016835452988743782,
                      'selection': 'HF'},
               'outcome': {'id': 'ieu-a-2', 'trait': 'Body mass index'}},
              {'exposure': {'id': 'ieu-a-90', 'trait': 'Obesity class 1'},
               'mr': {'b': 0.3400000035762787,
                      'method': 'Simple median',
                      'moescore': 0.800000011920929,
                      'pval': 0.0,
                      'se': 0.02044412866
3. Query for both exposure and outcome

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/mr'
 params = {'expsoure_trait': 'Body mass index', 'outcome_trait': 'Coronary heart disease'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (exposure:Gwas)-[mr:MR]->(outcome:Gwas) WHERE '
                        'outcome.trait = "Coronary heart disease" AND mr.pval < '
                        '1e-05 RETURN exposure {.id, .trait}, outcome {.id, '
                        '.trait}, mr {.b, .se, .pval, .method, .selection, '
                        '.moescore} ORDER BY mr.pval ;',
               'total_seconds': 0.137025},
  'results': [{'exposure': {'id': 'ieu-a-798', 'trait': 'Myocardial infarction'},
               'mr': {'b': 0.9747568964958191,
                      'method': 'Simple median',
                      'moescore': 0.8100000023841858,
                      'pval': 0.0,
                      'se': 0.06110995635390282,
                      'selection': 'Tophits'},
               'outcome': {'id': 'ieu-a-7', 'trait': 'Coronary heart disease'}},
              {'exposure': {'id': 'ukb-a-201',
                            'trait': 'Illnesses of father: Heart disease'},
               'mr': {'b': 8.245482444763184,
                      'method': 'FE IVW',
                      'moescore': 0.8600000143051147,
                      'pval': 0.0,
                      'se': 0.4599825441837311,
                      'selection': 'Tophits'},
               'outcome': {'id': 'ieu-a-7', 'trait': 'Coronary heart disease'}},
              {'exposure': {'id': 'ukb-a-20',
                            'trait': 'Exposure to tobacco smoke outside home'},
               'mr': {'b': 0.5509055256843567,
                      'method': 'FE IVW',
                      'moescore': 1.0,
                      'pval': 0.0,
                      'se': 0.008674023672938347,
                      'selection': 'DF'},
               'outcome': {'id': 'ieu-a-7', 'trait': 'Coronary heart disease'}},
              {'exposure': {'id': 'ieu-a-1079', 'trait': 'Zinc'},
               'mr': {'b': 0.060035590082407,
                      'method': 'FE IVW',
                      'moescore': 1.0,
                      'pval': 0.0,
                      'se': 0.0037542390637099743,
                      'selection': 'DF'},
               'outcome': {'id': 'ieu-a-7', 'trait': 'Coronary heart disease'}},
              {'exposure': {'id': 'ieu-a-102', 'trait': 'Waist circumference'},
               'mr': {'b': 0.36000630259513855,
                      'method': 'FE IVW',
                      'moescore': 1.

GET /obs-cor

  Returns observational correlates for a trait.
  
  Args:
  - `trait`: A trait name, e.g. "body mass index"
  - `cor_coef_threshold`: Coefficient correlation threshold

Params

{'cor_coef_threshold': <class 'float'>, 'trait': <class 'str'>}
1. Query

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/obs-cor'
 params = {'trait': 'Waist circumference'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH '
                        '(trait:Gwas)-[obs_cor:OBS_COR]-(assoc_trait:Gwas) '
                        'WHERE trait.trait = "Waist circumference" AND '
                        'abs(obs_cor.cor) > 0.8 RETURN trait {.id, .trait}, '
                        'assoc_trait {.id, .trait}, obs_cor {.cor} ORDER BY '
                        'obs_cor.cor DESC ;',
               'total_seconds': 0.092404},
  'results': [{'assoc_trait': {'id': 'ukb-b-11842', 'trait': 'Weight'},
               'obs_cor': {'cor': 0.8785216212272644},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-11842', 'trait': 'Weight'},
               'obs_cor': {'cor': 0.8785216212272644},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-12039', 'trait': 'Weight'},
               'obs_cor': {'cor': 0.8713608980178833},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-12039', 'trait': 'Weight'},
               'obs_cor': {'cor': 0.8713608980178833},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-19953',
                               'trait': 'Body mass index (BMI)'},
               'obs_cor': {'cor': 0.802693247795105},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-19953',
                               'trait': 'Body mass index (BMI)'},
               'obs_cor': {'cor': 0.802693247795105},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}}]}
2. Adjust for correlation coefficient

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/obs-cor'
 params = {'trait': 'Waist circumference', 'cor_coef_threshold': 0.2}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH '
                        '(trait:Gwas)-[obs_cor:OBS_COR]-(assoc_trait:Gwas) '
                        'WHERE trait.trait = "Waist circumference" AND '
                        'abs(obs_cor.cor) > 0.2 RETURN trait {.id, .trait}, '
                        'assoc_trait {.id, .trait}, obs_cor {.cor} ORDER BY '
                        'obs_cor.cor DESC ;',
               'total_seconds': 0.125692},
  'results': [{'assoc_trait': {'id': 'ukb-b-11842', 'trait': 'Weight'},
               'obs_cor': {'cor': 0.8785216212272644},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-11842', 'trait': 'Weight'},
               'obs_cor': {'cor': 0.8785216212272644},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-12039', 'trait': 'Weight'},
               'obs_cor': {'cor': 0.8713608980178833},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-12039', 'trait': 'Weight'},
               'obs_cor': {'cor': 0.8713608980178833},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-19953',
                               'trait': 'Body mass index (BMI)'},
               'obs_cor': {'cor': 0.802693247795105},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-19953',
                               'trait': 'Body mass index (BMI)'},
               'obs_cor': {'cor': 0.802693247795105},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-2303',
                               'trait': 'Body mass index (BMI)'},
               'obs_cor': {'cor': 0.7957093119621277},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-2303',
                               'trait': 'Body mass index (BMI)'},
               'obs_cor': {'cor': 0.7957093119621277},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-20044', 'trait': 'Trunk fat mass'},
               'obs_cor': {'cor': 0.7381030917167664},

GET /genetic-cor

  Returns genetic correlates for a trait.
  
  Args:
  
  - `trait`: A trait name, e.g. Whole body fat mass
  - `cor_coef_threshold`: correlation coefficient threshold

Params

{'cor_coef_threshold': <class 'float'>, 'trait': <class 'str'>}
1. Query

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/genetic-cor'
 params = {'trait': 'Waist circumference'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (trait:Gwas)-[gc:BN_GEN_COR]-(assoc_trait:Gwas) '
                        'WHERE trait.trait = "Waist circumference" AND '
                        'abs(gc.rg) > 0.8 RETURN trait {.id, .trait}, '
                        'assoc_trait {.id, .trait}, gc { .rg, .z, .se, .p, '
                        '.h2_int, .h2_int_se, .h2_obs, .h2_obs_se, .gcov_int, '
                        '.gcov_int_se } ORDER BY gc.rg DESC ;',
               'total_seconds': 0.140501},
  'results': [{'assoc_trait': {'id': 'ukb-a-279',
                               'trait': 'Leg fat mass (left)'},
               'gc': {'gcov_int': 0.9081000089645386,
                      'gcov_int_se': 0.016950000077486038,
                      'h2_int': 1.0549999475479126,
                      'h2_int_se': 0.01720000058412552,
                      'h2_obs': 0.2029999941587448,
                      'h2_obs_se': 0.006928000133484602,
                      'p': 0.0,
                      'rg': 0.9541000127792358,
                      'se': 0.0028880001045763493,
                      'z': 330.3999938964844},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-7212',
                               'trait': 'Leg fat mass (left)'},
               'gc': {'gcov_int': 0.9081000089645386,
                      'gcov_int_se': 0.016950000077486038,
                      'h2_int': 1.0549999475479126,
                      'h2_int_se': 0.01720000058412552,
                      'h2_obs': 0.2029999941587448,
                      'h2_obs_se': 0.006928000133484602,
                      'p': 0.0,
                      'rg': 0.9541000127792358,
                      'se': 0.0028880001045763493,
                      'z': 330.3999938964844},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-a-287',
                               'trait': 'Arm fat mass (left)'},
               'gc': {'gcov_int': 0.9110999703407288,
                      'gcov_int_se': 0.016610000282526016,
                      'h2_int': 1.0549999475479126,
                      'h2_int_se': 0.01720000058412552,
                      'h2_obs': 0.2029999941587448,
                      'h2_obs_se': 0.006928000133484602,
                      'p': 0.0,
                      'rg': 0.954100
2. Adjust for correlation coefficient

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/genetic-cor'
 params = {'trait': 'Waist circumference', 'cor_coef_threshold': 0.2}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (trait:Gwas)-[gc:BN_GEN_COR]-(assoc_trait:Gwas) '
                        'WHERE trait.trait = "Waist circumference" AND '
                        'abs(gc.rg) > 0.2 RETURN trait {.id, .trait}, '
                        'assoc_trait {.id, .trait}, gc { .rg, .z, .se, .p, '
                        '.h2_int, .h2_int_se, .h2_obs, .h2_obs_se, .gcov_int, '
                        '.gcov_int_se } ORDER BY gc.rg DESC ;',
               'total_seconds': 0.315597},
  'results': [{'assoc_trait': {'id': 'ukb-a-279',
                               'trait': 'Leg fat mass (left)'},
               'gc': {'gcov_int': 0.9081000089645386,
                      'gcov_int_se': 0.016950000077486038,
                      'h2_int': 1.0549999475479126,
                      'h2_int_se': 0.01720000058412552,
                      'h2_obs': 0.2029999941587448,
                      'h2_obs_se': 0.006928000133484602,
                      'p': 0.0,
                      'rg': 0.9541000127792358,
                      'se': 0.0028880001045763493,
                      'z': 330.3999938964844},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-7212',
                               'trait': 'Leg fat mass (left)'},
               'gc': {'gcov_int': 0.9081000089645386,
                      'gcov_int_se': 0.016950000077486038,
                      'h2_int': 1.0549999475479126,
                      'h2_int_se': 0.01720000058412552,
                      'h2_obs': 0.2029999941587448,
                      'h2_obs_se': 0.006928000133484602,
                      'p': 0.0,
                      'rg': 0.9541000127792358,
                      'se': 0.0028880001045763493,
                      'z': 330.3999938964844},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-a-287',
                               'trait': 'Arm fat mass (left)'},
               'gc': {'gcov_int': 0.9110999703407288,
                      'gcov_int_se': 0.016610000282526016,
                      'h2_int': 1.0549999475479126,
                      'h2_int_se': 0.01720000058412552,
                      'h2_obs': 0.2029999941587448,
                      'h2_obs_se': 0.006928000133484602,
                      'p': 0.0,
                      'rg': 0.954100

GET /confounder

  Get confounder / intermediate / collider evidence between traits:
  
  `type` accepts 1 of the 4 options:
  
  - confounder: confounder->exposure->outcome<-confounder
  - intermediate: intermediate<-exposure->outcome<-confounder
  - reverse_intermediate: intermediate->exposure->outcome->confounder
  - collider: collider<-exposure->outcome->collider

Params

{'exposure_trait': typing.Union[str, NoneType],
 'outcome_trait': typing.Union[str, NoneType],
 'pval_threshold': <class 'float'>,
 'type': <enum 'ConfounderType'>}
1. Confounder (default)

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/confounder'
 params = {'exposure_trait': 'Body mass index', 'outcome_trait': 'Coronary heart disease'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (cf:Gwas)-[r1:MR]-> (exposure:Gwas {trait: "Body '
                        'mass index"}) -[r2:MR]->(outcome:Gwas {trait: '
                        '"Coronary heart disease"}) <-[r3:MR]-(cf:Gwas) WHERE '
                        'r1.pval < 1e-05 AND r2.pval < 1e-05 AND r3.pval < '
                        '1e-05 AND cf.id <> exposure.id AND cf.id <> outcome.id '
                        'AND exposure.id <> outcome.id AND cf.trait <> '
                        'exposure.trait AND cf.trait <> outcome.trait AND '
                        'exposure.trait <> outcome.trait RETURN exposure {.id, '
                        '.trait}, outcome {.id, .trait}, cf {.id, .trait}, r1 '
                        '{.b, .se, .pval, .selection, .method, .moescore}, r2 '
                        '{.b, .se, .pval, .selection, .method, .moescore}, r3 '
                        '{.b, .se, .pval, .selection, .method, .moescore} ORDER '
                        'BY r1.p;',
               'total_seconds': 0.268244},
  'results': [{'cf': {'id': 'ieu-a-51', 'trait': 'Hip circumference'},
               'exposure': {'id': 'ieu-a-2', 'trait': 'Body mass index'},
               'outcome': {'id': 'ieu-a-7', 'trait': 'Coronary heart disease'},
               'r1': {'b': 0.8169345855712891,
                      'method': 'Simple mean',
                      'moescore': 0.7799999713897705,
                      'pval': 9.296272196479549e-07,
                      'se': 0.05126238614320755,
                      'selection': 'DF + HF'},
               'r2': {'b': 0.3971014618873596,
                      'method': 'Simple median',
                      'moescore': 0.9200000166893005,
                      'pval': 4.793827557136865e-08,
                      'se': 0.07274528592824936,
                      'selection': 'HF'},
               'r3': {'b': 0.5012693405151367,
                      'method': 'FE IVW',
                      'moescore': 0.8299999833106995,
                      'pval': 1.8831789461160042e-09,
                      'se': 0.08343953639268875,
                      'selection': 'HF'}},
              {'cf': {'id': 'ieu-a-51', 'trait': 'Hip circumference'},
               'exposure': {'id': 'ieu-a-835', 'trait': 'Body mass index'},
               'outcome': {'id': 'ieu-a-7', 'trait': 'Coronary heart disease'},
               'r1': {'b': 0.850901067256927
2. Intermediate

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/confounder'
 params = {'exposure_trait': 'Body mass index', 'outcome_trait': 'Coronary heart disease', 'type': 'intermediate'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (cf:Gwas)<-[r1:MR]- (exposure:Gwas {trait: "Body '
                        'mass index"}) -[r2:MR]->(outcome:Gwas {trait: '
                        '"Coronary heart disease"}) <-[r3:MR]-(cf:Gwas) WHERE '
                        'r1.pval < 1e-05 AND r2.pval < 1e-05 AND r3.pval < '
                        '1e-05 AND cf.id <> exposure.id AND cf.id <> outcome.id '
                        'AND exposure.id <> outcome.id AND cf.trait <> '
                        'exposure.trait AND cf.trait <> outcome.trait AND '
                        'exposure.trait <> outcome.trait RETURN exposure {.id, '
                        '.trait}, outcome {.id, .trait}, cf {.id, .trait}, r1 '
                        '{.b, .se, .pval, .selection, .method, .moescore}, r2 '
                        '{.b, .se, .pval, .selection, .method, .moescore}, r3 '
                        '{.b, .se, .pval, .selection, .method, .moescore} ORDER '
                        'BY r1.p;',
               'total_seconds': 0.303112},
  'results': [{'cf': {'id': 'ieu-a-51', 'trait': 'Hip circumference'},
               'exposure': {'id': 'ieu-a-2', 'trait': 'Body mass index'},
               'outcome': {'id': 'ieu-a-7', 'trait': 'Coronary heart disease'},
               'r1': {'b': 0.7941241264343262,
                      'method': 'Simple median',
                      'moescore': 0.8700000047683716,
                      'pval': 0.0,
                      'se': 0.040066204965114594,
                      'selection': 'DF + HF'},
               'r2': {'b': 0.3971014618873596,
                      'method': 'Simple median',
                      'moescore': 0.9200000166893005,
                      'pval': 4.793827557136865e-08,
                      'se': 0.07274528592824936,
                      'selection': 'HF'},
               'r3': {'b': 0.5012693405151367,
                      'method': 'FE IVW',
                      'moescore': 0.8299999833106995,
                      'pval': 1.8831789461160042e-09,
                      'se': 0.08343953639268875,
                      'selection': 'HF'}},
              {'cf': {'id': 'ieu-a-51', 'trait': 'Hip circumference'},
               'exposure': {'id': 'ieu-a-835', 'trait': 'Body mass index'},
               'outcome': {'id': 'ieu-a-7', 'trait': 'Coronary heart disease'},
               'r1': {'b': 0.782608687877655,
3. Reverse intermediate

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/confounder'
 params = {'exposure_trait': 'Body mass index', 'outcome_trait': 'Coronary heart disease', 'type': 'reverse_intermediate'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (cf:Gwas)-[r1:MR]-> (exposure:Gwas {trait: "Body '
                        'mass index"}) -[r2:MR]->(outcome:Gwas {trait: '
                        '"Coronary heart disease"}) -[r3:MR]->(cf:Gwas) WHERE '
                        'r1.pval < 1e-05 AND r2.pval < 1e-05 AND r3.pval < '
                        '1e-05 AND cf.id <> exposure.id AND cf.id <> outcome.id '
                        'AND exposure.id <> outcome.id AND cf.trait <> '
                        'exposure.trait AND cf.trait <> outcome.trait AND '
                        'exposure.trait <> outcome.trait RETURN exposure {.id, '
                        '.trait}, outcome {.id, .trait}, cf {.id, .trait}, r1 '
                        '{.b, .se, .pval, .selection, .method, .moescore}, r2 '
                        '{.b, .se, .pval, .selection, .method, .moescore}, r3 '
                        '{.b, .se, .pval, .selection, .method, .moescore} ORDER '
                        'BY r1.p;',
               'total_seconds': 0.220607},
  'results': [{'cf': {'id': 'ukb-a-452',
                      'trait': 'Medication for pain relief  constipation  '
                               'heartburn: Aspirin'},
               'exposure': {'id': 'ieu-a-974', 'trait': 'Body mass index'},
               'outcome': {'id': 'ieu-a-7', 'trait': 'Coronary heart disease'},
               'r1': {'b': -1.5948244333267212,
                      'method': 'FE IVW',
                      'moescore': 0.6800000071525574,
                      'pval': 4.80862675418872e-36,
                      'se': 0.12723055481910706,
                      'selection': 'HF'},
               'r2': {'b': 0.3885195851325989,
                      'method': 'FE IVW',
                      'moescore': 0.8899999856948853,
                      'pval': 3.417301697896508e-15,
                      'se': 0.04933808743953705,
                      'selection': 'DF'},
               'r3': {'b': 0.035064660012722015,
                      'method': 'Simple median',
                      'moescore': 0.8999999761581421,
                      'pval': 6.135297961914541e-21,
                      'se': 0.0037351895589381456,
                      'selection': 'Tophits'}},
              {'cf': {'id': 'ukb-a-295', 'trait': 'Chest pain or discomfort'},
               'exposure': {'id': 'ieu-a-2', 'trait': 'Body mass index'},
               'out
4. Collider

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/confounder'
 params = {'exposure_trait': 'Body mass index', 'outcome_trait': 'Coronary heart disease', 'type': 'collider'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (cf:Gwas)<-[r1:MR]- (exposure:Gwas {trait: "Body '
                        'mass index"}) -[r2:MR]->(outcome:Gwas {trait: '
                        '"Coronary heart disease"}) -[r3:MR]->(cf:Gwas) WHERE '
                        'r1.pval < 1e-05 AND r2.pval < 1e-05 AND r3.pval < '
                        '1e-05 AND cf.id <> exposure.id AND cf.id <> outcome.id '
                        'AND exposure.id <> outcome.id AND cf.trait <> '
                        'exposure.trait AND cf.trait <> outcome.trait AND '
                        'exposure.trait <> outcome.trait RETURN exposure {.id, '
                        '.trait}, outcome {.id, .trait}, cf {.id, .trait}, r1 '
                        '{.b, .se, .pval, .selection, .method, .moescore}, r2 '
                        '{.b, .se, .pval, .selection, .method, .moescore}, r3 '
                        '{.b, .se, .pval, .selection, .method, .moescore} ORDER '
                        'BY r1.p;',
               'total_seconds': 0.260326},
  'results': [{'cf': {'id': 'ukb-a-63',
                      'trait': 'Non-cancer illness code  self-reported: heart '
                               'attack/myocardial infarction'},
               'exposure': {'id': 'ieu-a-2', 'trait': 'Body mass index'},
               'outcome': {'id': 'ieu-a-7', 'trait': 'Coronary heart disease'},
               'r1': {'b': 0.010374778881669044,
                      'method': 'FE IVW',
                      'moescore': 0.9200000166893005,
                      'pval': 4.42544889622809e-10,
                      'se': 0.0016630961326882243,
                      'selection': 'DF + HF'},
               'r2': {'b': 0.3971014618873596,
                      'method': 'Simple median',
                      'moescore': 0.9200000166893005,
                      'pval': 4.793827557136865e-08,
                      'se': 0.07274528592824936,
                      'selection': 'HF'},
               'r3': {'b': 0.02065565064549446,
                      'method': 'Weighted median',
                      'moescore': 0.9300000071525574,
                      'pval': 4.525633520383429e-41,
                      'se': 0.0015389990294352174,
                      'selection': 'HF'}},
              {'cf': {'id': 'ukb-a-63',
                      'trait': 'Non-cancer illness code  self-reported: heart '

GET /drugs/risk-factors

  Drugs for common risk factors of diseases

Params

{'pval_threshold': <class 'float'>, 'trait': <class 'str'>}
1. Query

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/drugs/risk-factors'
 params = {'trait': 'Coronary heart disease'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (trait:Gwas {trait: "Coronary heart '
                        'disease"})<-[mr:MR]-(assoc_trait:Gwas) '
                        '-[gwas_to_variant:GWAS_TO_VARIANT]->(variant:Variant) '
                        '-[:VARIANT_TO_GENE]->(gene:Gene) '
                        '<-[:CPIC|:OPENTARGETS_DRUG_TO_TARGET]-(drug:Drug) '
                        'WHERE trait.trait <> assoc_trait.trait AND mr.pval < '
                        '1e-08 AND gwas_to_variant.pval < 1e-8 RETURN trait '
                        '{.id, .trait}, assoc_trait {.id, .trait}, variant '
                        '{.name}, gene {.name}, drug {.label}, mr {.b, .se, '
                        '.pval, .selection, .method, .moescore} ORDER BY '
                        'mr.pval ;',
               'total_seconds': 0.436336},
  'results': [{'assoc_trait': {'id': 'ieu-a-798',
                               'trait': 'Myocardial infarction'},
               'drug': {'label': 'COLLAGENASE CLOSTRIDIUM HISTOLYTICUM'},
               'gene': {'name': 'COL4A2'},
               'mr': {'b': 0.9747568964958191,
                      'method': 'Simple median',
                      'moescore': 0.8100000023841858,
                      'pval': 0.0,
                      'se': 0.06110995635390282,
                      'selection': 'Tophits'},
               'trait': {'id': 'ieu-a-7', 'trait': 'Coronary heart disease'},
               'variant': {'name': 'rs4773141'}},
              {'assoc_trait': {'id': 'ieu-a-798',
                               'trait': 'Myocardial infarction'},
               'drug': {'label': 'OCRIPLASMIN'},
               'gene': {'name': 'COL4A2'},
               'mr': {'b': 0.9747568964958191,
                      'method': 'Simple median',
                      'moescore': 0.8100000023841858,
                      'pval': 0.0,
                      'se': 0.06110995635390282,
                      'selection': 'Tophits'},
               'trait': {'id': 'ieu-a-7', 'trait': 'Coronary heart disease'},
               'variant': {'name': 'rs4773141'}},
              {'assoc_trait': {'id': 'ieu-a-798',
                               'trait': 'Myocardial infarction'},
               'drug': {'label': 'OCRIPLASMIN'},
               'gene': {'name': 'COL4A1'},
               'mr': {'b': 0.9747568964958191,
                      'method': 'Simple median',

GET /pathway

  Pathway-based stratification of instruments

Params

{'pval_threshold': <class 'float'>, 'trait': <class 'str'>}
1. Query

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/pathway'
 params = {'trait': 'LDL cholesterol'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (gwas:Gwas {trait: "LDL cholesterol"}) '
                        '-[gwas_to_variant:GWAS_TO_VARIANT]->(variant:Variant)-[variant_to_gene:VARIANT_TO_GENE]-> '
                        '(gene:Gene)-[gene_to_protein:GENE_TO_PROTEIN]->(protein:Protein) '
                        '-[protein_in_pathway:PROTEIN_IN_PATHWAY]->(pathway:Pathway) '
                        'WHERE gwas_to_variant.pval < 1e-05 AND gene.name is '
                        'not null RETURN gwas {.id, .trait}, gwas_to_variant '
                        '{.beta, .se, .pval, .samplesize}, variant {.name}, '
                        'gene {.name}, protein {.uniprot_id}, pathway '
                        '{.reactome_id, .name} ORDER BY gwas_to_variant.pval ;',
               'total_seconds': 0.136815},
  'results': [{'gene': {'name': 'APOC4'},
               'gwas': {'id': 'ieu-a-300', 'trait': 'LDL cholesterol'},
               'gwas_to_variant': {'beta': -0.44620001316070557,
                                   'pval': 0.0,
                                   'samplesize': 99409.0,
                                   'se': 0.018300000578165054},
               'pathway': {'name': 'VLDL assembly',
                           'reactome_id': 'R-HSA-8866423'},
               'protein': {'uniprot_id': 'P55056'},
               'variant': {'name': 'rs12721109'}},
              {'gene': {'name': 'APOC2'},
               'gwas': {'id': 'ieu-a-300', 'trait': 'LDL cholesterol'},
               'gwas_to_variant': {'beta': -0.44620001316070557,
                                   'pval': 0.0,
                                   'samplesize': 99409.0,
                                   'se': 0.018300000578165054},
               'pathway': {'name': 'Assembly of active LPL and LIPC lipase '
                                   'complexes',
                           'reactome_id': 'R-HSA-8963889'},
               'protein': {'uniprot_id': 'P02655'},
               'variant': {'name': 'rs12721109'}},
              {'gene': {'name': 'APOC2'},
               'gwas': {'id': 'ieu-a-300', 'trait': 'LDL cholesterol'},
               'gwas_to_variant': {'beta': -0.44620001316070557,
                                   'pval': 0.0,
                                   'samplesize': 99409.0,
                                   'se': 0.018300000578165054},
               'pathway': {'name': 'HDL remodeling

GET /xqtl/multi-snp-mr

  xQTL multi SNP MR results
  
      Search by exposure_gene, outcome_trait, or both.
  
      - qtl_type: eQTL, pQTL

Params

{'exposure_gene': typing.Union[str, NoneType],
 'mr_method': <enum 'MrMethodInput'>,
 'outcome_trait': typing.Union[str, NoneType],
 'pval_threshold': <class 'float'>,
 'qtl_type': <enum 'QtlTypeInput'>}
1. Query by exposure gene

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/xqtl/multi-snp-mr'
 params = {'exposure_gene': 'PLAU'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (gene:Gene)-[r:XQTL_MULTI_SNP_MR]->(gwas:Gwas) '
                        'WHERE gene.name = "PLAU" AND gene.name is not null AND '
                        'r.mr_method = "IVW" AND r.qtl_type = "eQTL" AND r.p < '
                        '1e-05 RETURN gene {.ensembl_id, .name}, gwas {.id, '
                        '.trait}, r {.beta, .se, .p} ORDER BY r.p ;',
               'total_seconds': 0.091527},
  'results': [{'gene': {'ensembl_id': 'ENSG00000122861', 'name': 'PLAU'},
               'gwas': {'id': 'ukb-a-337',
                        'trait': 'Forced expiratory volume in 1-second (FEV1)'},
               'r': {'beta': 0.04216459393501282,
                     'p': 2.328168193344027e-06,
                     'se': 0.008928206749260426}}]}
2. Query by outcome trait

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/xqtl/multi-snp-mr'
 params = {'outcome_trait': "Crohn's disease"}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (gene:Gene)-[r:XQTL_MULTI_SNP_MR]->(gwas:Gwas) '
                        'WHERE gwas.trait = "Crohn\'s disease" AND gene.name is '
                        'not null AND r.mr_method = "IVW" AND r.qtl_type = '
                        '"eQTL" AND r.p < 1e-05 RETURN gene {.ensembl_id, '
                        '.name}, gwas {.id, .trait}, r {.beta, .se, .p} ORDER '
                        'BY r.p ;',
               'total_seconds': 0.105011},
  'results': [{'gene': {'ensembl_id': 'ENSG00000125462', 'name': 'C1orf61'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': -1.9822832345962524,
                     'p': 4.706132775819307e-32,
                     'se': 0.16821469366550446}},
              {'gene': {'ensembl_id': 'ENSG00000148396', 'name': 'SEC16A'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': -0.49619048833847046,
                     'p': 6.068513887261195e-19,
                     'se': 0.05580959841609001}},
              {'gene': {'ensembl_id': 'ENSG00000120708', 'name': 'TGFBI'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': -0.8785645961761475,
                     'p': 8.876167309769772e-16,
                     'se': 0.1092541292309761}},
              {'gene': {'ensembl_id': 'ENSG00000128656', 'name': 'CHN1'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': 0.8776293396949768,
                     'p': 1.0981423230940605e-15,
                     'se': 0.1094934344291687}},
              {'gene': {'ensembl_id': 'ENSG00000113441', 'name': 'LNPEP'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': 0.33051997423171997,
                     'p': 2.4359172549881774e-15,
                     'se': 0.04174889251589775}},
              {'gene': {'ensembl_id': 'ENSG00000168610', 'name': 'STAT3'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': 0.613986611366272,
                     'p': 2.1942186904781204e-14,
                     'se': 0.08037839084863663}},
              {'gene': {'ensembl_id': 'ENSG00000118971', 'name': 'CCND2'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},

GET /xqtl/single-snp-mr

  xQTL single SNP MR results
  
      Search by exposure_gene, outcome_trait, variant, or all of them.
  
      - qtl_type: eQTL, pQTL

Params

{'exposure_gene': <class 'str'>,
 'outcome_trait': <class 'str'>,
 'pval_threshold': <class 'float'>,
 'qtl_type': <enum 'QtlTypeInput'>,
 'variant': <class 'str'>}
1. Query by exposure gene

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/xqtl/single-snp-mr'
 params = {'exposure_gene': 'PLAU'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH '
                        '(variant:Variant)-[s:XQTL_SINGLE_SNP_MR_SNP_GENE]-> '
                        '(gene:Gene)-[r:XQTL_SINGLE_SNP_MR_GENE_GWAS]->(gwas:Gwas) '
                        'WHERE gene.name = "PLAU" AND gene.name is not null AND '
                        'variant.name = r.rsid AND r.qtl_type = "eQTL" AND r.p '
                        '< 1e-05 RETURN gene {.ensembl_id, .name}, gwas {.id, '
                        '.trait}, r {.beta, .se, .p, .rsid} ORDER BY r.p ;',
               'total_seconds': 0.106868},
  'results': [{'gene': {'ensembl_id': 'ENSG00000122861', 'name': 'PLAU'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': -0.41830548644065857,
                     'p': 4.724118774120101e-13,
                     'rsid': 'rs2227551',
                     'se': 0.05783285200595856}},
              {'gene': {'ensembl_id': 'ENSG00000122861', 'name': 'PLAU'},
               'gwas': {'id': 'ieu-a-294',
                        'trait': 'Inflammatory bowel disease'},
               'r': {'beta': -0.2879520356655121,
                     'p': 1.2777334745806002e-09,
                     'rsid': 'rs2227551',
                     'se': 0.04743720963597298}}]}
2. Query by outcome trait

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/xqtl/single-snp-mr'
 params = {'outcome_trait': "Crohn's disease"}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH '
                        '(variant:Variant)-[s:XQTL_SINGLE_SNP_MR_SNP_GENE]-> '
                        '(gene:Gene)-[r:XQTL_SINGLE_SNP_MR_GENE_GWAS]->(gwas:Gwas) '
                        'WHERE gwas.trait = "Crohn\'s disease" AND gene.name is '
                        'not null AND variant.name = r.rsid AND r.qtl_type = '
                        '"eQTL" AND r.p < 1e-05 RETURN gene {.ensembl_id, '
                        '.name}, gwas {.id, .trait}, r {.beta, .se, .p, .rsid} '
                        'ORDER BY r.p ;',
               'total_seconds': 0.238259},
  'results': [{'gene': {'ensembl_id': 'ENSG00000137507', 'name': 'LRRC32'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': -3.36830472946167,
                     'p': 0.0,
                     'rsid': 'rs2155219',
                     'se': 0.23679926991462708}},
              {'gene': {'ensembl_id': 'ENSG00000261644',
                        'name': 'RP11-327F22.2'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': -0.4613199234008789,
                     'p': 0.0,
                     'rsid': 'rs8056611',
                     'se': 0.03207816183567047}},
              {'gene': {'ensembl_id': 'ENSG00000263417', 'name': 'GTSCR1'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': -3.1092164516448975,
                     'p': 0.0,
                     'rsid': 'rs2212434',
                     'se': 0.20867732167243958}},
              {'gene': {'ensembl_id': 'ENSG00000183134', 'name': 'PTGDR2'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': -3.7114267349243164,
                     'p': 0.0,
                     'rsid': 'rs56399423',
                     'se': 0.24088479578495026}},
              {'gene': {'ensembl_id': 'ENSG00000103355', 'name': 'PRSS33'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': -3.733132839202881,
                     'p': 0.0,
                     'rsid': 'rs56399423',
                     'se': 0.2422936111688614}},
              {'gene': {'ensembl_id': 'ENSG00000115415', 'name': 'STAT1'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': 2
3. Query by variant

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/xqtl/single-snp-mr'
 params = {'variant': 'rs1250566'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH '
                        '(variant:Variant)-[s:XQTL_SINGLE_SNP_MR_SNP_GENE]-> '
                        '(gene:Gene)-[r:XQTL_SINGLE_SNP_MR_GENE_GWAS]->(gwas:Gwas) '
                        'WHERE variant.name = "rs1250566" AND gene.name is not '
                        'null AND variant.name = r.rsid AND r.qtl_type = "eQTL" '
                        'AND r.p < 1e-05 RETURN gene {.ensembl_id, .name}, gwas '
                        '{.id, .trait}, r {.beta, .se, .p, .rsid} ORDER BY r.p '
                        ';',
               'total_seconds': 0.103152},
  'results': [{'gene': {'ensembl_id': 'ENSG00000167037', 'name': 'SGSM1'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': 2.145049571990967,
                     'p': 1.2702709147221536e-25,
                     'rsid': 'rs1250566',
                     'se': 0.20500238239765167}},
              {'gene': {'ensembl_id': 'ENSG00000104490', 'name': 'NCALD'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': 2.4488768577575684,
                     'p': 1.2702709147221536e-25,
                     'rsid': 'rs1250566',
                     'se': 0.23403917253017426}},
              {'gene': {'ensembl_id': 'ENSG00000167037', 'name': 'SGSM1'},
               'gwas': {'id': 'ieu-a-294',
                        'trait': 'Inflammatory bowel disease'},
               'r': {'beta': 1.536917805671692,
                     'p': 4.771926759401136e-20,
                     'rsid': 'rs1250566',
                     'se': 0.16762013733386993}},
              {'gene': {'ensembl_id': 'ENSG00000104490', 'name': 'NCALD'},
               'gwas': {'id': 'ieu-a-294',
                        'trait': 'Inflammatory bowel disease'},
               'r': {'beta': 1.7546087503433228,
                     'p': 4.771926759401136e-20,
                     'rsid': 'rs1250566',
                     'se': 0.19136205315589905}},
              {'gene': {'ensembl_id': 'ENSG00000167037', 'name': 'SGSM1'},
               'gwas': {'id': 'ukb-b-19732',
                        'trait': 'Non-cancer illness code, self-reported: '
                                 'hypothyroidism/myxoedema'},
               'r': {'beta': -0.0378122553229332,
                     'p': 1.5992576152257243e-07,
                     'rsid': 'rs125

POST /xqtl/single-snp-mr/gene-by-variant

  Get the list of genes associated by an instrument SNP, nested per SNP

Params

{'data': <class 'app.apis.xqtl.models.GeneByVariantRequest'>}
1. Query

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/xqtl/single-snp-mr/gene-by-variant'
 data = {'variant_list': ['rs9272544', 'rs242797']}
 r = requests.post(url, json=data)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH '
                        '(variant:Variant)-[vg:XQTL_SINGLE_SNP_MR_SNP_GENE]-(gene:Gene) '
                        '-[xqtl:XQTL_SINGLE_SNP_MR_GENE_GWAS]-(gwas:Gwas) WHERE '
                        "variant.name IN ['rs9272544', 'rs242797'] AND "
                        "xqtl.rsid = variant.name AND xqtl.qtl_type = 'eQTL' "
                        'WITH variant.name AS variant, collect(DISTINCT '
                        'gene.name) AS gene_list RETURN variant, gene_list, '
                        'size(gene_list) AS n_genes',
               'total_seconds': 0.119003},
  'results': [{'gene_list': ['CSRP2BP', 'NENF'],
               'n_genes': 2,
               'variant': 'rs9272544'},
              {'gene_list': ['PPP1R3D', 'FAM217B'],
               'n_genes': 2,
               'variant': 'rs242797'}]}

GET /prs

  Polygenic risk scores between GWAS traits

Params

{'pval_threshold': <class 'float'>, 'trait': <class 'str'>}
1. Query

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/prs'
 params = {'trait': 'Body mass index'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (trait:Gwas)-[prs:PRS]-(assoc_trait:Gwas) WHERE '
                        'trait.trait = "Body mass index" AND prs.p < 1e-05 '
                        'RETURN trait {.id, .trait}, assoc_trait {.id, .trait}, '
                        'prs { .beta, .se, .p, .r2, .nsnps, .n, .model } ORDER '
                        'BY prs.p ;',
               'total_seconds': 0.148153},
  'results': [{'assoc_trait': {'id': 'ukb-a-359',
                               'trait': 'Diastolic blood pressure  automated '
                                        'reading'},
               'prs': {'beta': 0.025779757648706436,
                       'model': 'lm',
                       'n': 315735,
                       'nsnps': 251,
                       'p': 0.0,
                       'r2': 0.0006938810111023486,
                       'se': 0.0017453229520469904},
               'trait': {'id': 'ieu-a-2', 'trait': 'Body mass index'}},
              {'assoc_trait': {'id': 'ukb-b-7953',
                               'trait': 'Forced vital capacity (FVC)'},
               'prs': {'beta': -0.01881469041109085,
                       'model': 'lm',
                       'n': 304938,
                       'nsnps': 251,
                       'p': 0.0,
                       'r2': 0.0003322389966342598,
                       'se': 0.001270386972464621},
               'trait': {'id': 'ieu-a-2', 'trait': 'Body mass index'}},
              {'assoc_trait': {'id': 'ukb-a-336',
                               'trait': 'Forced vital capacity (FVC)'},
               'prs': {'beta': -0.01881469041109085,
                       'model': 'lm',
                       'n': 304938,
                       'nsnps': 251,
                       'p': 0.0,
                       'r2': 0.0003322389966342598,
                       'se': 0.001270386972464621},
               'trait': {'id': 'ieu-a-2', 'trait': 'Body mass index'}},
              {'assoc_trait': {'id': 'ukb-b-4063',
                               'trait': 'Number of self-reported non-cancer '
                                        'illnesses'},
               'prs': {'beta': 0.020495034754276276,
                       'model': 'lm',
                       'n': 334929,
                       'nsnps': 251,
                       'p': 0.0,
                       'r2': 0.0005998359993100166,
                       'se': 

POST /protein/ppi

  For the list of proteins, returns their **directly**
  associated proteins in protein-protein-interactions

Params

{'data': <class 'app.apis.protein.models.PpiRequest'>}
1. Query

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/protein/ppi'
 data = {'uniprot_id_list': ['P30793', 'Q9NZM1', 'O95236']}
 r = requests.post(url, json=data)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH '
                        'p=(protein:Protein)-[r:STRING_INTERACT_WITH]-(assoc_protein:Protein) '
                        "WHERE protein.uniprot_id IN ['P30793', 'Q9NZM1', "
                        "'O95236'] RETURN protein {.uniprot_id}, assoc_protein "
                        '{.uniprot_id}',
               'total_seconds': 0.081598},
  'results': [{'assoc_protein': {'uniprot_id': 'P00439'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uniprot_id': 'Q5TCS8'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uniprot_id': 'O14638'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uniprot_id': 'P20711'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uniprot_id': 'O43556'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uniprot_id': 'P00374'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uniprot_id': 'P22392'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uniprot_id': 'P05187'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uniprot_id': 'P22102'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uniprot_id': 'P07101'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uniprot_id': 'Q9BY32'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uniprot_id': 'O95197'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uniprot_id': 'P50583'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uniprot_id': 'P05186'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uniprot_id': 'Q05932'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uniprot_id': 'Q5MY95'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uniprot_id': 'Q9BX66'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uniprot_id': 'P49961'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uni

POST /protein/ppi/pairwise

  For the list of proteins, returns a graph edgelist
  where they are connected via protein-protein-interactions,
  with configurable middle steps

Params

{'data': <class 'app.apis.protein.models.PpiGraphRequest'>}
1. Default query (direct interaction)

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/protein/ppi/pairwise'
 data = {'uniprot_id_list': ['P30793', 'Q9NZM1', 'O95236', 'P32456', 'Q13536', 'Q9NRQ5', 'O60674', 'O14933', 'P32455', 'P40306', 'P42224', 'P28838', 'P23381']}
 r = requests.post(url, json=data)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH '
                        'p=(protein:Protein)-[r:STRING_INTERACT_WITH*1..1]-(assoc_protein:Protein) '
                        "WHERE protein.uniprot_id IN ['P30793', 'Q9NZM1', "
                        "'O95236', 'P32456', 'Q13536', 'Q9NRQ5', 'O60674', "
                        "'O14933', 'P32455', 'P40306', 'P42224', 'P28838', "
                        "'P23381'] AND assoc_protein.uniprot_id IN ['P30793', "
                        "'Q9NZM1', 'O95236', 'P32456', 'Q13536', 'Q9NRQ5', "
                        "'O60674', 'O14933', 'P32455', 'P40306', 'P42224', "
                        "'P28838', 'P23381'] RETURN protein.uniprot_id AS "
                        'protein, assoc_protein.uniprot_id AS assoc_protein, '
                        'length(p) AS path_size',
               'total_seconds': 0.093967},
  'results': [{'assoc_protein': 'P42224', 'path_size': 1, 'protein': 'P28838'},
              {'assoc_protein': 'P32455', 'path_size': 1, 'protein': 'O14933'},
              {'assoc_protein': 'P42224', 'path_size': 1, 'protein': 'O14933'},
              {'assoc_protein': 'P32456', 'path_size': 1, 'protein': 'P32455'},
              {'assoc_protein': 'P42224', 'path_size': 1, 'protein': 'P32455'},
              {'assoc_protein': 'O14933', 'path_size': 1, 'protein': 'P32455'},
              {'assoc_protein': 'P42224', 'path_size': 1, 'protein': 'P32456'},
              {'assoc_protein': 'P32455', 'path_size': 1, 'protein': 'P32456'},
              {'assoc_protein': 'P42224', 'path_size': 1, 'protein': 'O60674'},
              {'assoc_protein': 'P28838', 'path_size': 1, 'protein': 'P42224'},
              {'assoc_protein': 'O14933', 'path_size': 1, 'protein': 'P42224'},
              {'assoc_protein': 'O60674', 'path_size': 1, 'protein': 'P42224'},
              {'assoc_protein': 'P32455', 'path_size': 1, 'protein': 'P42224'},
              {'assoc_protein': 'P32456', 'path_size': 1, 'protein': 'P42224'}]}
2. With at most 1 intermediate protein

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/protein/ppi/pairwise'
 data = {'uniprot_id_list': ['P30793', 'Q9NZM1', 'O95236', 'P32456', 'Q13536', 'Q9NRQ5', 'O60674', 'O14933', 'P32455', 'P40306', 'P42224', 'P28838', 'P23381'], 'n_intermediate_proteins': 1}
 r = requests.post(url, json=data)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH '
                        'p=(protein:Protein)-[r:STRING_INTERACT_WITH*1..2]-(assoc_protein:Protein) '
                        "WHERE protein.uniprot_id IN ['P30793', 'Q9NZM1', "
                        "'O95236', 'P32456', 'Q13536', 'Q9NRQ5', 'O60674', "
                        "'O14933', 'P32455', 'P40306', 'P42224', 'P28838', "
                        "'P23381'] AND assoc_protein.uniprot_id IN ['P30793', "
                        "'Q9NZM1', 'O95236', 'P32456', 'Q13536', 'Q9NRQ5', "
                        "'O60674', 'O14933', 'P32455', 'P40306', 'P42224', "
                        "'P28838', 'P23381'] RETURN protein.uniprot_id AS "
                        'protein, assoc_protein.uniprot_id AS assoc_protein, '
                        'length(p) AS path_size',
               'total_seconds': 0.335119},
  'results': [{'assoc_protein': 'P42224', 'path_size': 1, 'protein': 'P28838'},
              {'assoc_protein': 'O14933', 'path_size': 2, 'protein': 'P28838'},
              {'assoc_protein': 'O60674', 'path_size': 2, 'protein': 'P28838'},
              {'assoc_protein': 'P32455', 'path_size': 2, 'protein': 'P28838'},
              {'assoc_protein': 'P32456', 'path_size': 2, 'protein': 'P28838'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'O14933'},
              {'assoc_protein': 'O60674', 'path_size': 2, 'protein': 'O14933'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'O14933'},
              {'assoc_protein': 'P40306', 'path_size': 2, 'protein': 'O14933'},
              {'assoc_protein': 'P32455', 'path_size': 2, 'protein': 'O14933'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'O14933'},
              {'assoc_protein': 'P32456', 'path_size': 2, 'protein': 'O14933'},
              {'assoc_protein': 'O60674', 'path_size': 2, 'protein': 'O14933'},
              {'assoc_protein': 'P40306', 'path_size': 2, 'protein': 'O14933'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'O14933'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'O14933'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'O14933'},
              {'assoc_protein': 'O60674', 'path_size': 2, 'protein': 'O14933'},
              {'assoc_protein': 'P32455', 'path_size': 2, 'protein': 'O14933'},
              {'assoc_protei

POST /protein/in-pathway

  For the list of proteins, returns their associated
  pathway data

Params

{'data': <class 'app.apis.protein.models.PathwayRequest'>}
1. Query

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/protein/in-pathway'
 data = {'uniprot_id_list': ['O14933', 'O60674', 'P32455']}
 r = requests.post(url, json=data)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH '
                        'p=(protein:Protein)-[r:PROTEIN_IN_PATHWAY]-(pathway:Pathway) '
                        "WHERE protein.uniprot_id IN ['O14933', 'O60674', "
                        "'P32455'] RETURN protein.uniprot_id AS uniprot_id, "
                        'count(p) AS pathway_count, '
                        'collect(pathway.reactome_id) AS pathway_reactome_id',
               'total_seconds': 0.092525},
  'results': [{'pathway_count': 2,
               'pathway_reactome_id': ['R-HSA-1169408', 'R-HSA-977225'],
               'uniprot_id': 'O14933'},
              {'pathway_count': 11,
               'pathway_reactome_id': ['R-HSA-1059683',
                                       'R-HSA-6788467',
                                       'R-HSA-9020956',
                                       'R-HSA-9020591',
                                       'R-HSA-1170546',
                                       'R-HSA-6785807',
                                       'R-HSA-512988',
                                       'R-HSA-9020933',
                                       'R-HSA-1433557',
                                       'R-HSA-982772',
                                       'R-HSA-983231'],
               'uniprot_id': 'O60674'},
              {'pathway_count': 1,
               'pathway_reactome_id': ['R-HSA-877300'],
               'uniprot_id': 'P32455'}]}

GET /gene/druggability/ppi

  For a gene, search for its associated druggable genes
  via protein-protein-interaction (INTACT and STRING)

Params

{'gene_name': <class 'str'>}
1. Query

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/gene/druggability/ppi'
 params = {'gene_name': 'IL23R'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (g1:Gene)-[:GENE_TO_PROTEIN]-(p1:Protein) '
                        '-[:INTACT_INTERACTS_WITH | STRING_INTERACT_WITH]- '
                        '(p2:Protein)-[:GENE_TO_PROTEIN]-(g2:Gene) WHERE '
                        "g1.name = 'IL23R' AND g2.name IS NOT NULL AND "
                        'g2.druggability_tier IS NOT NULL RETURN DISTINCT g1 '
                        '{.name}, p1 {.uniprot_id}, p2 {.uniprot_id}, g2 '
                        '{.name, .druggability_tier} ORDER BY '
                        'g2.druggability_tier, g2.name',
               'total_seconds': 0.100163},
  'results': [{'g1': {'name': 'IL23R'},
               'g2': {'druggability_tier': 'Tier 1', 'name': 'CSF2'},
               'p1': {'uniprot_id': 'Q5VWK5'},
               'p2': {'uniprot_id': 'P04141'}},
              {'g1': {'name': 'IL23R'},
               'g2': {'druggability_tier': 'Tier 1', 'name': 'IFNA1'},
               'p1': {'uniprot_id': 'Q5VWK5'},
               'p2': {'uniprot_id': 'P01562'}},
              {'g1': {'name': 'IL23R'},
               'g2': {'druggability_tier': 'Tier 1', 'name': 'IFNG'},
               'p1': {'uniprot_id': 'Q5VWK5'},
               'p2': {'uniprot_id': 'P01579'}},
              {'g1': {'name': 'IL23R'},
               'g2': {'druggability_tier': 'Tier 1', 'name': 'IL10'},
               'p1': {'uniprot_id': 'Q5VWK5'},
               'p2': {'uniprot_id': 'P22301'}},
              {'g1': {'name': 'IL23R'},
               'g2': {'druggability_tier': 'Tier 1', 'name': 'IL12B'},
               'p1': {'uniprot_id': 'Q5VWK5'},
               'p2': {'uniprot_id': 'P29460'}},
              {'g1': {'name': 'IL23R'},
               'g2': {'druggability_tier': 'Tier 1', 'name': 'IL12RB1'},
               'p1': {'uniprot_id': 'Q5VWK5'},
               'p2': {'uniprot_id': 'P42701'}},
              {'g1': {'name': 'IL23R'},
               'g2': {'druggability_tier': 'Tier 1', 'name': 'IL13'},
               'p1': {'uniprot_id': 'Q5VWK5'},
               'p2': {'uniprot_id': 'P35225'}},
              {'g1': {'name': 'IL23R'},
               'g2': {'druggability_tier': 'Tier 1', 'name': 'IL15'},
               'p1': {'uniprot_id': 'Q5VWK5'},
               'p2': {'uniprot_id': 'P40933'}},
              {'g1': {'name': 'IL23R'},
               'g2': {'druggability_tier': 'Tier 1', 'name': 'IL17A'},
               'p1': {'uniprot_i

GET /gene/literature

  For a gene, search for its literature evidence
  related to a semmed object

Params

{'gene_name': <class 'str'>, 'object_name': <class 'str'>}
1. Query

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/gene/literature'
 params = {'gene_name': 'IL23R', 'object_name': 'Inflammatory bowel disease'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH '
                        '(gene:Gene)-[:SEM_GENE]-(:SemmedTerm)-[:SEM_SUB|SEM_OBJ]- '
                        '(st:SemmedTriple)-[:SEM_TO_LIT]-(l:Literature) WHERE '
                        "gene.name = 'IL23R' AND "
                        'st.object_name=~"(?i).*Inflammatory bowel disease.*" '
                        'RETURN gene {.name}, st {.predicate, .object_name}, '
                        'collect(l.pubmed_id) AS pubmed_id',
               'total_seconds': 0.104417},
  'results': [{'gene': {'name': 'IL23R'},
               'pubmed_id': ['17484863', '21155887'],
               'st': {'object_name': 'Inflammatory Bowel Diseases',
                      'predicate': 'NEG_ASSOCIATED_WITH'}},
              {'gene': {'name': 'IL23R'},
               'pubmed_id': ['27852544'],
               'st': {'object_name': 'Inflammatory Bowel Diseases',
                      'predicate': 'AFFECTS'}},
              {'gene': {'name': 'IL23R'},
               'pubmed_id': ['17484863',
                             '19575361',
                             '19496308',
                             '18383521',
                             '18341487',
                             '19817673',
                             '18088064',
                             '29248579',
                             '18047540',
                             '25159710',
                             '18383363',
                             '19175939',
                             '18698678',
                             '21155887',
                             '21846945',
                             '20067801',
                             '18368064',
                             '20393462',
                             '19747142',
                             '18164077',
                             '24280935'],
               'st': {'object_name': 'Inflammatory Bowel Diseases',
                      'predicate': 'ASSOCIATED_WITH'}},
              {'gene': {'name': 'IL23R'},
               'pubmed_id': ['23131344'],
               'st': {'object_name': 'Inflammatory Bowel Diseases',
                      'predicate': 'PREDISPOSES'}}]}

GET /gene/drugs

  Get the aasociated drugs for a gene.

Params

{'gene_name': <class 'str'>}
1. Query

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/gene/drugs'
 params = {'gene_name': 'TFRC'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH '
                        '(gene:Gene)-[r:OPENTARGETS_DRUG_TO_TARGET|CPIC]-(drug:Drug) '
                        "WHERE gene.name = 'TFRC' RETURN gene {.name}, r, "
                        'type(r) AS r_source, drug {.label}',
               'total_seconds': 0.103641},
  'results': [{'drug': {'label': 'A27.15'},
               'gene': {'name': 'TFRC'},
               'r': {'action_type': 'ANTAGONIST', 'phase': '1'},
               'r_source': 'OPENTARGETS_DRUG_TO_TARGET'},
              {'drug': {'label': 'E2.3'},
               'gene': {'name': 'TFRC'},
               'r': {'action_type': 'INHIBITOR', 'phase': '1'},
               'r_source': 'OPENTARGETS_DRUG_TO_TARGET'}]}

GET /ontology/gwas-efo

  Map Gwas trait to EFO term, via `GWAS_NLP_EFO`

Params

{'efo_term': typing.Union[str, NoneType],
 'fuzzy': <class 'bool'>,
 'score_threshold': <class 'float'>,
 'trait': typing.Union[str, NoneType]}
1. Default (fuzzy matching)

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/ontology/gwas-efo'
 params = {'trait': 'body mass', 'efo_term': 'body mass'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (gwas:Gwas)-[r:GWAS_NLP_EFO]-(efo:Efo) WHERE '
                        'r.score > 0.75 AND gwas.trait =~ "(?i).*body mass.*" '
                        'AND efo.value =~ "(?i).*body mass.*" RETURN gwas {.id, '
                        '.trait}, r {.score}, efo {.type, .value, .id} ORDER BY '
                        'r.score DESC',
               'total_seconds': 0.14974},
  'results': [{'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004340',
                       'type': 'typed-literal',
                       'value': 'body mass index'},
               'gwas': {'id': 'ieu-a-94', 'trait': 'Body mass index'},
               'r': {'score': 1.0}},
              {'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004340',
                       'type': 'typed-literal',
                       'value': 'body mass index'},
               'gwas': {'id': 'ieu-a-2', 'trait': 'Body mass index'},
               'r': {'score': 1.0}},
              {'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004340',
                       'type': 'typed-literal',
                       'value': 'body mass index'},
               'gwas': {'id': 'ieu-a-1089', 'trait': 'Body mass index'},
               'r': {'score': 1.0}},
              {'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004340',
                       'type': 'typed-literal',
                       'value': 'body mass index'},
               'gwas': {'id': 'ieu-a-785', 'trait': 'Body mass index'},
               'r': {'score': 1.0}},
              {'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004340',
                       'type': 'typed-literal',
                       'value': 'body mass index'},
               'gwas': {'id': 'ieu-a-974', 'trait': 'Body mass index'},
               'r': {'score': 1.0}},
              {'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004340',
                       'type': 'typed-literal',
                       'value': 'body mass index'},
               'gwas': {'id': 'ieu-a-95', 'trait': 'Body mass index'},
               'r': {'score': 1.0}},
              {'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004340',
                       'type': 'typed-literal',
                       'value': 'body mass index'},
               'gwas': {'id': 'ebi-a-GCST006368', 'trait': 'Body mass index'},
               'r': {'score': 1.0}},
              {'efo': {'id': 'http://www.ebi.ac.uk
2. Exact matching

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/ontology/gwas-efo'
 params = {'trait': 'Body mass index', 'fuzzy': False}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (gwas:Gwas)-[r:GWAS_NLP_EFO]-(efo:Efo) WHERE '
                        'r.score > 0.75 AND gwas.trait = "Body mass index" '
                        'RETURN gwas {.id, .trait}, r {.score}, efo {.type, '
                        '.value, .id} ORDER BY r.score DESC',
               'total_seconds': 0.088423},
  'results': [{'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004340',
                       'type': 'typed-literal',
                       'value': 'body mass index'},
               'gwas': {'id': 'ebi-a-GCST006368', 'trait': 'Body mass index'},
               'r': {'score': 1.0}},
              {'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004340',
                       'type': 'typed-literal',
                       'value': 'body mass index'},
               'gwas': {'id': 'ieu-a-2', 'trait': 'Body mass index'},
               'r': {'score': 1.0}},
              {'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004340',
                       'type': 'typed-literal',
                       'value': 'body mass index'},
               'gwas': {'id': 'ieu-a-785', 'trait': 'Body mass index'},
               'r': {'score': 1.0}},
              {'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004340',
                       'type': 'typed-literal',
                       'value': 'body mass index'},
               'gwas': {'id': 'ieu-a-835', 'trait': 'Body mass index'},
               'r': {'score': 1.0}},
              {'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004340',
                       'type': 'typed-literal',
                       'value': 'body mass index'},
               'gwas': {'id': 'ebi-a-GCST004904', 'trait': 'Body mass index'},
               'r': {'score': 1.0}},
              {'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004340',
                       'type': 'typed-literal',
                       'value': 'body mass index'},
               'gwas': {'id': 'ieu-a-1089', 'trait': 'Body mass index'},
               'r': {'score': 1.0}},
              {'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004340',
                       'type': 'typed-literal',
                       'value': 'body mass index'},
               'gwas': {'id': 'ieu-a-974', 'trait': 'Body mass index'},
               'r': {'score': 1.0}},
              {'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004340',
                       'type': 'typed-

GET /ontology/disease-efo

  Map Disease label to EFO term, via `MONDO_MAP_EFO`

Params

{'disease_label': typing.Union[str, NoneType],
 'efo_term': typing.Union[str, NoneType],
 'fuzzy': <class 'bool'>}
1. Query

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/ontology/disease-efo'
 params = {'disease_label': 'leukemia', 'efo_term': 'leukemia'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (disease:Disease)-[r:MONDO_MAP_EFO]-(efo:Efo) '
                        'WHERE disease.label =~ "(?i).*leukemia.*" AND '
                        'efo.value =~ "(?i).*leukemia.*" RETURN disease {.id, '
                        '.label}, efo {.type, .value, .id}',
               'total_seconds': 0.146678},
  'results': [{'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0010643',
                           'label': 'acute leukemia (disease)'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_1000068',
                       'type': 'typed-literal',
                       'value': 'Acute Leukemia'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0011996',
                           'label': 'chronic myelogenous leukemia, BCR-ABL1 '
                                    'positive'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0000339',
                       'type': 'typed-literal',
                       'value': 'chronic myelogenous leukemia'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0004948',
                           'label': 'B-cell chronic lymphocytic leukemia'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0000095',
                       'type': 'typed-literal',
                       'value': 'chronic lymphocytic leukemia'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0004947',
                           'label': 'B-cell acute lymphoblastic leukemia'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0000094',
                       'type': 'typed-literal',
                       'value': 'B-cell acute lymphoblastic leukemia'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0004967',
                           'label': 'acute lymphoblastic leukemia (disease)'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0000220',
                       'type': 'typed-literal',
                       'value': 'acute lymphoblastic leukemia'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0004963',
                           'label': 'T-cell acute lymphoblastic leukemia'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0000209',
                       'type': 'typed-literal',
                       'value': 'T-cell acute lympho

GET /ontology/gwas-efo-disease

  Map Gwas trait to Disease label, via Efo term.

Params

{'disease_label': typing.Union[str, NoneType],
 'efo_term': typing.Union[str, NoneType],
 'fuzzy': <class 'bool'>,
 'score_threshold': <class 'float'>,
 'trait': typing.Union[str, NoneType]}
1. By trait and disease_label

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/ontology/gwas-efo-disease'
 params = {'trait': 'infectious disease', 'disease_label': 'infectious disease', 'score_threshold': 0.7}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (gwas:Gwas)-[ge:GWAS_NLP_EFO]-(efo:Efo) '
                        '-[ed:MONDO_MAP_EFO]-(disease:Disease) WHERE ge.score > '
                        '0.7 AND gwas.trait =~ "(?i).*infectious disease.*" AND '
                        'disease.label =~ "(?i).*infectious disease.*" RETURN '
                        'gwas {.id, .trait}, ge {.score}, efo {.type, .value, '
                        '.id}, disease {.id, .label}',
               'total_seconds': 0.143108},
  'results': [{'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0005940',
                           'label': 'respirovirus infectious disease'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0007465',
                       'type': 'typed-literal',
                       'value': 'Respirovirus infectious disease'},
               'ge': {'score': 0.743891716003418},
               'gwas': {'id': 'ukb-b-7375',
                        'trait': 'Main speciality of consultant (recoded): '
                                 'Infectious diseases'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0005949',
                           'label': 'roseolovirus infectious disease'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0007474',
                       'type': 'typed-literal',
                       'value': 'Roseolovirus infectious disease'},
               'ge': {'score': 0.740414023399353},
               'gwas': {'id': 'ukb-b-7375',
                        'trait': 'Main speciality of consultant (recoded): '
                                 'Infectious diseases'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0005876',
                           'label': 'Nidovirales infectious disease'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0007396',
                       'type': 'typed-literal',
                       'value': 'Nidovirales infectious disease'},
               'ge': {'score': 0.7003502249717712},
               'gwas': {'id': 'ukb-b-7375',
                        'trait': 'Main speciality of consultant (recoded): '
                                 'Infectious diseases'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0005786',
                           'label': 'Hepadnaviridae infectious disease'},
               'efo': {'id': 'http://www.ebi.a
2. By trait and efo_term

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/ontology/gwas-efo-disease'
 params = {'trait': 'insomnia', 'efo_term': 'insomnia', 'score_threshold': 0.7}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (gwas:Gwas)-[ge:GWAS_NLP_EFO]-(efo:Efo) '
                        '-[ed:MONDO_MAP_EFO]-(disease:Disease) WHERE ge.score > '
                        '0.7 AND gwas.trait =~ "(?i).*insomnia.*" AND efo.value '
                        '=~ "(?i).*insomnia.*" RETURN gwas {.id, .trait}, ge '
                        '{.score}, efo {.type, .value, .id}, disease {.id, '
                        '.label}',
               'total_seconds': 0.106077},
  'results': [{'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0013600',
                           'label': 'insomnia (disease)'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004698',
                       'type': 'typed-literal',
                       'value': 'insomnia'},
               'ge': {'score': 0.8038048148155212},
               'gwas': {'id': 'ebi-a-GCST006488',
                        'trait': 'Insomnia complaints'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0013600',
                           'label': 'insomnia (disease)'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004698',
                       'type': 'typed-literal',
                       'value': 'insomnia'},
               'ge': {'score': 0.8038048148155212},
               'gwas': {'id': 'ebi-a-GCST006487',
                        'trait': 'Insomnia complaints'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0013600',
                           'label': 'insomnia (disease)'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004698',
                       'type': 'typed-literal',
                       'value': 'insomnia'},
               'ge': {'score': 0.929945170879364},
               'gwas': {'id': 'ukb-a-13', 'trait': 'Sleeplessness / insomnia'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0013600',
                           'label': 'insomnia (disease)'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004698',
                       'type': 'typed-literal',
                       'value': 'insomnia'},
               'ge': {'score': 0.929945170879364},
               'gwas': {'id': 'ukb-b-3957',
                        'trait': 'Sleeplessness / insomnia'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0013600',
                           'labe
3. By efo_term and disease_label

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/ontology/gwas-efo-disease'
 params = {'efo_term': 'insomnia', 'disease_label': 'insomnia', 'score_threshold': 0.7}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (gwas:Gwas)-[ge:GWAS_NLP_EFO]-(efo:Efo) '
                        '-[ed:MONDO_MAP_EFO]-(disease:Disease) WHERE ge.score > '
                        '0.7 AND efo.value =~ "(?i).*insomnia.*" AND '
                        'disease.label =~ "(?i).*insomnia.*" RETURN gwas {.id, '
                        '.trait}, ge {.score}, efo {.type, .value, .id}, '
                        'disease {.id, .label}',
               'total_seconds': 0.14759},
  'results': [{'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0013600',
                           'label': 'insomnia (disease)'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004698',
                       'type': 'typed-literal',
                       'value': 'insomnia'},
               'ge': {'score': 0.8038048148155212},
               'gwas': {'id': 'ebi-a-GCST006488',
                        'trait': 'Insomnia complaints'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0013600',
                           'label': 'insomnia (disease)'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004698',
                       'type': 'typed-literal',
                       'value': 'insomnia'},
               'ge': {'score': 0.8038048148155212},
               'gwas': {'id': 'ebi-a-GCST006487',
                        'trait': 'Insomnia complaints'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0013600',
                           'label': 'insomnia (disease)'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004698',
                       'type': 'typed-literal',
                       'value': 'insomnia'},
               'ge': {'score': 0.929945170879364},
               'gwas': {'id': 'ukb-a-13', 'trait': 'Sleeplessness / insomnia'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0013600',
                           'label': 'insomnia (disease)'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004698',
                       'type': 'typed-literal',
                       'value': 'insomnia'},
               'ge': {'score': 0.929945170879364},
               'gwas': {'id': 'ukb-b-3957',
                        'trait': 'Sleeplessness / insomnia'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0013600',
                           'la

GET /literature/gene

  For a gene, search for its literature evidence
  related to a semmed object

Params

{'gene_name': <class 'str'>, 'object_name': <class 'str'>}
1. Query

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/literature/gene'
 params = {'gene_name': 'IL23R', 'object_name': 'Inflammatory bowel disease'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH '
                        '(gene:Gene)-[:SEM_GENE]-(:SemmedTerm)-[:SEM_SUB|SEM_OBJ]- '
                        '(st:SemmedTriple)-[:SEM_TO_LIT]-(l:Literature) WHERE '
                        "gene.name = 'IL23R' AND "
                        'st.object_name=~"(?i).*Inflammatory bowel disease.*" '
                        'RETURN gene {.name}, st {.predicate, .object_name}, '
                        'collect(l.pubmed_id) AS pubmed_id',
               'total_seconds': 0.089482},
  'results': [{'gene': {'name': 'IL23R'},
               'pubmed_id': ['17484863', '21155887'],
               'st': {'object_name': 'Inflammatory Bowel Diseases',
                      'predicate': 'NEG_ASSOCIATED_WITH'}},
              {'gene': {'name': 'IL23R'},
               'pubmed_id': ['27852544'],
               'st': {'object_name': 'Inflammatory Bowel Diseases',
                      'predicate': 'AFFECTS'}},
              {'gene': {'name': 'IL23R'},
               'pubmed_id': ['17484863',
                             '19575361',
                             '19496308',
                             '18383521',
                             '18341487',
                             '19817673',
                             '18088064',
                             '29248579',
                             '18047540',
                             '25159710',
                             '18383363',
                             '19175939',
                             '18698678',
                             '21155887',
                             '21846945',
                             '20067801',
                             '18368064',
                             '20393462',
                             '19747142',
                             '18164077',
                             '24280935'],
               'st': {'object_name': 'Inflammatory Bowel Diseases',
                      'predicate': 'ASSOCIATED_WITH'}},
              {'gene': {'name': 'IL23R'},
               'pubmed_id': ['23131344'],
               'st': {'object_name': 'Inflammatory Bowel Diseases',
                      'predicate': 'PREDISPOSES'}}]}

GET /literature/gwas

  Search for literature evidence of a Gwas trait via semmed.
  
  - `semmed_triple_id`: search for a specific semmed triple id,
    e.g. "ghrelin:INHIBITS:Leptin"
  - `semmed_predicates`: list of predicates for **whitelist**
  - `by_gwas_id`: False. If True search by Gwas.id
  - `fuzzy`: True. By default fuzzy match trait name.
  - `skip`: pagination

Params

{'by_gwas_id': <class 'bool'>,
 'fuzzy': <class 'bool'>,
 'gwas_id': typing.Union[str, NoneType],
 'limit': <class 'int'>,
 'pval_threshold': <class 'float'>,
 'semmed_predicates': typing.List[str],
 'semmed_triple_id': typing.Union[str, NoneType],
 'skip': <class 'int'>,
 'trait': typing.Union[str, NoneType]}
1. Search by trait name

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/literature/gwas'
 params = {'trait': 'Sleep duration', 'fuzzy': False}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (gwas:Gwas)-[gs:GWAS_SEM]->(triple:SemmedTriple) '
                        '-[sl:SEM_TO_LIT]->(lit:Literature) WHERE gwas.trait = '
                        '"Sleep duration" AND gs.pval < 0.001 WITH gwas, '
                        'triple, lit, gs MATCH (gwas)-[gl:GWAS_TO_LIT]-(lit) '
                        'RETURN gwas {.id, .trait}, gs {.pval, .localCount}, '
                        'triple {.id, .subject_name, .object_name, .predicate}, '
                        'lit {.pubmed_id} SKIP 0 LIMIT 50',
               'total_seconds': 0.134701},
  'results': [{'gs': {'localCount': 6, 'pval': 6.527168975938805e-15},
               'gwas': {'id': 'ukb-b-4424', 'trait': 'Sleep duration'},
               'lit': {'pubmed_id': '28923293'},
               'triple': {'id': 'Parkinson Disease:COEXISTS_WITH:REM Sleep '
                                'Behavior Disorder',
                          'object_name': 'REM Sleep Behavior Disorder',
                          'predicate': 'COEXISTS_WITH',
                          'subject_name': 'Parkinson Disease'}},
              {'gs': {'localCount': 6, 'pval': 6.527168975938805e-15},
               'gwas': {'id': 'ukb-b-4424', 'trait': 'Sleep duration'},
               'lit': {'pubmed_id': '23963783'},
               'triple': {'id': 'Parkinson Disease:COEXISTS_WITH:REM Sleep '
                                'Behavior Disorder',
                          'object_name': 'REM Sleep Behavior Disorder',
                          'predicate': 'COEXISTS_WITH',
                          'subject_name': 'Parkinson Disease'}},
              {'gs': {'localCount': 6, 'pval': 6.527168975938805e-15},
               'gwas': {'id': 'ukb-b-4424', 'trait': 'Sleep duration'},
               'lit': {'pubmed_id': '18682443'},
               'triple': {'id': 'Parkinson Disease:COEXISTS_WITH:REM Sleep '
                                'Behavior Disorder',
                          'object_name': 'REM Sleep Behavior Disorder',
                          'predicate': 'COEXISTS_WITH',
                          'subject_name': 'Parkinson Disease'}},
              {'gs': {'localCount': 6, 'pval': 6.527168975938805e-15},
               'gwas': {'id': 'ukb-b-4424', 'trait': 'Sleep duration'},
               'lit': {'pubmed_id': '16043794'},
               'triple': {'id': 'Parkinson Disease:COEXISTS_WITH:REM Sleep '
2. Search by id

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/literature/gwas'
 params = {'gwas_id': 'ieu-a-1088', 'by_gwas_id': True}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (gwas:Gwas)-[gs:GWAS_SEM]->(triple:SemmedTriple) '
                        '-[sl:SEM_TO_LIT]->(lit:Literature) WHERE gwas.id = '
                        '"ieu-a-1088" AND gs.pval < 0.001 WITH gwas, triple, '
                        'lit, gs MATCH (gwas)-[gl:GWAS_TO_LIT]-(lit) RETURN '
                        'gwas {.id, .trait}, gs {.pval, .localCount}, triple '
                        '{.id, .subject_name, .object_name, .predicate}, lit '
                        '{.pubmed_id} SKIP 0 LIMIT 50',
               'total_seconds': 0.159711},
  'results': [{'gs': {'localCount': 2, 'pval': 7.85111933510052e-06},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'pubmed_id': '10930561'},
               'triple': {'id': 'Caffeine:INTERACTS_WITH:Melatonin',
                          'object_name': 'Melatonin',
                          'predicate': 'INTERACTS_WITH',
                          'subject_name': 'Caffeine'}},
              {'gs': {'localCount': 6, 'pval': 2.4355837781168434e-14},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'pubmed_id': '28460563'},
               'triple': {'id': 'Melatonin:ASSOCIATED_WITH:Sleep Disorders',
                          'object_name': 'Sleep Disorders',
                          'predicate': 'ASSOCIATED_WITH',
                          'subject_name': 'Melatonin'}},
              {'gs': {'localCount': 6, 'pval': 2.4355837781168434e-14},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'pubmed_id': '10967921'},
               'triple': {'id': 'Melatonin:ASSOCIATED_WITH:Sleep Disorders',
                          'object_name': 'Sleep Disorders',
                          'predicate': 'ASSOCIATED_WITH',
                          'subject_name': 'Melatonin'}},
              {'gs': {'localCount': 6, 'pval': 2.4355837781168434e-14},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'pubmed_id': '17022876'},
               'triple': {'id': 'Melatonin:ASSOCIATED_WITH:Sleep Disorders',
                          'object_name': 'Sleep Disorders',
                          'predicate': 'ASSOCIATED_WITH',
                          'subject_name': 'Melatonin'}},
              {'gs': {'localCount': 6, 'pval': 2.43558377811684
3. Search by id and semmed triple id

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/literature/gwas'
 params = {'gwas_id': 'ieu-a-1088', 'semmed_triple_id': 'ghrelin:INHIBITS:Leptin', 'by_gwas_id': True}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (gwas:Gwas)-[gs:GWAS_SEM]->(triple:SemmedTriple) '
                        '-[sl:SEM_TO_LIT]->(lit:Literature) WHERE gwas.id = '
                        '"ieu-a-1088" AND triple.id = "ghrelin:INHIBITS:Leptin" '
                        'AND gs.pval < 0.001 WITH gwas, triple, lit, gs MATCH '
                        '(gwas)-[gl:GWAS_TO_LIT]-(lit) RETURN gwas {.id, '
                        '.trait}, gs {.pval, .localCount}, triple {.id, '
                        '.subject_name, .object_name, .predicate}, lit '
                        '{.pubmed_id} SKIP 0 LIMIT 50',
               'total_seconds': 0.095569},
  'results': [{'gs': {'localCount': 5, 'pval': 1.7678480207505842e-12},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'pubmed_id': '21659802'},
               'triple': {'id': 'ghrelin:INHIBITS:Leptin',
                          'object_name': 'Leptin',
                          'predicate': 'INHIBITS',
                          'subject_name': 'ghrelin'}},
              {'gs': {'localCount': 5, 'pval': 1.7678480207505842e-12},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'pubmed_id': '22473743'},
               'triple': {'id': 'ghrelin:INHIBITS:Leptin',
                          'object_name': 'Leptin',
                          'predicate': 'INHIBITS',
                          'subject_name': 'ghrelin'}},
              {'gs': {'localCount': 5, 'pval': 1.7678480207505842e-12},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'pubmed_id': '19955752'},
               'triple': {'id': 'ghrelin:INHIBITS:Leptin',
                          'object_name': 'Leptin',
                          'predicate': 'INHIBITS',
                          'subject_name': 'ghrelin'}},
              {'gs': {'localCount': 5, 'pval': 1.7678480207505842e-12},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'pubmed_id': '18719052'},
               'triple': {'id': 'ghrelin:INHIBITS:Leptin',
                          'object_name': 'Leptin',
                          'predicate': 'INHIBITS',
                          'subject_name': 'ghrelin'}},
              {'gs': {'localCount': 5, 'pval': 1.7678480207505842e-12},
               'gwas': {'id': 'ieu-a-1088', 'trait
4. Search by trait name and filter predicate

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/literature/gwas'
 params = {'trait': 'Sleep duration', 'semmed_predicates': ['COEXISTS_WITH', 'TREATS'], 'fuzzy': False}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (gwas:Gwas)-[gs:GWAS_SEM]->(triple:SemmedTriple) '
                        '-[sl:SEM_TO_LIT]->(lit:Literature) WHERE gwas.trait = '
                        '"Sleep duration" AND gs.pval < 0.001 AND '
                        "triple.predicate IN ['COEXISTS_WITH','TREATS'] WITH "
                        'gwas, triple, lit, gs MATCH '
                        '(gwas)-[gl:GWAS_TO_LIT]-(lit) RETURN gwas {.id, '
                        '.trait}, gs {.pval, .localCount}, triple {.id, '
                        '.subject_name, .object_name, .predicate}, lit '
                        '{.pubmed_id} SKIP 0 LIMIT 50',
               'total_seconds': 0.137427},
  'results': [{'gs': {'localCount': 6, 'pval': 6.527168975938805e-15},
               'gwas': {'id': 'ukb-b-4424', 'trait': 'Sleep duration'},
               'lit': {'pubmed_id': '28923293'},
               'triple': {'id': 'Parkinson Disease:COEXISTS_WITH:REM Sleep '
                                'Behavior Disorder',
                          'object_name': 'REM Sleep Behavior Disorder',
                          'predicate': 'COEXISTS_WITH',
                          'subject_name': 'Parkinson Disease'}},
              {'gs': {'localCount': 6, 'pval': 6.527168975938805e-15},
               'gwas': {'id': 'ukb-b-4424', 'trait': 'Sleep duration'},
               'lit': {'pubmed_id': '23963783'},
               'triple': {'id': 'Parkinson Disease:COEXISTS_WITH:REM Sleep '
                                'Behavior Disorder',
                          'object_name': 'REM Sleep Behavior Disorder',
                          'predicate': 'COEXISTS_WITH',
                          'subject_name': 'Parkinson Disease'}},
              {'gs': {'localCount': 6, 'pval': 6.527168975938805e-15},
               'gwas': {'id': 'ukb-b-4424', 'trait': 'Sleep duration'},
               'lit': {'pubmed_id': '18682443'},
               'triple': {'id': 'Parkinson Disease:COEXISTS_WITH:REM Sleep '
                                'Behavior Disorder',
                          'object_name': 'REM Sleep Behavior Disorder',
                          'predicate': 'COEXISTS_WITH',
                          'subject_name': 'Parkinson Disease'}},
              {'gs': {'localCount': 6, 'pval': 6.527168975938805e-15},
               'gwas': {'id': 'ukb-b-4424', 'trait': 'Sleep duration'},
               'lit': {'p

GET /literature/gwas/pairwise

  Return information of traits in a Subject-Predicate-Object
  association graph.
  
  Args:
  - `blacklist` (True) and `semmantic_types`: The list of
  [semmantic types](https://mmtx.nlm.nih.gov/MMTx/semanticTypes.shtml) to exclude (`blacklist`=True) or include (`blacklist`=False).
  Leave `semmantic_types` blank to disable this.
  - `by_gwas_id` (False): If True search by Gwas.id
  - `fuzzy` (True): By default fuzzy match trait name.

Params

{'assoc_gwas_id': typing.Union[str, NoneType],
 'assoc_trait': typing.Union[str, NoneType],
 'blacklist': <class 'bool'>,
 'by_gwas_id': <class 'bool'>,
 'fuzzy': <class 'bool'>,
 'gwas_id': typing.Union[str, NoneType],
 'limit': <class 'int'>,
 'pval_threshold': <class 'float'>,
 'semmantic_types': typing.List[str],
 'skip': <class 'int'>,
 'trait': typing.Union[str, NoneType]}
1. Search by trait name

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/literature/gwas/pairwise'
 params = {'trait': 'Sleep duration', 'assoc_trait': 'Coronary heart disease', 'pval_threshold': 0.1, 'blacklist': True, 'semmantic_types': ['nusq', 'dsyn'], 'limit': 10, 'fuzzy': True}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (gwas:Gwas)-[gs1:GWAS_SEM]->(s1:SemmedTriple) '
                        '-[:SEM_OBJ]->(st:SemmedTerm)<-[:SEM_SUB]- '
                        '(s2:SemmedTriple)<-[gs2:GWAS_SEM]-(assoc_gwas:Gwas) '
                        'WHERE gwas.trait =~ "(?i).*sleep duration.*" AND '
                        'assoc_gwas.trait =~ "(?i).*coronary heart disease.*" '
                        'AND gs1.pval < 0.1 AND gs2.pval < 0.1 AND NOT st.type '
                        "IN ['nusq','dsyn'] RETURN gwas {.id, .trait}, gs1 "
                        '{.pval, .localCount}, s1 {.id, .subject_name, '
                        '.object_name, .predicate}, st {.name, .type}, s2 {.id, '
                        '.subject_name, .object_name, .predicate}, gs2 {.pval, '
                        '.localCount}, assoc_gwas {.id, .trait} SKIP 0 LIMIT 10',
               'total_seconds': 0.132981},
  'results': [{'assoc_gwas': {'id': 'ieu-a-8',
                              'trait': 'Coronary heart disease'},
               'gs1': {'localCount': 2, 'pval': 2.8069468953617616e-06},
               'gs2': {'localCount': 3, 'pval': 8.329045522259548e-05},
               'gwas': {'id': 'ukb-b-4424', 'trait': 'Sleep duration'},
               's1': {'id': 'Delta Sleep-Inducing Peptide:STIMULATES:Melatonin',
                      'object_name': 'Melatonin',
                      'predicate': 'STIMULATES',
                      'subject_name': 'Delta Sleep-Inducing Peptide'},
               's2': {'id': 'Melatonin:ASSOCIATED_WITH:Acute coronary syndrome',
                      'object_name': 'Acute coronary syndrome',
                      'predicate': 'ASSOCIATED_WITH',
                      'subject_name': 'Melatonin'},
               'st': {'name': 'Melatonin', 'type': 'horm'}},
              {'assoc_gwas': {'id': 'ebi-a-GCST000998',
                              'trait': 'Coronary heart disease'},
               'gs1': {'localCount': 2, 'pval': 2.8069468953617616e-06},
               'gs2': {'localCount': 3, 'pval': 8.329045522259548e-05},
               'gwas': {'id': 'ukb-b-4424', 'trait': 'Sleep duration'},
               's1': {'id': 'Delta Sleep-Inducing Peptide:STIMULATES:Melatonin',
                      'object_name': 'Melatonin',
                      'predicate': 'STIMULATES',
                      'subject_name': 'Delta Sleep-Inducing Peptide'},
2. Search by Gwas.id

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/literature/gwas/pairwise'
 params = {'gwas_id': 'ieu-a-1088', 'assoc_gwas_id': 'ieu-a-6', 'by_gwas_id': True, 'pval_threshold': 0.1, 'blacklist': True, 'semmantic_types': ['nusq', 'dsyn'], 'limit': 10, 'fuzzy': False}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (gwas:Gwas)-[gs1:GWAS_SEM]->(s1:SemmedTriple) '
                        '-[:SEM_OBJ]->(st:SemmedTerm)<-[:SEM_SUB]- '
                        '(s2:SemmedTriple)<-[gs2:GWAS_SEM]-(assoc_gwas:Gwas) '
                        'WHERE gwas.id = "ieu-a-1088" AND assoc_gwas.id = '
                        '"ieu-a-6" AND gs1.pval < 0.1 AND gs2.pval < 0.1 AND '
                        "NOT st.type IN ['nusq','dsyn'] RETURN gwas {.id, "
                        '.trait}, gs1 {.pval, .localCount}, s1 {.id, '
                        '.subject_name, .object_name, .predicate}, st {.name, '
                        '.type}, s2 {.id, .subject_name, .object_name, '
                        '.predicate}, gs2 {.pval, .localCount}, assoc_gwas '
                        '{.id, .trait} SKIP 0 LIMIT 10',
               'total_seconds': 0.167148},
  'results': [{'assoc_gwas': {'id': 'ieu-a-6',
                              'trait': 'Coronary heart disease'},
               'gs1': {'localCount': 2, 'pval': 7.85111933510052e-06},
               'gs2': {'localCount': 3, 'pval': 8.329045522259548e-05},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               's1': {'id': 'Caffeine:INTERACTS_WITH:Melatonin',
                      'object_name': 'Melatonin',
                      'predicate': 'INTERACTS_WITH',
                      'subject_name': 'Caffeine'},
               's2': {'id': 'Melatonin:ASSOCIATED_WITH:Acute coronary syndrome',
                      'object_name': 'Acute coronary syndrome',
                      'predicate': 'ASSOCIATED_WITH',
                      'subject_name': 'Melatonin'},
               'st': {'name': 'Melatonin', 'type': 'horm'}},
              {'assoc_gwas': {'id': 'ieu-a-6',
                              'trait': 'Coronary heart disease'},
               'gs1': {'localCount': 2, 'pval': 7.85111933510052e-06},
               'gs2': {'localCount': 2, 'pval': 0.010943863540887833},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               's1': {'id': 'Caffeine:INTERACTS_WITH:Melatonin',
                      'object_name': 'Melatonin',
                      'predicate': 'INTERACTS_WITH',
                      'subject_name': 'Caffeine'},
               's2': {'id': 'Melatonin:ASSOCIATED_WITH:Myocardial Infarction',
                      'object_name': 'Myocardial Infarct
3. Whitelist semmantic types

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/literature/gwas/pairwise'
 params = {'gwas_id': 'ieu-a-1088', 'assoc_gwas_id': 'ieu-a-6', 'by_gwas_id': True, 'pval_threshold': 0.1, 'blacklist': False, 'semmantic_types': ['aapp', 'orch'], 'limit': 10, 'fuzzy': False}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (gwas:Gwas)-[gs1:GWAS_SEM]->(s1:SemmedTriple) '
                        '-[:SEM_OBJ]->(st:SemmedTerm)<-[:SEM_SUB]- '
                        '(s2:SemmedTriple)<-[gs2:GWAS_SEM]-(assoc_gwas:Gwas) '
                        'WHERE gwas.id = "ieu-a-1088" AND assoc_gwas.id = '
                        '"ieu-a-6" AND gs1.pval < 0.1 AND gs2.pval < 0.1 AND '
                        "st.type IN ['aapp','orch'] RETURN gwas {.id, .trait}, "
                        'gs1 {.pval, .localCount}, s1 {.id, .subject_name, '
                        '.object_name, .predicate}, st {.name, .type}, s2 {.id, '
                        '.subject_name, .object_name, .predicate}, gs2 {.pval, '
                        '.localCount}, assoc_gwas {.id, .trait} SKIP 0 LIMIT 10',
               'total_seconds': 0.126304},
  'results': [{'assoc_gwas': {'id': 'ieu-a-6',
                              'trait': 'Coronary heart disease'},
               'gs1': {'localCount': 2, 'pval': 1.6847636743477779e-06},
               'gs2': {'localCount': 2, 'pval': 0.0015573323471471667},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               's1': {'id': 'Aspirin:INHIBITS:Oral anticoagulants',
                      'object_name': 'Oral anticoagulants',
                      'predicate': 'INHIBITS',
                      'subject_name': 'Aspirin'},
               's2': {'id': 'Oral anticoagulants:INHIBITS:Platelet Glycoprotein '
                            'GPIIb-IIIa Complex',
                      'object_name': 'Platelet Glycoprotein GPIIb-IIIa Complex',
                      'predicate': 'INHIBITS',
                      'subject_name': 'Oral anticoagulants'},
               'st': {'name': 'Oral anticoagulants', 'type': 'orch'}},
              {'assoc_gwas': {'id': 'ieu-a-6',
                              'trait': 'Coronary heart disease'},
               'gs1': {'localCount': 2, 'pval': 1.6847636743477779e-06},
               'gs2': {'localCount': 2, 'pval': 0.0015573323471471667},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               's1': {'id': 'Aspirin:INHIBITS:Oral anticoagulants',
                      'object_name': 'Oral anticoagulants',
                      'predicate': 'INHIBITS',
                      'subject_name': 'Aspirin'},
               's2': {'id': 'Oral anticoagulants:COEXISTS_WITH:clop

GET /pqtl/

  Returns the MR and other results related to pQTL
  
      - `query`: Protein or trait name e.g., ADAM19 or Inflammatory bowel disease
      - `rtype`: Results type
        - "simple": Basic summary,
        - "mrres": MR results,
        - "sglmr": Single SNP MR results,
        - "inst": SNP information,
        - "sense": Sensitivity analysis,
      - pvalue: MR pvalue threshold
      - searchflag:
        - "proteins": Searches for a protein e.g., if query=ADAM19
        - "traits": Searches for a specific trait e.g.,
          if query=Inflammatory bowel disease

Params

{'pvalue': <class 'float'>,
 'query': <class 'str'>,
 'rtype': <enum 'RtypeInput'>,
 'searchflag': <enum 'SearchflagInput'>}
1. Search protein

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/pqtl/'
 params = {'query': 'ADAM15', 'rtype': 'simple', 'searchflag': 'proteins'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (e:Exposure)<-[n:SENS_EXP]-(s)-[m:SENS_OUT]-> '
                        '(o:Outcome)<-[r:MR]-(e:Exposure)<-[i:INST_EXP]-() '
                        'WHERE e.expID = "ADAM15" AND r.pvalue < toFloat("0.5") '
                        'AND s.rs_ID = i.rs_ID RETURN DISTINCT s.expID AS '
                        'expID, s.outID AS outID, s.outID_mrbase AS '
                        'outID_mrbase, r.nsnp AS nsnp, r.pvalue AS pvalue, '
                        's.rs_ID AS rsID, s.direction AS direction, '
                        's.steiger_pvalue AS steiger_pvalue, s.coloc_prob AS '
                        'coloc_prob, r.beta AS beta, r.method AS method, '
                        'i.trans_cis AS trans_cis, toFloat(r.mr_hetero_pvalue) '
                        'AS q_pvalue, s.ld_score AS ld_check, r.se AS se ORDER '
                        'BY pvalue, outID;',
               'total_seconds': None},
  'results': [{'beta': -0.243289811709403,
               'coloc_prob': None,
               'direction': 'NA',
               'expID': 'ADAM15',
               'ld_check': None,
               'method': 'Wald ratio',
               'nsnp': 1,
               'outID': 'Non-cancer illness code  self-reported: high '
                        'cholesterol',
               'outID_mrbase': 'UKB-a:108',
               'pvalue': 3.74006279226831e-06,
               'q_pvalue': None,
               'rsID': 'rs7949566',
               'se': 0.0525994735936868,
               'steiger_pvalue': None,
               'trans_cis': 'trans'},
              {'beta': 0.0510281875,
               'coloc_prob': None,
               'direction': 'NA',
               'expID': 'ADAM15',
               'ld_check': None,
               'method': 'Wald ratio',
               'nsnp': 1,
               'outID': 'Forced expiratory volume in 1-second (FEV1)',
               'outID_mrbase': 'UKB-a:337',
               'pvalue': 0.00010395449708144,
               'q_pvalue': None,
               'rsID': 'rs7949566',
               'se': 0.013147625,
               'steiger_pvalue': None,
               'trans_cis': 'trans'},
              {'beta': 0.0444993125,
               'coloc_prob': None,
               'direction': 'NA',
               'expID': 'ADAM15',
               'ld_check': None,
               'method': 'Wald ratio',
               'nsnp': 1,
               'outID': 'Forced v
2. Search trait

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/pqtl/'
 params = {'query': 'Coronary heart disease', 'rtype': 'simple', 'searchflag': 'traits'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH '
                        '(o:Outcome)<-[n:SENS_OUT]-(s)-[m:SENS_EXP]->(e:Exposure)-[r:MR]-> '
                        '(o:Outcome)<-[INST_OUT]-()-[i:INST_EXP]->() WHERE '
                        'o.outID = "Coronary heart disease" AND r.pvalue < '
                        'toFloat("0.5") AND s.rs_ID = i.rs_ID AND s.expID = '
                        'i.expID RETURN DISTINCT s.expID AS expID, s.outID AS '
                        'outID, s.outID_mrbase AS outID_mrbase, r.nsnp AS nsnp, '
                        'r.pvalue AS pvalue, s.rs_ID AS rsID, s.direction AS '
                        'direction, s.steiger_pvalue AS steiger_pvalue, '
                        's.coloc_prob AS coloc_prob, r.beta AS beta, r.method '
                        'AS method, i.trans_cis AS trans_cis, '
                        'toFloat(r.mr_hetero_pvalue) AS q_pvalue, s.ld_score AS '
                        'ld_check, r.se AS se ORDER BY pvalue, expID;',
               'total_seconds': None},
  'results': [{'beta': 0.252303585657371,
               'coloc_prob': None,
               'direction': 'TRUE',
               'expID': 'LPA',
               'ld_check': 1.0,
               'method': 'Wald ratio',
               'nsnp': 1,
               'outID': 'Coronary heart disease',
               'outID_mrbase': '7',
               'pvalue': 5.38664852468177e-39,
               'q_pvalue': None,
               'rsID': 'rs55730499',
               'se': 0.0193149800796813,
               'steiger_pvalue': 0.0,
               'trans_cis': 'cis'},
              {'beta': 0.554633333333333,
               'coloc_prob': None,
               'direction': 'TRUE',
               'expID': 'B2M',
               'ld_check': 0.8514,
               'method': 'Wald ratio',
               'nsnp': 1,
               'outID': 'Coronary heart disease',
               'outID_mrbase': '7',
               'pvalue': 2.68751026338001e-10,
               'q_pvalue': None,
               'rsID': 'rs10774625',
               'se': 0.0878166666666667,
               'steiger_pvalue': 5.34156745501946e-08,
               'trans_cis': 'trans'},
              {'beta': 0.344278820375335,
               'coloc_prob': 0.9850814995,
               'direction': 'TRUE',
               'expID': 'VCAM1',
               'ld_check': None,
               'method': 'Wald ratio',
               'nsnp': 1,

GET /pqtl/pleio/

  Returns the number or the list of associated proteins in the database
  
      - `rsid`: SNP rs_ID e.g., rs1260326
      - `prflag`:
        - "count"
        - "proteins"

Params

{'prflag': <enum 'PrflagInput'>, 'rsid': <class 'str'>}
1. Query

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/pqtl/pleio/'
 params = {'rsid': 'rs1260326', 'prflag': 'proteins'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (i:Instruments)-[INST_EXP]->(e:Exposure) WHERE '
                        'i.rs_ID = "rs1260326" RETURN DISTINCT e.expID AS '
                        'expID;',
               'total_seconds': None},
  'results': [{'expID': 'FST'}, {'expID': 'SAA1'}, {'expID': 'KLKB1'}]}

GET /pqtl/list/

  Returns either the list of all proteins or traits in the database
  
      "searchable_entities": {"flag": "Search for 'outcomes' or 'exposures'"}

Params

{'flag': <enum 'ListFlagInput'>}
1. List outcomes

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/pqtl/list/'
 params = {'flag': 'outcomes'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'match (o:Outcome) return distinct o.outID as outID;',
               'total_seconds': None},
  'results': [{'outID': 'Cancer code  self-reported: basal cell carcinoma'},
              {'outID': 'Cancer code  self-reported: malignant melanoma'},
              {'outID': 'Cancer code  self-reported: small intestine or small '
                        'bowel cancer'},
              {'outID': 'Breast cancer (Combined Oncoarray; iCOGS; GWAS meta '
                        'analysis)'},
              {'outID': 'Serum creatinine (eGFRcrea)'},
              {'outID': 'Serum cystatin C (eGFRcys)'},
              {'outID': 'Eye problems or disorders: Cataract'},
              {'outID': 'Eye problems or disorders: Diabetes related eye '
                        'disease'},
              {'outID': 'Eye problems or disorders: Glaucoma'},
              {'outID': 'Eye problems or disorders: Injury or trauma resulting '
                        'in loss of vision'},
              {'outID': 'Hearing difficulty or problems: Yes'},
              {'outID': 'Subjective well being'},
              {'outID': 'Femoral neck bone mineral density'},
              {'outID': 'Lumbar spine bone mineral density'},
              {'outID': 'ER-positive Breast cancer (Combined Oncoarray; iCOGS; '
                        'GWAS meta analysis)'},
              {'outID': 'ER-negative Breast cancer (Combined Oncoarray; iCOGS; '
                        'GWAS meta analysis)'},
              {'outID': 'Endometrioid ovarian cancer'},
              {'outID': 'Forced vital capacity (FVC)'},
              {'outID': 'Red blood cell count'},
              {'outID': 'Primary sclerosing cholangitis '},
              {'outID': 'Non-cancer illness code  self-reported: ankylosing '
                        'spondylitis'},
              {'outID': 'Non-cancer illness code  self-reported: anxiety or '
                        'panic attacks'},
              {'outID': 'Non-cancer illness code  self-reported: arthritis '
                        '(nos)'},
              {'outID': 'Non-cancer illness code  self-reported: asthma'},
              {'outID': 'Non-cancer illness code  self-reported: bladder '
                        'problem (not cancer)'},
              {'outID': 'Non-cancer illness code  self-reported: bone disorder'},
              {'outID': 'Non-cancer illness code  self-reported: chro
2. List exposures

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/pqtl/list/'
 params = {'flag': 'exposures'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'match (e:Exposure) return distinct e.expID as expID;',
               'total_seconds': None},
  'results': [{'expID': 'A1CF'},
              {'expID': 'ACP1'},
              {'expID': 'ACP2'},
              {'expID': 'ACP5'},
              {'expID': 'ADA2'},
              {'expID': 'ADAM15'},
              {'expID': 'ADAM23'},
              {'expID': 'ADAMTS13'},
              {'expID': 'ADAMTS5'},
              {'expID': 'ADGRE2'},
              {'expID': 'AFM'},
              {'expID': 'AGER'},
              {'expID': 'AGRP'},
              {'expID': 'AGT'},
              {'expID': 'AHSG'},
              {'expID': 'AIFM1'},
              {'expID': 'AKR1A1'},
              {'expID': 'AKR1B1'},
              {'expID': 'AKR1C1'},
              {'expID': 'ALCAM'},
              {'expID': 'ALDH3A1'},
              {'expID': 'AMBP'},
              {'expID': 'AMH'},
              {'expID': 'AMY1A'},
              {'expID': 'ANG'},
              {'expID': 'ANGPTL1'},
              {'expID': 'ANGPTL3'},
              {'expID': 'ANXA1'},
              {'expID': 'ANXA2'},
              {'expID': 'APCS'},
              {'expID': 'APMAP'},
              {'expID': 'APOA5'},
              {'expID': 'ARFIP1'},
              {'expID': 'ARHGEF10'},
              {'expID': 'ART3'},
              {'expID': 'ART4'},
              {'expID': 'ASAH2;ASAH2B'},
              {'expID': 'ASMTL'},
              {'expID': 'ASPH'},
              {'expID': 'ASPN'},
              {'expID': 'ATF6'},
              {'expID': 'ATP1B2'},
              {'expID': 'ATP2A3'},
              {'expID': 'ATP4B'},
              {'expID': 'B2M'},
              {'expID': 'B3GAT3'},
              {'expID': 'B3GNT2'},
              {'expID': 'B4GALT1'},
              {'expID': 'B4GALT2'},
              {'expID': 'B4GAT1'},
              {'expID': 'BCAR3'},
              {'expID': 'BCL10'},
              {'expID': 'BGLAP'},
              {'expID': 'BMP6'},
              {'expID': 'BPI'},
              {'expID': 'BPIFB1'},
              {'expID': 'BST1'},
              {'expID': 'C10orf10'},
              {'expID': 'C17orf78'},
              {'expID': 'C1QTNF5'},
              {'expID': 'C1S'},
              {'expID': 'C6orf89'},
              {'expID': 'C7'},
              {'expID': 'C8A;C8B;C8G'},
              {'expID': 'C8orf33'},
              {'expID': 'CA10'},
              {'expID': 'CA13'},
              {

GET /covid-19/ctda/list/{entity}

  List entities

Params

{'entity': <enum 'CovidXqtlList'>}
1. List exposure genes

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/covid-19/ctda/list/gene'
 params = None
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False, 'query': None, 'total_seconds': None},
  'results': [{'id': 'ENSG00000204435', 'name': 'CSNK2B'},
              {'id': 'ENSG00000095303', 'name': 'PTGS1'},
              {'id': 'ENSG00000126001', 'name': 'CEP250'},
              {'id': 'ENSG00000075413', 'name': 'MARK3'},
              {'id': 'ENSG00000096968', 'name': 'JAK2'},
              {'id': 'ENSG00000198056', 'name': 'PRIM1'},
              {'id': 'ENSG00000163820', 'name': 'FYCO1'},
              {'id': 'ENSG00000233276', 'name': 'GPX1'},
              {'id': 'ENSG00000172992', 'name': 'DCAKD'},
              {'id': 'ENSG00000109501', 'name': 'WFS1'},
              {'id': 'ENSG00000135930', 'name': 'EIF4E2'},
              {'id': 'ENSG00000077348', 'name': 'EXOSC5'},
              {'id': 'ENSG00000102967', 'name': 'DHODH'},
              {'id': 'ENSG00000132842', 'name': 'AP3B1'},
              {'id': 'ENSG00000137806', 'name': 'NDUFAF1'},
              {'id': 'ENSG00000165661', 'name': 'QSOX2'},
              {'id': 'ENSG00000138829', 'name': 'FBN2'},
              {'id': 'ENSG00000166170', 'name': 'BAG5'},
              {'id': 'ENSG00000135506', 'name': 'OS9'},
              {'id': 'ENSG00000090621', 'name': 'PABPC4'},
              {'id': 'ENSG00000082781', 'name': 'ITGB5'},
              {'id': 'ENSG00000169972', 'name': 'PUSL1'},
              {'id': 'ENSG00000072274', 'name': 'TFRC'},
              {'id': 'ENSG00000136485', 'name': 'DCAF7'},
              {'id': 'ENSG00000104388', 'name': 'RAB2A'},
              {'id': 'ENSG00000155393', 'name': 'HEATR3'},
              {'id': 'ENSG00000115486', 'name': 'GGCX'},
              {'id': 'ENSG00000064763', 'name': 'FAR2'},
              {'id': 'ENSG00000011523', 'name': 'CEP68'},
              {'id': 'ENSG00000014138', 'name': 'POLA2'},
              {'id': 'ENSG00000114030', 'name': 'KPNA1'},
              {'id': 'ENSG00000163959', 'name': 'SLC51A'},
              {'id': 'ENSG00000007923', 'name': 'DNAJC11'},
              {'id': 'ENSG00000127948', 'name': 'POR'},
              {'id': 'ENSG00000204386', 'name': 'NEU1'},
              {'id': 'ENSG00000156599', 'name': 'ZDHHC5'},
              {'id': 'ENSG00000239732', 'name': 'TLR9'},
              {'id': 'ENSG00000149428', 'name': 'HYOU1'},
              {'id': 'ENSG00000164008', 'name': 'C1orf50'},
              {'id': 'ENSG00000116406', 'name': 'EDEM3'},
              {'id': 'ENSG00000163964', 'nam
2. List outcome gwas

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/covid-19/ctda/list/gwas'
 params = None
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False, 'query': None, 'total_seconds': None},
  'results': [{'id': '1058', 'name': 'Celiac disease'},
              {'id': '833', 'name': 'Rheumatoid arthritis'},
              {'id': 'SAIGE-557',
               'name': 'Intestinal malabsorption (non-celiac)'},
              {'id': '1025', 'name': 'Multiple sclerosis'},
              {'id': '89', 'name': 'Height'},
              {'id': '1112', 'name': 'Primary sclerosing cholangitis'},
              {'id': 'UKB-a:336', 'name': 'Forced vital capacity (FVC)'},
              {'id': 'UKB-b:19732',
               'name': 'Non-cancer illness code, self-reported: '
                       'hypothyroidism/myxoedema'},
              {'id': '1004', 'name': 'Age at menopause'},
              {'id': 'UKB-b:18194',
               'name': 'Non-cancer illness code, self-reported: ankylosing '
                       'spondylitis'},
              {'id': 'UKB-b:14177',
               'name': 'Vascular/heart problems diagnosed by doctor: High blood '
                       'pressure'},
              {'id': 'SAIGE-593', 'name': 'Hematuria'},
              {'id': '970', 'name': 'Ulcerative colitis'},
              {'id': 'UKB-b:18113',
               'name': 'Non-cancer illness code, self-reported: asthma'},
              {'id': 'UKB-b:6519', 'name': 'Worrier / anxious feelings'},
              {'id': 'UKB-a:249', 'name': 'Weight'},
              {'id': 'UKB-b:18275',
               'name': 'Hearing difficulty/problems with background noise'},
              {'id': 'UKB-b:20544', 'name': 'Nervous feelings'},
              {'id': 'UKB-a:360',
               'name': 'Systolic blood pressure  automated reading'},
              {'id': 'SAIGE-715', 'name': 'Other inflammatory spondylopathies'},
              {'id': '1008', 'name': 'Platelet count'},
              {'id': 'UKB-b:10912',
               'name': 'Non-cancer illness code, self-reported: high '
                       'cholesterol'},
              {'id': 'UKB-b:9981', 'name': 'Sensitivity / hurt feelings'},
              {'id': '282', 'name': 'Psoriasis'},
              {'id': 'UKB-a:580',
               'name': 'Diagnoses - main ICD10: R04 Haemorrhage from '
                       'respiratory passages'},
              {'id': '16', 'name': 'Childhood intelligence'},
              {'id': 'SAIGE-070.4', 'name': 'Chronic hepatitis'},
              {'id': 'UKB-b:17324', 'name': 'Eye problem
3. List tissues

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/covid-19/ctda/list/tissue'
 params = None
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False, 'query': None, 'total_seconds': None},
  'results': [{'name': 'Colon_Sigmoid'},
              {'name': 'Whole_blood'},
              {'name': 'Testis'},
              {'name': 'Stomach'},
              {'name': 'Lung'},
              {'name': 'Colon_Transverse'},
              {'name': 'Plasma'},
              {'name': 'Small_Intestine_Terminal_Ileum'},
              {'name': 'Kidney_Cortex'},
              {'name': 'Kidney_Glomerular'},
              {'name': 'Kidney_Tubulointerstitial'}]}

GET /covid-19/ctda/single-snp-mr/{entity}

  Single SNP MR

Params

{'entity': <enum 'CovidXqtlSingleSnpMrEntity'>,
 'pval_threshold': <class 'float'>,
 'q': typing.Union[str, NoneType]}
1. By exposure gene

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/covid-19/ctda/single-snp-mr/gene'
 params = {'q': 'ENSG00000102967'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False, 'query': None, 'total_seconds': None},
  'results': [{'SNP': 'rs7186207',
               'b': 0.205406736,
               'exposure_gene_name': 'DHODH',
               'exposure_id': 'ENSG00000102967',
               'outcome_id': '301',
               'outcome_trait': 'Total cholesterol',
               'p': 2.37e-14,
               'samplesize': 185717.1,
               'se': 0.026925977,
               'tissue': 'Lung',
               'xQTL': 'eQTL'},
              {'SNP': 'rs7186207',
               'b': 0.06979717,
               'exposure_gene_name': 'DHODH',
               'exposure_id': 'ENSG00000102967',
               'outcome_id': '301',
               'outcome_trait': 'Total cholesterol',
               'p': 2.37e-14,
               'samplesize': 185717.1,
               'se': 0.009149441999999999,
               'tissue': 'Testis',
               'xQTL': 'eQTL'},
              {'SNP': 'rs3213422',
               'b': 0.067614573,
               'exposure_gene_name': 'DHODH',
               'exposure_id': 'ENSG00000102967',
               'outcome_id': '301',
               'outcome_trait': 'Total cholesterol',
               'p': 7.07e-14,
               'samplesize': 170451.0,
               'se': 0.009031549,
               'tissue': 'Colon_Sigmoid',
               'xQTL': 'eQTL'},
              {'SNP': 'rs3213422',
               'b': 0.087059556,
               'exposure_gene_name': 'DHODH',
               'exposure_id': 'ENSG00000102967',
               'outcome_id': '301',
               'outcome_trait': 'Total cholesterol',
               'p': 7.07e-14,
               'samplesize': 170451.0,
               'se': 0.011628893999999999,
               'tissue': 'Colon_Transverse',
               'xQTL': 'eQTL'},
              {'SNP': 'rs3213422',
               'b': 0.104335773,
               'exposure_gene_name': 'DHODH',
               'exposure_id': 'ENSG00000102967',
               'outcome_id': '301',
               'outcome_trait': 'Total cholesterol',
               'p': 7.07e-14,
               'samplesize': 170451.0,
               'se': 0.013936546999999999,
               'tissue': 'Stomach',
               'xQTL': 'eQTL'},
              {'SNP': 'rs3213422',
               'b': 0.271522488,
               'exposure_gene_name': 'DHODH',
               'exposure_id': 'ENSG00000102967',
               'outcome_id': '301',
               'outcome_trait': '
2. By outcome gwas

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/covid-19/ctda/single-snp-mr/gwas'
 params = {'q': '7', 'pval_threshold': 0.01}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False, 'query': None, 'total_seconds': None},
  'results': [{'SNP': 'rs75143203',
               'b': -0.40230111,
               'exposure_gene_name': 'PTGS1',
               'exposure_id': 'ENSG00000095303',
               'outcome_id': '7',
               'outcome_trait': 'Coronary heart disease',
               'p': 0.004701989,
               'samplesize': 184305.0,
               'se': 0.142318238,
               'tissue': 'Whole_blood',
               'xQTL': 'eQTL'},
              {'SNP': 'rs2273703',
               'b': -0.081138410904698,
               'exposure_gene_name': 'MARK3',
               'exposure_id': 'ENSG00000075413',
               'outcome_id': '7',
               'outcome_trait': 'Coronary heart disease',
               'p': 0.00851448921892339,
               'samplesize': 184305.0,
               'se': 0.0308398887715727,
               'tissue': 'Colon_Transverse',
               'xQTL': 'eQTL'},
              {'SNP': 'rs704',
               'b': 0.063704366,
               'exposure_gene_name': 'JAK2',
               'exposure_id': 'ENSG00000096968',
               'outcome_id': '7',
               'outcome_trait': 'Coronary heart disease',
               'p': 0.00809804,
               'samplesize': 184305.0,
               'se': 0.024057952999999997,
               'tissue': 'Plasma',
               'xQTL': 'pQTL'},
              {'SNP': 'rs4855839',
               'b': -0.20039510483486603,
               'exposure_gene_name': 'GPX1',
               'exposure_id': 'ENSG00000233276',
               'outcome_id': '7',
               'outcome_trait': 'Coronary heart disease',
               'p': 0.000348838069844257,
               'samplesize': 184305.0,
               'se': 0.0560382700380748,
               'tissue': 'Colon_Transverse',
               'xQTL': 'eQTL'},
              {'SNP': 'rs10416743',
               'b': 0.281005897204525,
               'exposure_gene_name': 'EXOSC5',
               'exposure_id': 'ENSG00000077348',
               'outcome_id': '7',
               'outcome_trait': 'Coronary heart disease',
               'p': 0.00106793296194576,
               'samplesize': 184305.0,
               'se': 0.0858822564326926,
               'tissue': 'Lung',
               'xQTL': 'eQTL'},
              {'SNP': 'rs7186207',
               'b': 0.229155448,
               'exposure_gene_name': 'DHODH',
               'exposure_id': 'E
3. By tissue

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/covid-19/ctda/single-snp-mr/tissue'
 params = {'q': 'Lung'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False, 'query': None, 'total_seconds': None},
  'results': [{'SNP': 'rs7150141',
               'b': -0.167833129473753,
               'exposure_gene_name': 'MARK3',
               'exposure_id': 'ENSG00000075413',
               'outcome_id': 'UKB-a:500',
               'outcome_trait': 'Heel bone mineral density (BMD) T-score  '
                                'automated',
               'p': 5.95892942072884e-13,
               'samplesize': 194398.0,
               'se': 0.0233055650046683,
               'tissue': 'Lung',
               'xQTL': 'eQTL'},
              {'SNP': 'rs7150141',
               'b': -0.110348346566112,
               'exposure_gene_name': 'MARK3',
               'exposure_id': 'ENSG00000075413',
               'outcome_id': 'UKB-a:248',
               'outcome_trait': 'Body mass index (BMI)',
               'p': 8.552081799386999e-10,
               'samplesize': 336107.0,
               'se': 0.017988665889829,
               'tissue': 'Lung',
               'xQTL': 'eQTL'},
              {'SNP': 'rs7150141',
               'b': -0.339465618318829,
               'exposure_gene_name': 'MARK3',
               'exposure_id': 'ENSG00000075413',
               'outcome_id': '22',
               'outcome_trait': 'Schizophrenia',
               'p': 2.38420737056187e-05,
               'samplesize': 82315.0,
               'se': 0.0803375625149276,
               'tissue': 'Lung',
               'xQTL': 'eQTL'},
              {'SNP': 'rs7150141',
               'b': -0.39662147980342605,
               'exposure_gene_name': 'MARK3',
               'exposure_id': 'ENSG00000075413',
               'outcome_id': 'SAIGE-317',
               'outcome_trait': 'Alcohol-related disorders',
               'p': 4.32206723251463e-05,
               'samplesize': None,
               'se': 0.0969840844774802,
               'tissue': 'Lung',
               'xQTL': 'eQTL'},
              {'SNP': 'rs7150141',
               'b': -0.0277843479267843,
               'exposure_gene_name': 'MARK3',
               'exposure_id': 'ENSG00000075413',
               'outcome_id': 'UKB-b:14177',
               'outcome_trait': 'Vascular/heart problems diagnosed by doctor: '
                                'High blood pressure',
               'p': 4.56805562049628e-05,
               'samplesize': 461880.0,
               'se': 0.0068154117842900205,
               'tissue': 'Lung

GET /covid-19/ctda/multi-snp-mr/{entity}

  Multi SNP MR

Params

{'entity': <enum 'CovidXqtlMultiSnpMrEntity'>,
 'pval_threshold': <class 'float'>,
 'q': typing.Union[str, NoneType]}
1. By exposure gene

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/covid-19/ctda/multi-snp-mr/gene'
 params = {'q': 'ENSG00000102967'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False, 'query': None, 'total_seconds': None},
  'results': [{'b': 0.095030259,
               'exposure_gene_name': 'DHODH',
               'exposure_id': 'ENSG00000102967',
               'method': 'IVW',
               'outcome_id': '7',
               'outcome_trait': 'Coronary heart disease',
               'p': 0.00034289300000000004,
               'samplesize': 184305.0,
               'se': 0.026540807000000003,
               'tissue': 'Colon_Transverse',
               'xQTL': 'eQTL'},
              {'b': 0.100579717,
               'exposure_gene_name': 'DHODH',
               'exposure_id': 'ENSG00000102967',
               'method': 'IVW',
               'outcome_id': '798',
               'outcome_trait': 'Myocardial infarction',
               'p': 0.0006516790000000001,
               'samplesize': 171875.0,
               'se': 0.029502953,
               'tissue': 'Colon_Transverse',
               'xQTL': 'eQTL'}]}
2. By outcome gwas

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/covid-19/ctda/multi-snp-mr/gwas'
 params = {'q': '7', 'pval_threshold': 0.01}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False, 'query': None, 'total_seconds': None},
  'results': [{'b': 0.095030259,
               'exposure_gene_name': 'DHODH',
               'exposure_id': 'ENSG00000102967',
               'method': 'IVW',
               'outcome_id': '7',
               'outcome_trait': 'Coronary heart disease',
               'p': 0.00034289300000000004,
               'samplesize': 184305.0,
               'se': 0.026540807000000003,
               'tissue': 'Colon_Transverse',
               'xQTL': 'eQTL'}]}
3. By tissue

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/covid-19/ctda/multi-snp-mr/tissue'
 params = {'q': 'Lung'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False, 'query': None, 'total_seconds': None},
  'results': [{'b': -0.0515283199819485,
               'exposure_gene_name': 'DCAKD',
               'exposure_id': 'ENSG00000172992',
               'method': 'IVW',
               'outcome_id': 'UKB-a:360',
               'outcome_trait': 'Systolic blood pressure  automated reading',
               'p': 4.7688066457417e-09,
               'samplesize': 317754.0,
               'se': 0.008800670078142859,
               'tissue': 'Lung',
               'xQTL': 'eQTL'},
              {'b': -0.0340715341232658,
               'exposure_gene_name': 'DCAKD',
               'exposure_id': 'ENSG00000172992',
               'method': 'IVW',
               'outcome_id': 'UKB-a:359',
               'outcome_trait': 'Diastolic blood pressure  automated reading',
               'p': 5.41864181544449e-08,
               'samplesize': 317756.0,
               'se': 0.00626661035654878,
               'tissue': 'Lung',
               'xQTL': 'eQTL'},
              {'b': -0.00700797598617659,
               'exposure_gene_name': 'DCAKD',
               'exposure_id': 'ENSG00000172992',
               'method': 'IVW',
               'outcome_id': 'UKB-b:18113',
               'outcome_trait': 'Non-cancer illness code, self-reported: asthma',
               'p': 1.4273690003140198e-05,
               'samplesize': 462933.0,
               'se': 0.00161488675437382,
               'tissue': 'Lung',
               'xQTL': 'eQTL'},
              {'b': -0.007424694051918659,
               'exposure_gene_name': 'DCAKD',
               'exposure_id': 'ENSG00000172992',
               'method': 'IVW',
               'outcome_id': 'UKB-b:14486',
               'outcome_trait': 'Non-cancer illness code, self-reported: '
                                'osteoarthritis',
               'p': 0.000240802671540149,
               'samplesize': 462933.0,
               'se': 0.0020220590754309697,
               'tissue': 'Lung',
               'xQTL': 'eQTL'},
              {'b': 0.000706262189885184,
               'exposure_gene_name': 'DCAKD',
               'exposure_id': 'ENSG00000172992',
               'method': 'IVW',
               'outcome_id': 'UKB-b:15198',
               'outcome_trait': 'Non-cancer illness code, self-reported: '
                                'fibromyalgia',
               'p': 0.00026046667042737903,
               'samplesize': 4

Utility endpoints

GET /ping

  Test that you are connected to the API.

Params

{}
1. Default

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/ping'
 params = None
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 True

GET /meta/schema

  Schema of EpiGraphDB Graph.

Params

{'graphviz': <class 'bool'>,
 'overwrite': <class 'bool'>,
 'plot': <class 'bool'>}
1. Default

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/meta/schema'
 params = {'graphviz': False, 'plot': False}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'connections': [{'count': 2486,
                   'from_node': 'Drug',
                   'rel': 'OPENTARGETS_DRUG_TO_DISEASE',
                   'to_node': 'Disease'},
                  {'count': 3417,
                   'from_node': 'Disease',
                   'rel': 'MONDO_MAP_UMLS',
                   'to_node': 'SemmedTerm'},
                  {'count': 626,
                   'from_node': 'Protein',
                   'rel': 'PROTEIN_TO_DISEASE',
                   'to_node': 'Disease'},
                  {'count': 2822,
                   'from_node': 'Disease',
                   'rel': 'MONDO_MAP_EFO',
                   'to_node': 'Efo'},
                  {'count': 541,
                   'from_node': 'Pathway',
                   'rel': 'PATHWAY_TO_DISEASE',
                   'to_node': 'Disease'},
                  {'count': 42146,
                   'from_node': 'SemmedTerm',
                   'rel': 'SEM_GENE',
                   'to_node': 'Gene'},
                  {'count': 3461883,
                   'from_node': 'SemmedTriple',
                   'rel': 'SEM_SUB',
                   'to_node': 'SemmedTerm'},
                  {'count': 2082,
                   'from_node': 'Gwas',
                   'rel': 'METAMAP_LITE',
                   'to_node': 'SemmedTerm'},
                  {'count': 3461883,
                   'from_node': 'SemmedTerm',
                   'rel': 'SEM_PREDICATE',
                   'to_node': 'SemmedTerm'},
                  {'count': 3461883,
                   'from_node': 'SemmedTriple',
                   'rel': 'SEM_OBJ',
                   'to_node': 'SemmedTerm'},
                  {'count': 12488,
                   'from_node': 'Pathway',
                   'rel': 'EVENT_IN_PATHWAY',
                   'to_node': 'Event'},
                  {'count': 9955,
                   'from_node': 'Protein',
                   'rel': 'PROTEIN_IN_PATHWAY',
                   'to_node': 'Pathway'},
                  {'count': 8952,
                   'from_node': 'Pathway',
                   'rel': 'PATHWAY_TO_LITERATURE',
                   'to_node': 'Literature'},
                  {'count': 1451,
                   'from_node': 'Gene',
                   'rel': 'INTACT_INTERACTS_WITH_GENE_PROTEIN',
                   'to_node': 'Protein'},
                  {'count': 771,
                   'from_node': 'Gene',
                   'rel': 'GENE_TO_LITERATURE',
2. Graphviz format

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/meta/schema'
 params = {'graphviz': True, 'plot': False}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 ('digraph "EpiGraphDB schema" {\n'
  '\tgraph [rankdir=LR]\n'
  '\tnode [shape=record]\n'
  '\tDisease [label=< <B> Disease 21,829 </B>  | doid: LIST   | umls: LIST   | '
  'definition: STRING   | id: STRING indexed unique | label: STRING   | icd9: '
  'LIST   | mesh: LIST   | efo: LIST   | icd10: LIST   >]\n'
  '\tSemmedTerm [label=< <B> SemmedTerm 105,047 </B>  | name: STRING indexed '
  'unique | count: INTEGER   | id: STRING indexed unique | type: STRING   >]\n'
  '\tPathway [label=< <B> Pathway 2,180 </B>  | in_disease: STRING   | name: '
  'STRING   | reactome_id: STRING indexed unique >]\n'
  '\tGene [label=< <B> Gene 59,171 </B>  | druggability_tier: STRING indexed  | '
  'small_mol_druggable: STRING   | start: INTEGER   | description: STRING   | '
  'source: STRING   | ensembl_id: STRING indexed unique | chr: STRING indexed  '
  '| type: STRING   | bio_druggable: STRING   | reactome_id: STRING   | '
  'adme_gene: STRING   | name: STRING indexed  | end: INTEGER   >]\n'
  '\tGtex [label=< <B> Gtex 53 </B>  | tissue: STRING indexed unique >]\n'
  '\tLiterature [label=< <B> Literature 29,137,785 </B>  | pubmed_id: STRING '
  'indexed unique | issn: STRING   | dp: STRING   | edat: STRING   | year: '
  'INTEGER indexed  >]\n'
  '\tProtein [label=< <B> Protein 21,543 </B>  | uniprot_id: STRING indexed '
  'unique >]\n'
  '\tVariant [label=< <B> Variant 88,125 </B>  | name: STRING indexed unique '
  '>]\n'
  '\tSemmedTriple [label=< <B> SemmedTriple 3,461,883 </B>  | subject_id: '
  'STRING   | predicate: STRING   | subject_type: STRING   | object_type: '
  'STRING   | object_name: STRING   | subject_name: STRING   | count: INTEGER   '
  '| id: STRING indexed unique | object_id: STRING   >]\n'
  '\tEfo [label=< <B> Efo 25,390 </B>  | type: STRING   | value: STRING   | id: '
  'STRING indexed unique >]\n'
  '\tGwas [label=< <B> Gwas 31,773 </B>  | note: STRING   | ncase: STRING   | '
  'access: STRING   | year: STRING   | mr: STRING   | author: STRING   | '
  'consortium: STRING   | sex: STRING   | priority: STRING   | pmid: STRING   | '
  'population: STRING   | sd: STRING   | unit: STRING   | sample_size: STRING   '
  '| nsnp: STRING   | ncontrol: STRING   | trait: STRING indexed  | id: STRING '
  'indexed unique | subcategory: STRING   | category: STRING   >]\n'
  '\tDrug [label=< <B> Drug 2,455 </B>  | molecule_type: STRING   | label: '
  'STRING indexed  | source: LIST   | chembl_uri: STR

GET /meta/nodes/list

  List meta nodes

Params

{}
1. Query

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/meta/nodes/list'
 params = None
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 ['Gwas',
  'Disease',
  'Drug',
  'Efo',
  'Event',
  'Gene',
  'Tissue',
  'Literature',
  'Pathway',
  'Protein',
  'SemmedTerm',
  'Variant']

GET /meta/nodes/id-name-schema

  Show the current id / name schema for meta nodes.

Params

{}
1. Query

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/meta/nodes/id-name-schema'
 params = None
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'Disease': {'id': 'id', 'name': 'label'},
  'Drug': {'id': 'label', 'name': 'label'},
  'Efo': {'id': 'id', 'name': 'value'},
  'Event': {'id': 'reactome_id', 'name': 'name'},
  'Gene': {'id': 'ensembl_id', 'name': 'name'},
  'Gwas': {'id': 'id', 'name': 'trait'},
  'Literature': {'id': 'pubmed_id', 'name': 'pubmed_id'},
  'Pathway': {'id': 'reactome_id', 'name': 'name'},
  'Protein': {'id': 'uniprot_id', 'name': 'uniprot_id'},
  'SemmedTerm': {'id': 'id', 'name': 'name'},
  'Tissue': {'id': 'tissue', 'name': 'tissue'},
  'Variant': {'id': 'name', 'name': 'name'}}

GET /meta/rels/list

  List meta rels.

Params

{}
1. Query

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/meta/rels/list'
 params = None
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 ['BN_GEN_COR',
  'CPIC',
  'EFO_CHILD_OF',
  'EVENT_IN_PATHWAY',
  'EXPRESSED_IN',
  'GENE_TO_LITERATURE',
  'GENE_TO_PROTEIN',
  'GWAS_NLP',
  'GWAS_NLP_EFO',
  'GWAS_SEM',
  'GWAS_TO_LIT',
  'GWAS_TO_VARIANT',
  'INTACT_INTERACTS_WITH_GENE_GENE',
  'INTACT_INTERACTS_WITH_GENE_PROTEIN',
  'INTACT_INTERACTS_WITH_PROTEIN_PROTEIN',
  'INTACT_NOT_INTERACTS_WITH',
  'METAMAP_LITE',
  'MONDO_MAP_EFO',
  'MONDO_MAP_UMLS',
  'MR',
  'OBS_COR',
  'OPENTARGETS_DRUG_TO_DISEASE',
  'OPENTARGETS_DRUG_TO_TARGET',
  'PATHWAY_TO_DISEASE',
  'PATHWAY_TO_LITERATURE',
  'PRECEDING_EVENT',
  'PROTEIN_IN_EVENT',
  'PROTEIN_IN_PATHWAY',
  'PROTEIN_TO_DISEASE',
  'PROTEIN_TO_LITERATURE',
  'PRS',
  'SEM_GENE',
  'SEM_OBJ',
  'SEM_PREDICATE',
  'SEM_SUB',
  'SEM_TO_LIT',
  'STRING_INTERACT_WITH',
  'TOPHITS',
  'VARIANT_TO_GENE',
  'XQTL_MULTI_SNP_MR',
  'XQTL_SINGLE_SNP_MR_GENE_GWAS',
  'XQTL_SINGLE_SNP_MR_SNP_GENE']

GET /meta/nodes/{meta_node}/list

  List nodes under a meta node.
  
      - `limit`: If you supply full_data to be True, the limit is 500,
        otherwise the limit is 10,000
      - `full_data`: When False, only return the id and name fields for
        a node.
        For the specific id and name fields, refer to /meta/nodes/id-name-schema.

Params

{'full_data': <class 'bool'>,
 'limit': <class 'int'>,
 'meta_node': <enum 'EpigraphdbMetaNodesFull'>,
 'offset': <class 'int'>}
1. List Gwas nodes (only id and name)

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/meta/nodes/Gwas/list'
 params = {'full_data': False, 'limit': 5}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (n:Gwas) RETURN n.id AS id, n.trait AS name SKIP '
                        '0 LIMIT 5',
               'total_seconds': 0.09553},
  'results': [{'id': 'eqtl-a-ENSG00000261662', 'name': 'ENSG00000261662'},
              {'id': 'eqtl-a-ENSG00000160460', 'name': 'ENSG00000160460'},
              {'id': 'eqtl-a-ENSG00000205426', 'name': 'ENSG00000205426'},
              {'id': 'ieu-a-9', 'name': 'Coronary heart disease'},
              {'id': 'eqtl-a-ENSG00000003436', 'name': 'ENSG00000003436'}]}
2. List Gwas nodes (full data)

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/meta/nodes/Gwas/list'
 params = {'full_data': True, 'limit': 5}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (n:Gwas) RETURN n SKIP 0 LIMIT 5',
               'total_seconds': 0.093656},
  'results': [{'n': {'access': 'public',
                     'author': 'Vosa U',
                     'category': 'NA',
                     'consortium': 'NA',
                     'id': 'eqtl-a-ENSG00000261662',
                     'mr': '1',
                     'note': 'NA',
                     'nsnp': '14407',
                     'population': 'European',
                     'priority': '0',
                     'sample_size': '5502',
                     'sex': 'Males and Females',
                     'subcategory': 'NA',
                     'trait': 'ENSG00000261662',
                     'unit': 'NA',
                     'year': '2018'}},
              {'n': {'access': 'public',
                     'author': 'Vosa U',
                     'category': 'NA',
                     'consortium': 'NA',
                     'id': 'eqtl-a-ENSG00000160460',
                     'mr': '1',
                     'note': 'NA',
                     'nsnp': '18645',
                     'population': 'European',
                     'priority': '0',
                     'sample_size': '29896',
                     'sex': 'Males and Females',
                     'subcategory': 'NA',
                     'trait': 'ENSG00000160460',
                     'unit': 'NA',
                     'year': '2018'}},
              {'n': {'access': 'public',
                     'author': 'Vosa U',
                     'category': 'NA',
                     'consortium': 'NA',
                     'id': 'eqtl-a-ENSG00000205426',
                     'mr': '1',
                     'note': 'NA',
                     'nsnp': '19133',
                     'population': 'European',
                     'priority': '0',
                     'sample_size': '31684',
                     'sex': 'Males and Females',
                     'subcategory': 'NA',
                     'trait': 'ENSG00000205426',
                     'unit': 'NA',
                     'year': '2018'}},
              {'n': {'access': 'public',
                     'author': 'Deloukas',
                     'category': 'Disease',
                     'consortium': 'NA',
                     'id': 'ieu-a-9',
                     'mr': '1',
                     'ncase': '63746',
                     'ncontrol': '130681',

GET /meta/nodes/{meta_node}/search

  Use `id` for exact match, and use `name` for fuzzy match.
  
      - full_data: If False, only returns basic info (id, name).

Params

{'full_data': <class 'bool'>,
 'id': typing.Union[str, NoneType],
 'limit': <class 'int'>,
 'meta_node': <class 'str'>,
 'name': typing.Union[str, NoneType]}
1. Search Gwas nodes by id

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/meta/nodes/Gwas/search'
 params = {'id': 'ieu-a-2'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (node: Gwas {id: "ieu-a-2"}) RETURN node LIMIT '
                        '10;',
               'total_seconds': 0.082804},
  'results': [{'node': {'access': 'public',
                        'author': 'Locke AE',
                        'category': 'Risk factor',
                        'consortium': 'NA',
                        'id': 'ieu-a-2',
                        'mr': '1',
                        'nsnp': '2555511',
                        'pmid': '25673413',
                        'population': 'Mixed',
                        'priority': '1',
                        'sample_size': '339224',
                        'sd': '4.77',
                        'sex': 'Males and Females',
                        'subcategory': 'Anthropometric',
                        'trait': 'Body mass index',
                        'unit': 'NA',
                        'year': '2015'}}]}
2. Search Gwas nodes by name

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/meta/nodes/Gwas/search'
 params = {'name': 'body mass'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (node: Gwas) WHERE node.trait =~ "(?i).*body '
                        'mass.*" RETURN node LIMIT 10;',
               'total_seconds': 0.09035},
  'results': [{'node': {'access': 'public',
                        'author': 'Hoffmann TJ',
                        'category': 'NA',
                        'consortium': 'NA',
                        'id': 'ebi-a-GCST006368',
                        'mr': '1',
                        'note': 'NA',
                        'nsnp': '27854527',
                        'pmid': '30108127',
                        'population': 'European',
                        'priority': '0',
                        'sample_size': '315347',
                        'sex': 'NA',
                        'subcategory': 'NA',
                        'trait': 'Body mass index',
                        'unit': 'NA',
                        'year': '2018'}},
              {'node': {'access': 'public',
                        'author': 'Locke AE',
                        'category': 'Risk factor',
                        'consortium': 'NA',
                        'id': 'ieu-a-2',
                        'mr': '1',
                        'nsnp': '2555511',
                        'pmid': '25673413',
                        'population': 'Mixed',
                        'priority': '1',
                        'sample_size': '339224',
                        'sd': '4.77',
                        'sex': 'Males and Females',
                        'subcategory': 'Anthropometric',
                        'trait': 'Body mass index',
                        'unit': 'NA',
                        'year': '2015'}},
              {'node': {'access': 'public',
                        'author': 'Locke AE',
                        'category': 'Risk factor',
                        'consortium': 'NA',
                        'id': 'ieu-a-785',
                        'mr': '1',
                        'nsnp': '2477659',
                        'pmid': '25673413',
                        'population': 'European',
                        'priority': '2',
                        'sample_size': '152893',
                        'sd': '4.77',
                        'sex': 'Males',
                        'subcategory': 'Anthropometric',
                        'trait': 'Body mass index',
                        'unit': 'NA',

GET /meta/nodes/{meta_node}/search-neighbour

  Search the neighbour nodes adjacent to the query node.

Params

{'id': typing.Union[str, NoneType],
 'limit': <class 'int'>,
 'meta_node': <class 'str'>}
1. Search neighbour nodes of a Gwas node

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/meta/nodes/Gwas/search-neighbour'
 params = {'id': 'ieu-a-2'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (neighbour)-[rel]-(node: Gwas {id: "ieu-a-2"}) '
                        'WITH neighbour, rel, node, CASE WHEN '
                        'LABELS(neighbour)[0] = "Gwas" THEN { meta_node: '
                        'LABELS(neighbour)[0], meta_rel: TYPE(rel), node_data: '
                        'neighbour {.id, .trait} } ELSE { meta_node: '
                        'LABELS(neighbour)[0], meta_rel: TYPE(rel), node_data: '
                        'neighbour } END AS neighbour_data RETURN { meta_node: '
                        'LABELS(node)[0], id: node.id, neighbour: '
                        'collect(neighbour_data)[0..(50-1)] } AS data',
               'total_seconds': 0.257296},
  'results': [{'data': {'id': 'ieu-a-2',
                        'meta_node': 'Gwas',
                        'neighbour': [{'meta_node': 'Gwas',
                                       'meta_rel': 'MR',
                                       'node_data': {'id': 'ukb-a-99',
                                                     'trait': 'Non-cancer '
                                                              'illness code  '
                                                              'self-reported: '
                                                              'eczema/dermatitis'}},
                                      {'meta_node': 'Gwas',
                                       'meta_rel': 'MR',
                                       'node_data': {'id': 'ukb-a-98',
                                                     'trait': 'Non-cancer '
                                                              'illness code  '
                                                              'self-reported: '
                                                              'hypopituitarism'}},
                                      {'meta_node': 'Gwas',
                                       'meta_rel': 'MR',
                                       'node_data': {'id': 'ukb-a-97',
                                                     'trait': 'Non-cancer '
                                                              'illness code  '
                                                              'self-reported: '
                                                              'nasal polyps'}},
                                      {'meta_node': 'Gwas',

GET /meta/rels/{meta_rel}/list

  List relationships under a meta relationship.

Params

{'limit': <class 'int'>,
 'meta_rel': <enum 'EpigraphdbMetaRels'>,
 'offset': <class 'int'>}
1. List MR relationships

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/meta/rels/MR/list'
 params = None
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (n)-[r: MR]-(m) RETURN n, r, m SKIP 0 LIMIT 10',
               'total_seconds': 0.094083},
  'results': [{'m': {'access': 'public',
                     'author': 'Rietveld CA',
                     'category': 'Risk factor',
                     'consortium': 'NA',
                     'id': 'ieu-a-836',
                     'mr': '1',
                     'ncase': '20044',
                     'ncontrol': '75383',
                     'nsnp': '2321511',
                     'pmid': '23722424',
                     'population': 'European',
                     'priority': '1',
                     'sample_size': '95427',
                     'sex': 'Males and Females',
                     'subcategory': 'Education',
                     'trait': 'College completion',
                     'unit': 'NA',
                     'year': '2013'},
               'n': {'access': 'public',
                     'author': 'Neale',
                     'category': 'NA',
                     'consortium': 'Neale Lab',
                     'id': 'ukb-a-99',
                     'mr': '1',
                     'ncase': '8718',
                     'ncontrol': '328441',
                     'note': 'NA',
                     'nsnp': '10894596',
                     'population': 'European',
                     'priority': '1',
                     'sample_size': '337159',
                     'sex': 'Males and Females',
                     'subcategory': 'NA',
                     'trait': 'Non-cancer illness code  self-reported: '
                              'eczema/dermatitis',
                     'unit': 'SD',
                     'year': '2017'},
               'r': {'b': 0.006043282803148031,
                     'ci_low': 0.00028298949473537505,
                     'ci_upp': 0.011803575791418552,
                     'log10pval': 1.0,
                     'method': 'FE IVW',
                     'moescore': 1.0,
                     'nsnp': 3,
                     'pval': 0.039754558354616165,
                     'se': 0.0029389250557869673,
                     'selection': 'DF'}},
              {'m': {'access': 'public',
                     'author': 'Rietveld CA',
                     'category': 'Risk factor',
                     'consortium': 'NA',
                     'id': 'ieu-a-836',
                     'mr': '1',

GET /meta/paths/search

Params

{'id_source': <class 'str'>,
 'id_target': <class 'str'>,
 'limit': <class 'int'>,
 'max_path_length': <class 'int'>,
 'meta_node_source': <class 'str'>,
 'meta_node_target': <class 'str'>}
1. Search pair-wise rels between two Gwas

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/meta/paths/search'
 params = {'meta_node_source': 'Gwas', 'meta_node_target': 'Gwas', 'id_source': 'ieu-a-2', 'id_target': 'ieu-a-10', 'max_path_length': 1, 'limit': 3}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH p=(n:Gwas {id: "ieu-a-2"}) -[*1..1]- (m:Gwas '
                        '{id: "ieu-a-10"}) WITH nodes(p) AS node_list, '
                        'relationships(p) AS rel_list RETURN [ x in node_list | '
                        '{ _id: id(x), meta_node: labels(x)[0], node_value: x } '
                        '] AS node_data, [ i in range(0, size(rel_list) - 1) | '
                        '{ meta_rel: type(rel_list[i]), rel_index: i, rel__id: '
                        'id(rel_list[i]), rel_value: rel_list[i], '
                        'head_meta_node: labels(startNode(rel_list[i]))[0], '
                        'head_node__id: id(startNode(rel_list[i])), '
                        'end_meta_node: labels(endNode(rel_list[i]))[0], '
                        'end_node__id: id(endNode(rel_list[i])) } ] AS rel_data '
                        'LIMIT 3;',
               'total_seconds': 0.122595},
  'results': [{'node_data': [{'_id': 69699,
                              'meta_node': 'Gwas',
                              'node_value': {'access': 'public',
                                             'author': 'Locke AE',
                                             'category': 'Risk factor',
                                             'consortium': 'NA',
                                             'id': 'ieu-a-2',
                                             'mr': '1',
                                             'nsnp': '2555511',
                                             'pmid': '25673413',
                                             'population': 'Mixed',
                                             'priority': '1',
                                             'sample_size': '339224',
                                             'sd': '4.77',
                                             'sex': 'Males and Females',
                                             'subcategory': 'Anthropometric',
                                             'trait': 'Body mass index',
                                             'unit': 'NA',
                                             'year': '2015'}},
                             {'_id': 195054,
                              'meta_node': 'Gwas',
                              'node_value': {'access': 'public',
                                             'author': 'Jostins L',

POST /mappings/gene-to-protein

  Return protein uniprot_id from associated genes.
  
  - `gene_name_list`: List of HGNC symbols of the genes (default).
  - `gene_id_list`: List of Ensembl gene IDs (when `by_gene_id == True`)

Params

{'data': <class 'app.apis.mappings.models.GeneToProteinRequest'>}
1. (default) By HGNC symbols

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/mappings/gene-to-protein'
 data = {'gene_name_list': ['GCH1', 'MYOF']}
 r = requests.post(url, json=data)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH '
                        '(gene:Gene)-[gp:GENE_TO_PROTEIN]-(protein:Protein) '
                        "WHERE gene.name IN ['GCH1', 'MYOF'] RETURN gene "
                        '{.ensembl_id, .name}, protein {.uniprot_id}',
               'total_seconds': 0.093035},
  'results': [{'gene': {'ensembl_id': 'ENSG00000131979', 'name': 'GCH1'},
               'protein': {'uniprot_id': 'P30793'}},
              {'gene': {'ensembl_id': 'ENSG00000138119', 'name': 'MYOF'},
               'protein': {'uniprot_id': 'Q9NZM1'}}]}
2. By Ensembl IDs

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/mappings/gene-to-protein'
 data = {'gene_id_list': ['ENSG00000162594', 'ENSG00000113302'], 'by_gene_id': True}
 r = requests.post(url, json=data)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH '
                        '(gene:Gene)-[gp:GENE_TO_PROTEIN]-(protein:Protein) '
                        "WHERE gene.ensembl_id IN ['ENSG00000162594', "
                        "'ENSG00000113302'] RETURN gene {.ensembl_id, .name}, "
                        'protein {.uniprot_id}',
               'total_seconds': 0.086214},
  'results': [{'gene': {'ensembl_id': 'ENSG00000162594', 'name': 'IL23R'},
               'protein': {'uniprot_id': 'Q5VWK5'}},
              {'gene': {'ensembl_id': 'ENSG00000113302', 'name': 'IL12B'},
               'protein': {'uniprot_id': 'P29460'}}]}

POST /cypher/builder/plain

  Execute a plain cypher query of the following form:
  
  ```
  MATCH
      (source_node:{source_meta_node})
      -[rel:{meta_rel}]-
      (target_node:{target_meta_node})
  {
      WHERE [where0] AND [where1] AND ...
  }
  RETURN p
  {
     ORDER BY [order_by0], [order_by1], ...
  }
  LIMIT {limit}
  ```
  
  NOTE:
  - Please check API documentation for usage examples.
  - where: A list of strings where each is a cypher WHERE clause.
  - order_by: A list of strings where each is a cypher ORDER BY clase.
  It is only valid if your request contains valid where clauses
  - limit: Currently we limit maximum paths to 1000 (default to 100)

Params

{'data': <class 'app.apis.cypher.models.CypherBuilderRequest'>}
1. Query for MR

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/cypher/builder/plain'
 data = {'source_meta_node': 'Gwas', 'target_meta_node': 'Gwas', 'meta_rel': 'MR', 'where': ['rel.pval < 1e-12'], 'order_by': ['rel.pval'], 'limit': 20}
 r = requests.post(url, json=data)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (source_node:Gwas) -[rel:MR]- (target_node:Gwas) '
                        'WHERE rel.pval < 1e-12 RETURN source_node, rel, '
                        'target_node ORDER BY rel.pval LIMIT 20',
               'total_seconds': 1.535283},
  'results': [{'rel': {'b': 0.014909941703081131,
                       'ci_low': 0.014501266181468964,
                       'ci_upp': 0.015318617224693298,
                       'log10pval': 9.223372036854776e+18,
                       'method': 'FE IVW',
                       'moescore': 1.0,
                       'nsnp': 2,
                       'pval': 0.0,
                       'se': 0.00020850799046456814,
                       'selection': 'DF'},
               'source_node': {'access': 'public',
                               'author': 'Neale',
                               'category': 'NA',
                               'consortium': 'Neale Lab',
                               'id': 'ukb-a-136',
                               'mr': '1',
                               'ncase': '41952',
                               'ncontrol': '295207',
                               'note': 'NA',
                               'nsnp': '10894596',
                               'population': 'European',
                               'priority': '1',
                               'sample_size': '337159',
                               'sex': 'Males and Females',
                               'subcategory': 'NA',
                               'trait': 'Treatment/medication code: ibuprofen',
                               'unit': 'SD',
                               'year': '2017'},
               'target_node': {'access': 'public',
                               'author': 'Neale',
                               'category': 'NA',
                               'consortium': 'Neale Lab',
                               'id': 'ukb-a-144',
                               'mr': '1',
                               'ncase': '145',
                               'ncontrol': '337014',
                               'note': 'NA',
                               'nsnp': '10894596',
                               'population': 'European',
                               'priority': '1',
                               'sample_size': '337159',
                               'sex': 'Males and Females',

POST /cypher

  Send a cypher query to EpiGraphDB Graph.

Params

{'data': <class 'app.apis.cypher.models.CypherRequest'>}
1. Query

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/cypher'
 data = {'query': 'MATCH (n:Gwas)-[r:MR]-(m:Gwas) WHERE r.pval < 1e-5 RETURN n, r, m LIMIT 10'}
 r = requests.post(url, json=data)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH (n:Gwas)-[r:MR]-(m:Gwas) WHERE r.pval < 1e-5 '
                        'RETURN n, r, m LIMIT 10',
               'total_seconds': 0.129741},
  'results': [{'m': {'access': 'public',
                     'author': 'Neale',
                     'category': 'NA',
                     'consortium': 'Neale Lab',
                     'id': 'ukb-a-594',
                     'mr': '1',
                     'ncase': '5162',
                     'ncontrol': '332037',
                     'note': 'NA',
                     'nsnp': '10894596',
                     'population': 'European',
                     'priority': '1',
                     'sample_size': '337199',
                     'sex': 'Males and Females',
                     'subcategory': 'NA',
                     'trait': 'Diagnoses - main ICD10: Z09 Follow-up '
                              'examination after treatment for conditions other '
                              'than malignant neoplasms',
                     'unit': 'SD',
                     'year': '2017'},
               'n': {'access': 'public',
                     'author': 'Rietveld CA',
                     'category': 'Risk factor',
                     'consortium': 'NA',
                     'id': 'ieu-a-836',
                     'mr': '1',
                     'ncase': '20044',
                     'ncontrol': '75383',
                     'nsnp': '2321511',
                     'pmid': '23722424',
                     'population': 'European',
                     'priority': '1',
                     'sample_size': '95427',
                     'sex': 'Males and Females',
                     'subcategory': 'Education',
                     'trait': 'College completion',
                     'unit': 'NA',
                     'year': '2013'},
               'r': {'b': 0.002078590914607048,
                     'ci_low': 0.0016694148071110249,
                     'ci_upp': 0.002487767254933715,
                     'log10pval': 23.0,
                     'method': 'FE IVW',
                     'moescore': 1.0,
                     'nsnp': 3,
                     'pval': 2.3579606237411508e-23,
                     'se': 0.00020876337657682598,
                     'selection': 'DF'}},
              {'m': {'access': 'public',
                     'author': 'Neale',
                     'category': 'NA',