Skip to content

EpiGraphDB API endpoints

This document is auto generated from EpiGraphDB API specification.

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

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_EVE_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.294776},
  'results': [{'exposure': {'id': 'ieu-a-974', 'trait': 'Body mass index'},
               'mr': {'b': 0.193038232711978,
                      'method': 'FE IVW',
                      'moescore': 1.0,
                      'pval': 0.0,
                      'se': 0.00223608210517218,
                      'selection': 'DF'},
               'outcome': {'id': 'ebi-a-GCST005062',
                           'trait': 'Fibrinogen levels'}},
              {'exposure': {'id': 'ebi-a-GCST006368',
                            'trait': 'Body mass index'},
               'mr': {'b': 0.53327738343657,
                      'method': 'FE IVW',
                      'moescore': 0.93,
                      'pval': 0.0,
                      'se': 0.0104448807074039,
                      'selection': 'DF + HF'},
               'outcome': {'id': 'ukb-b-20188',
                           'trait': 'Arm fat percentage (left)'}},
              {'exposure': {'id': 'ieu-a-2', 'trait': 'Body mass index'},
               'mr': {'b': 0.439223555551985,
                      'method': 'FE IVW',
                      'moescore': 0.9,
                      'pval': 0.0,
                      'se': 0.00988946480369914,
                      'selection': 'Tophits'},
               'outcome': {'id': 'ukb-b-4650',
                           'trait': 'Comparative body size at age 10'}},
              {'exposure': {'id': 'ieu-a-2', 'trait': 'Body mass index'},
               'mr': {'b': 0.6739010545861329,
                      'method': 'FE IVW',
                      'moescore': 0.92,
                      'pval': 0.0,
                      'se': 0.0178415889107993,
                      'selection': 'DF + HF'},
               'outcome': {'id': 'ukb-b-2303',
                           'trait': 'Body mass index (BMI)'}},
              {'exposure': {'id': 'ieu-a-2', 'trait': 'Body mass index'},
               'mr': {'b': 0.44864951007464,
                      'method': 'FE IVW',
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_EVE_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.190671},
  'results': [{'exposure': {'id': 'ukb-b-4540',
                            'trait': 'Methods of admission to hospital '
                                     '(recoded): Emergency admission: '
                                     'Non-injury'},
               'mr': {'b': -1.16333513628466,
                      'method': 'FE IVW',
                      'moescore': 1.0,
                      'pval': 0.0,
                      'se': 0.0295084277124307,
                      'selection': 'DF'},
               'outcome': {'id': 'ieu-a-1089', 'trait': 'Body mass index'}},
              {'exposure': {'id': 'ukb-b-4263',
                            'trait': 'Number of full brothers'},
               'mr': {'b': 0.7033029662996549,
                      'method': 'FE IVW',
                      'moescore': 1.0,
                      'pval': 0.0,
                      'se': 0.0014276237828675,
                      'selection': 'DF'},
               'outcome': {'id': 'ieu-a-974', 'trait': 'Body mass index'}},
              {'exposure': {'id': 'ukb-b-11632',
                            'trait': 'Treatment/medication code: atenolol'},
               'mr': {'b': 0.5209304643689739,
                      'method': 'FE IVW',
                      'moescore': 1.0,
                      'pval': 0.0,
                      'se': 0.0109074036615998,
                      'selection': 'DF'},
               'outcome': {'id': 'ieu-a-974', 'trait': 'Body mass index'}},
              {'exposure': {'id': 'ukb-a-63',
                            'trait': 'Non-cancer illness code  self-reported: '
                                     'heart attack/myocardial infarction'},
               'mr': {'b': -0.8420743366880229,
                      'method': 'FE IVW',
                      'moescore': 1.0,
                      'pval': 0.0,
                      'se': 0.0198091394625712,
                      'selection': 'DF'},
               'outcome': {'id': 'ieu-a-974', 'trait': 'Body mas
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_EVE_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.129877},
  'results': [{'exposure': {'id': 'ubm-a-496',
                            'trait': 'IDP dMRI TBSS ICVF Superior cerebellar '
                                     'peduncle R'},
               'mr': {'b': 0.13610546823221,
                      'method': 'FE IVW',
                      'moescore': 1.0,
                      'pval': 0.0,
                      'se': 0.000331892872942469,
                      'selection': 'DF'},
               'outcome': {'id': 'ebi-a-GCST000998',
                           'trait': 'Coronary heart disease'}},
              {'exposure': {'id': 'ubm-a-2677',
                            'trait': 'volume Right-Cerebellum-Cortex'},
               'mr': {'b': -0.22925403960399401,
                      'method': 'FE IVW',
                      'moescore': 1.0,
                      'pval': 0.0,
                      'se': 0.00569335833058816,
                      'selection': 'DF'},
               'outcome': {'id': 'ebi-a-GCST000998',
                           'trait': 'Coronary heart disease'}},
              {'exposure': {'id': 'ubm-a-496',
                            'trait': 'IDP dMRI TBSS ICVF Superior cerebellar '
                                     'peduncle R'},
               'mr': {'b': 0.13610546823221,
                      'method': 'FE IVW',
                      'moescore': 1.0,
                      'pval': 0.0,
                      'se': 0.000331892872942469,
                      'selection': 'DF'},
               'outcome': {'id': 'ieu-a-8', 'trait': 'Coronary heart disease'}},
              {'exposure': {'id': 'ubm-a-2677',
                            'trait': 'volume Right-Cerebellum-Cortex'},
               'mr': {'b': -0.22925403960399401,
                      'method': 'FE IVW',
                      'moescore': 1.0,
                      'pval': 0.0,
                      'se': 0.00569335833058816,
                      'selection': 'DF'},
               'outcome': {'id': 'ieu-a-8', 'trait': 'Co

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.009793},
  'results': [{'assoc_trait': {'id': 'ukb-b-11842', 'trait': 'Weight'},
               'obs_cor': {'cor': 0.878521630374856},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-11842', 'trait': 'Weight'},
               'obs_cor': {'cor': 0.878521630374856},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-12039', 'trait': 'Weight'},
               'obs_cor': {'cor': 0.871360904191991},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-12039', 'trait': 'Weight'},
               'obs_cor': {'cor': 0.871360904191991},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-19953',
                               'trait': 'Body mass index (BMI)'},
               'obs_cor': {'cor': 0.802693232651605},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-19953',
                               'trait': 'Body mass index (BMI)'},
               'obs_cor': {'cor': 0.802693232651605},
               '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.01071},
  'results': [{'assoc_trait': {'id': 'ukb-b-11842', 'trait': 'Weight'},
               'obs_cor': {'cor': 0.878521630374856},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-11842', 'trait': 'Weight'},
               'obs_cor': {'cor': 0.878521630374856},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-12039', 'trait': 'Weight'},
               'obs_cor': {'cor': 0.871360904191991},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-12039', 'trait': 'Weight'},
               'obs_cor': {'cor': 0.871360904191991},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-19953',
                               'trait': 'Body mass index (BMI)'},
               'obs_cor': {'cor': 0.802693232651605},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-19953',
                               'trait': 'Body mass index (BMI)'},
               'obs_cor': {'cor': 0.802693232651605},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-2303',
                               'trait': 'Body mass index (BMI)'},
               'obs_cor': {'cor': 0.795709331174756},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-2303',
                               'trait': 'Body mass index (BMI)'},
               'obs_cor': {'cor': 0.795709331174756},
               'trait': {'id': 'ukb-b-9405', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-20044', 'trait': 'Trunk fat mass'},
               'obs_cor': {'cor': 0.7381030697878149},
               '

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: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, .rg_SE, .Z, .p, '
                        '.rg_intercept, .rg_intercept_SE, .h2, .h2_SE, '
                        '.h2_intercept, .h2_intercept_SE } ORDER BY gc.rg DESC '
                        ';',
               'total_seconds': 0.049895},
  'results': [{'assoc_trait': {'id': 'ukb-a-287',
                               'trait': 'Arm fat mass (left)'},
               'gc': {'Z': 278.9,
                      'h2': 0.203,
                      'h2_SE': 0.006928,
                      'h2_intercept': 1.055,
                      'h2_intercept_SE': 0.0172,
                      'p': 9.999999999999994e-309,
                      'rg': 0.9541,
                      'rg_SE': 0.003421,
                      'rg_intercept': 0.9111,
                      'rg_intercept_SE': 0.01661},
               'trait': {'id': 'ukb-a-382', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-8338',
                               'trait': 'Arm fat mass (left)'},
               'gc': {'Z': 278.9,
                      'h2': 0.203,
                      'h2_SE': 0.006928,
                      'h2_intercept': 1.055,
                      'h2_intercept_SE': 0.0172,
                      'p': 9.999999999999994e-309,
                      'rg': 0.9541,
                      'rg_SE': 0.003421,
                      'rg_intercept': 0.9111,
                      'rg_intercept_SE': 0.01661},
               'trait': {'id': 'ukb-a-382', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-7212',
                               'trait': 'Leg fat mass (left)'},
               'gc': {'Z': 330.4,
                      'h2': 0.203,
                      'h2_SE': 0.006928,
                      'h2_intercept': 1.055,
                      'h2_intercept_SE': 0.0172,
                      'p': 9.999999999999994e-309,
                      'rg': 0.9541,
                      'rg_SE': 0.002888,
                      'rg_intercept': 0.9081,
                      'rg_intercept_SE': 0.01695},
               'trait': {'id': 'ukb-a-382', 'trait': 'Waist circumference'}},
              {'
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: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, .rg_SE, .Z, .p, '
                        '.rg_intercept, .rg_intercept_SE, .h2, .h2_SE, '
                        '.h2_intercept, .h2_intercept_SE } ORDER BY gc.rg DESC '
                        ';',
               'total_seconds': 0.168188},
  'results': [{'assoc_trait': {'id': 'ukb-a-287',
                               'trait': 'Arm fat mass (left)'},
               'gc': {'Z': 278.9,
                      'h2': 0.203,
                      'h2_SE': 0.006928,
                      'h2_intercept': 1.055,
                      'h2_intercept_SE': 0.0172,
                      'p': 9.999999999999994e-309,
                      'rg': 0.9541,
                      'rg_SE': 0.003421,
                      'rg_intercept': 0.9111,
                      'rg_intercept_SE': 0.01661},
               'trait': {'id': 'ukb-a-382', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-8338',
                               'trait': 'Arm fat mass (left)'},
               'gc': {'Z': 278.9,
                      'h2': 0.203,
                      'h2_SE': 0.006928,
                      'h2_intercept': 1.055,
                      'h2_intercept_SE': 0.0172,
                      'p': 9.999999999999994e-309,
                      'rg': 0.9541,
                      'rg_SE': 0.003421,
                      'rg_intercept': 0.9111,
                      'rg_intercept_SE': 0.01661},
               'trait': {'id': 'ukb-a-382', 'trait': 'Waist circumference'}},
              {'assoc_trait': {'id': 'ukb-b-7212',
                               'trait': 'Leg fat mass (left)'},
               'gc': {'Z': 330.4,
                      'h2': 0.203,
                      'h2_SE': 0.006928,
                      'h2_intercept': 1.055,
                      'h2_intercept_SE': 0.0172,
                      'p': 9.999999999999994e-309,
                      'rg': 0.9541,
                      'rg_SE': 0.002888,
                      'rg_intercept': 0.9081,
                      'rg_intercept_SE': 0.01695},
               'trait': {'id': 'ukb-a-382', 'trait': 'Waist circumference'}},
              {'

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_EVE_MR]-> (exposure:Gwas '
                        '{trait: "Body mass index"}) '
                        '-[r2:MR_EVE_MR]->(outcome:Gwas {trait: "Coronary heart '
                        'disease"}) <-[r3:MR_EVE_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.838863},
  'results': [{'cf': {'id': 'ukb-b-8338', 'trait': 'Arm fat mass (left)'},
               'exposure': {'id': 'ieu-a-974', 'trait': 'Body mass index'},
               'outcome': {'id': 'ieu-a-8', 'trait': 'Coronary heart disease'},
               'r1': {'b': 0.8370181564895791,
                      'method': 'Simple median',
                      'moescore': 0.87,
                      'pval': 2.517982692176079e-112,
                      'se': 0.0371642062477166,
                      'selection': 'HF'},
               'r2': {'b': 0.32847610101648,
                      'method': 'FE IVW',
                      'moescore': 0.85,
                      'pval': 6.96632705468264e-06,
                      'se': 0.0730805223133059,
                      'selection': 'DF'},
               'r3': {'b': 0.320258689822155,
                      'method': 'FE IVW',
                      'moescore': 0.67,
                      'pval': 1.45279464451578e-06,
                      'se': 0.0664765123257088,
                      'selection': 'DF'}},
              {'cf': {'id': 'ukb-b-6704', 'trait': 'Arm fat mass (right)'},
               'exposure': {'id': 'ieu-a-974', 'trait': 'Body mass index'},
               'outcome': {'id': 'ieu-a-8', 'trait': 'Coronary heart disease'},
               'r1': {'b': 0.800980400009612,
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_EVE_MR]- (exposure:Gwas '
                        '{trait: "Body mass index"}) '
                        '-[r2:MR_EVE_MR]->(outcome:Gwas {trait: "Coronary heart '
                        'disease"}) <-[r3:MR_EVE_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': 1.527983},
  'results': [{'cf': {'id': 'ukb-d-KNEE_ARTHROSIS',
                      'trait': 'Gonarthrosis [arthrosis of knee](FG)'},
               'exposure': {'id': 'ieu-a-974', 'trait': 'Body mass index'},
               'outcome': {'id': 'ieu-a-8', 'trait': 'Coronary heart disease'},
               'r1': {'b': 0.0161424198250729,
                      'method': 'Simple median',
                      'moescore': 0.9,
                      'pval': 2.90885870510003e-06,
                      'se': 0.00345133490341152,
                      'selection': 'Tophits'},
               'r2': {'b': 0.32847610101648,
                      'method': 'FE IVW',
                      'moescore': 0.85,
                      'pval': 6.96632705468264e-06,
                      'se': 0.0730805223133059,
                      'selection': 'DF'},
               'r3': {'b': -6.80711894634798,
                      'method': 'FE IVW',
                      'moescore': 1.0,
                      'pval': 1.7008004818256495e-142,
                      'se': 0.267833586160006,
                      'selection': 'DF'}},
              {'cf': {'id': 'ukb-d-ICDMAIN_ANY_ENTRY',
                      'trait': 'Any ICDMAIN event in hilmo or causes of death'},
               'exposure': {'id': 'ieu-a-974', 'trait': 'Body mass index'},
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_EVE_MR]-> (exposure:Gwas '
                        '{trait: "Body mass index"}) '
                        '-[r2:MR_EVE_MR]->(outcome:Gwas {trait: "Coronary heart '
                        'disease"}) -[r3:MR_EVE_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': 1.906},
  'results': [{'cf': {'id': 'ukb-b-12646',
                      'trait': 'Treatment speciality of consultant (recoded): '
                               'General medicine'},
               'exposure': {'id': 'ieu-a-974', 'trait': 'Body mass index'},
               'outcome': {'id': 'ieu-a-8', 'trait': 'Coronary heart disease'},
               'r1': {'b': 0.7733674238392042,
                      'method': 'FE IVW',
                      'moescore': 1.0,
                      'pval': 1.0539751258843899e-60,
                      'se': 0.047052819153257,
                      'selection': 'DF'},
               'r2': {'b': 0.32847610101648,
                      'method': 'FE IVW',
                      'moescore': 0.85,
                      'pval': 6.96632705468264e-06,
                      'se': 0.0730805223133059,
                      'selection': 'DF'},
               'r3': {'b': 0.00984847041991893,
                      'method': 'FE IVW',
                      'moescore': 0.75,
                      'pval': 1.72104244684849e-07,
                      'se': 0.0018840844963074301,
                      'selection': 'HF'}},
              {'cf': {'id': 'ukb-b-11632',
                      'trait': 'Treatment/medication code: atenolol'},
               'exposure': {'id': 'ieu-a-974', 'trait': 'Body mass index
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_EVE_MR]- (exposure:Gwas '
                        '{trait: "Body mass index"}) '
                        '-[r2:MR_EVE_MR]->(outcome:Gwas {trait: "Coronary heart '
                        'disease"}) -[r3:MR_EVE_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': 2.314092},
  'results': [{'cf': {'id': 'ukb-b-13488',
                      'trait': 'Treatment/medication code: perindopril'},
               'exposure': {'id': 'ieu-a-974', 'trait': 'Body mass index'},
               'outcome': {'id': 'ieu-a-8', 'trait': 'Coronary heart disease'},
               'r1': {'b': 0.0072192910127228,
                      'method': 'RE IVW',
                      'moescore': 0.87,
                      'pval': 2.0269797155019801e-07,
                      'se': 0.00111303222094769,
                      'selection': 'HF'},
               'r2': {'b': 0.32847610101648,
                      'method': 'FE IVW',
                      'moescore': 0.85,
                      'pval': 6.96632705468264e-06,
                      'se': 0.0730805223133059,
                      'selection': 'DF'},
               'r3': {'b': 0.00384275108363339,
                      'method': 'FE IVW',
                      'moescore': 0.82,
                      'pval': 3.45610209569087e-11,
                      'se': 0.00057997675976848,
                      'selection': 'HF'}},
              {'cf': {'id': 'ukb-b-12651',
                      'trait': 'Diagnoses - secondary ICD10: E78.0 Pure '
                               'hypercholesterolaemia'},
               'exposure': {'id': 'ieu-a-974', 'trait': 'Body mass

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_EVE_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.376916},
  'results': [{'assoc_trait': {'id': 'ukb-a-12', 'trait': 'Nap during day'},
               'drug': {'label': 'SB-649868'},
               'gene': {'name': 'HCRTR2'},
               'mr': {'b': 2.43741650603288,
                      'method': 'FE IVW',
                      'moescore': 1.0,
                      'pval': 0.0,
                      'se': 0.008056364023149541,
                      'selection': 'DF'},
               'trait': {'id': 'ieu-a-9', 'trait': 'Coronary heart disease'},
               'variant': {'name': 'rs2653349'}},
              {'assoc_trait': {'id': 'ukb-a-12', 'trait': 'Nap during day'},
               'drug': {'label': 'LEMBOREXANT'},
               'gene': {'name': 'HCRTR2'},
               'mr': {'b': 2.43741650603288,
                      'method': 'FE IVW',
                      'moescore': 1.0,
                      'pval': 0.0,
                      'se': 0.008056364023149541,
                      'selection': 'DF'},
               'trait': {'id': 'ieu-a-9', 'trait': 'Coronary heart disease'},
               'variant': {'name': 'rs2653349'}},
              {'assoc_trait': {'id': 'ukb-a-12', 'trait': 'Nap during day'},
               'drug': {'label': 'SUVOREXANT'},
               'gene': {'name': 'HCRTR2'},
               'mr': {'b': 2.43741650603288,
                      'method': 'FE IVW',
                      'moescore': 1.0,
                      'pval': 0.0,
                      'se': 0.008056364023149541,
                      'selection': 'DF'},
               'trait': {'id': 'ieu-a-9', 'trait': 'Coronar

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, .eaf, .samplesize}, variant '
                        '{.name}, gene {.name}, protein {.uniprot_id}, pathway '
                        '{.id, .name} ORDER BY gwas_to_variant.pval ;',
               'total_seconds': 0.067923},
  'results': [{'gene': {'name': 'TOMM40'},
               'gwas': {'id': 'ieu-a-300', 'trait': 'LDL cholesterol'},
               'gwas_to_variant': {'beta': -0.4853,
                                   'eaf': 0.03166,
                                   'pval': 1e-200,
                                   'samplesize': 139198.0,
                                   'se': 0.0119},
               'pathway': {'id': 'R-HSA-9663891', 'name': 'Selective autophagy'},
               'protein': {'uniprot_id': 'O96008'},
               'variant': {'name': 'rs7254892'}},
              {'gene': {'name': 'TOMM40'},
               'gwas': {'id': 'ieu-a-300', 'trait': 'LDL cholesterol'},
               'gwas_to_variant': {'beta': -0.4853,
                                   'eaf': 0.03166,
                                   'pval': 1e-200,
                                   'samplesize': 139198.0,
                                   'se': 0.0119},
               'pathway': {'id': 'R-HSA-9612973', 'name': 'Autophagy'},
               'protein': {'uniprot_id': 'O96008'},
               'variant': {'name': 'rs7254892'}},
              {'gene': {'name': 'TOMM40'},
               'gwas': {'id': 'ieu-a-300', 'trait': 'LDL cholesterol'},
               'gwas_to_variant': {'beta': -0.4853,
                                   'eaf': 0.03166,
                                   'pval': 1e-200,
                                   'samplesize': 139198.0,
                                   'se': 0.0119},
               'pathway': {'id': 'R-HSA-9609507',
                           'name': 'Protein localization'},

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.111141},
  'results': [{'gene': {'ensembl_id': 'ENSG00000122861', 'name': 'PLAU'},
               'gwas': {'id': 'ukb-a-337',
                        'trait': 'Forced expiratory volume in 1-second (FEV1)'},
               'r': {'beta': 0.0421645947955484,
                     'p': 2.3281682783539e-06,
                     'se': 0.008928206414949279}}]}
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.025653},
  'results': [{'gene': {'ensembl_id': 'ENSG00000125462', 'name': 'C1orf61'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': -1.98228326767424,
                     'p': 4.7061328100262e-32,
                     'se': 0.16821468966705502}},
              {'gene': {'ensembl_id': 'ENSG00000148396', 'name': 'SEC16A'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': -0.496190474958369,
                     'p': 6.068514061391429e-19,
                     'se': 0.055809597735565986}},
              {'gene': {'ensembl_id': 'ENSG00000120708', 'name': 'TGFBI'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': -0.8785646251229459,
                     'p': 8.876167446378721e-16,
                     'se': 0.109254130145635}},
              {'gene': {'ensembl_id': 'ENSG00000128656', 'name': 'CHN1'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': 0.8776293616492471,
                     'p': 1.09814235013335e-15,
                     'se': 0.109493432815241}},
              {'gene': {'ensembl_id': 'ENSG00000113441', 'name': 'LNPEP'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': 0.330519978528724,
                     'p': 2.43591728961006e-15,
                     'se': 0.0417488939483079}},
              {'gene': {'ensembl_id': 'ENSG00000168610', 'name': 'STAT3'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': 0.6139865880190749,
                     'p': 2.19421869461152e-14,
                     'se': 0.0803783886796071}},
              {'gene': {'ensembl_id': 'ENSG00000118971', 'name': 'CCND2'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta'

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.01068},
  'results': [{'gene': {'ensembl_id': 'ENSG00000122861', 'name': 'PLAU'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': -0.418305477297394,
                     'p': 4.72411883038432e-13,
                     'rsid': 'rs2227551',
                     'se': 0.0578328522072584}},
              {'gene': {'ensembl_id': 'ENSG00000122861', 'name': 'PLAU'},
               'gwas': {'id': 'ieu-a-294',
                        'trait': 'Inflammatory bowel disease'},
               'r': {'beta': -0.287952021853336,
                     'p': 1.2777334577962101e-09,
                     'rsid': 'rs2227551',
                     'se': 0.0474372098378583}}]}
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.126554},
  'results': [{'gene': {'ensembl_id': 'ENSG00000252010', 'name': 'SCARNA5'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': -1.17330229026402,
                     'p': 2.8355306794367294e-77,
                     'rsid': 'rs10210302',
                     'se': 0.0630580538945707}},
              {'gene': {'ensembl_id': 'ENSG00000162594', 'name': 'IL23R'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': 1.46163646089095,
                     'p': 1.9953408712365396e-75,
                     'rsid': 'rs2064689',
                     'se': 0.0795347351592587}},
              {'gene': {'ensembl_id': 'ENSG00000085978', 'name': 'ATG16L1'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': 1.2079615384271298,
                     'p': 2.8610995188664594e-72,
                     'rsid': 'rs10192702',
                     'se': 0.0671884714816885}},
              {'gene': {'ensembl_id': 'ENSG00000168918', 'name': 'INPP5D'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': -3.5729246848269502,
                     'p': 1.4757206411231692e-71,
                     'rsid': 'rs13418066',
                     'se': 0.199744172231942}},
              {'gene': {'ensembl_id': 'ENSG00000167208', 'name': 'SNX20'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': -3.68434918236263,
                     'p': 1.1674850313199198e-68,
                     'rsid': 'rs113593279',
                     'se': 0.21039410884541696}},
              {'gene': {'ensembl_id': 'ENSG00000115415', 'name': 'STAT1'},
               'gwas': {'id': 'ieu-a-12',
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.029202},
  'results': [{'gene': {'ensembl_id': 'ENSG00000167037', 'name': 'SGSM1'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': 2.14504951732656,
                     'p': 1.27027097631945e-25,
                     'rsid': 'rs1250566',
                     'se': 0.205002386936228}},
              {'gene': {'ensembl_id': 'ENSG00000104490', 'name': 'NCALD'},
               'gwas': {'id': 'ieu-a-12', 'trait': "Crohn's disease"},
               'r': {'beta': 2.44887688594423,
                     'p': 1.27027097631945e-25,
                     'rsid': 'rs1250566',
                     'se': 0.234039169201657}},
              {'gene': {'ensembl_id': 'ENSG00000167037', 'name': 'SGSM1'},
               'gwas': {'id': 'ieu-a-294',
                        'trait': 'Inflammatory bowel disease'},
               'r': {'beta': 1.5369178644553605,
                     'p': 4.77192691073105e-20,
                     'rsid': 'rs1250566',
                     'se': 0.16762013140528198}},
              {'gene': {'ensembl_id': 'ENSG00000104490', 'name': 'NCALD'},
               'gwas': {'id': 'ieu-a-294',
                        'trait': 'Inflammatory bowel disease'},
               'r': {'beta': 1.75460874141047,
                     'p': 4.77192691073105e-20,
                     'rsid': 'rs1250566',
                     'se': 0.19136204647104105}},
              {'gene': {'ensembl_id': 'ENSG00000167037', 'name': 'SGSM1'},
               'gwas': {'id': 'ukb-b-19732',
                        'trait': 'Non-cancer illness code, self-reported: '
                                 'hypothyroidism/myxoedema'},
               'r': {'beta': -0.0378122558152413,
                     'p': 1.5992576203615e-07,
                     'rsid': 'rs1250566',

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.026216},
  '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.036335},
  'results': [{'assoc_trait': {'id': 'ukb-b-9685',
                               'trait': 'Trunk predicted mass'},
               'prs': {'beta': 0.063792367,
                       'model': 'lm',
                       'n': 328779,
                       'nsnps': 251,
                       'p': 1e-314,
                       'r2': 0.004351404,
                       'se': 0.001060756},
               'trait': {'id': 'ieu-a-2', 'trait': 'Body mass index'}},
              {'assoc_trait': {'id': 'ukb-a-293',
                               'trait': 'Trunk predicted mass'},
               'prs': {'beta': 0.063792367,
                       'model': 'lm',
                       'n': 328779,
                       'nsnps': 251,
                       'p': 1e-314,
                       'r2': 0.004351404,
                       'se': 0.001060756},
               'trait': {'id': 'ieu-a-2', 'trait': 'Body mass index'}},
              {'assoc_trait': {'id': 'ukb-b-17409',
                               'trait': 'Trunk fat-free mass'},
               'prs': {'beta': 0.06422349,
                       'model': 'lm',
                       'n': 328812,
                       'nsnps': 251,
                       'p': 1e-314,
                       'r2': 0.004408133,
                       'se': 0.00106428},
               'trait': {'id': 'ieu-a-2', 'trait': 'Body mass index'}},
              {'assoc_trait': {'id': 'ukb-a-292',
                               'trait': 'Trunk fat-free mass'},
               'prs': {'beta': 0.06422349,
                       'model': 'lm',
                       'n': 328812,
                       'nsnps': 251,
                       'p': 1e-314,
                       'r2': 0.004408133,
                       'se': 0.00106428},
               'trait': {'id': 'ieu-a-2', 'trait': 'Body mass index'}},
              {'assoc_trait': {'id': 'ukb-b-20044', 'trait': 'Trunk fat mass'},
               'prs': {'beta': 0.136499121,
                       'model': 'lm'

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.014403},
  'results': [{'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': 'Q32Q12'},
               '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': 'P50583'},
               'protein': {'uniprot_id': 'P30793'}},
              {'assoc_protein': {'uniprot_id': 'O95197'},
               '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': 'Q9NZB8'},
               '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.025332},
  'results': [{'assoc_protein': 'P32456', 'path_size': 1, 'protein': 'P42224'},
              {'assoc_protein': 'P32456', 'path_size': 1, 'protein': 'P42224'},
              {'assoc_protein': 'P32455', 'path_size': 1, 'protein': 'P42224'},
              {'assoc_protein': 'P32455', 'path_size': 1, 'protein': 'P42224'},
              {'assoc_protein': 'O60674', 'path_size': 1, 'protein': 'P42224'},
              {'assoc_protein': 'O60674', 'path_size': 1, 'protein': 'P42224'},
              {'assoc_protein': 'P28838', 'path_size': 1, 'protein': 'P42224'},
              {'assoc_protein': 'P28838', 'path_size': 1, 'protein': 'P42224'},
              {'assoc_protein': 'O14933', 'path_size': 1, 'protein': 'P42224'},
              {'assoc_protein': 'O14933', 'path_size': 1, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 1, 'protein': 'P32456'},
              {'assoc_protein': 'P42224', 'path_size': 1, 'protein': 'P32456'},
              {'assoc_protein': 'P32455', 'path_size': 1, 'protein': 'P32456'},
              {'assoc_protein': 'P32455', 'path_size': 1, 'protein': 'P32456'},
              {'assoc_protein': 'P42224', 'path_size': 1, 'protein': 'P32455'},
              {'assoc_protein': 'P42224', 'path_size': 1, 'protein': 'P32455'},
              {'assoc_protein': 'P32456', 'path_size': 1, 'protein': 'P32455'},
              {'assoc_protein': 'P32456', 'path_size': 1, 'protein': 'P32455'},
              {'assoc_protein': 'O14933', 'path_size': 1, 'protein': 'P32455'},
              {'assoc_protei
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': 1.51556},
  'results': [{'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein': 'P42224', 'path_size': 2, 'protein': 'P42224'},
              {'assoc_protein

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.id) AS '
                        'pathway_reactome_id',
               'total_seconds': 0.008546},
  'results': [{'pathway_count': 17,
               'pathway_reactome_id': ['R-HSA-983169',
                                       'R-HSA-983168',
                                       'R-HSA-977225',
                                       'R-HSA-936440',
                                       'R-HSA-913531',
                                       'R-HSA-73894',
                                       'R-HSA-73893',
                                       'R-HSA-5656169',
                                       'R-HSA-392499',
                                       'R-HSA-168928',
                                       'R-HSA-168256',
                                       'R-HSA-168249',
                                       'R-HSA-1280218',
                                       'R-HSA-1280215',
                                       'R-HSA-1169410',
                                       'R-HSA-1169408',
                                       'R-HSA-110313'],
               'uniprot_id': 'O14933'},
              {'pathway_count': 62,
               'pathway_reactome_id': ['R-HSA-983231',
                                       'R-HSA-982772',
                                       'R-HSA-9679506',
                                       'R-HSA-9679191',
                                       'R-HSA-9670439',
                                       'R-HSA-9669938',
                                       'R-HSA-9656223',
                                       'R-HSA-9649948',
                                       'R-HSA-9607240',
                                       'R-HSA-913531',
                                       'R-HSA-912526',
                                       'R-HSA-9027284',
                                       'R-HSA-9027283',
                                       'R-HSA-9027277',
                                       'R-HSA-9027276',
                                       'R-HSA-9020956',

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.012869},
  '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 SemMedDB term

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 Diseases'}
 r = requests.get(url, params=params)
 r.raise_for_status()
 r.json()

Results

 {'metadata': {'empty_results': False,
               'query': 'MATCH '
                        '(gene:Gene)-[:TERM_TO_GENE]-(lt_gene:LiteratureTerm)-[st:SEMMEDDB_PREDICATE]->(lt:LiteratureTerm) '
                        "WHERE gene.name = 'IL23R' AND lt.name =~ "
                        '"(?i).*Inflammatory Bowel Diseases.*" WITH gene, '
                        'lt_gene, st, lt MATCH '
                        '(triple:LiteratureTriple)-[:SEMMEDDB_TO_LIT]-(l:Literature) '
                        'WHERE triple.subject_id = lt_gene.id AND '
                        'triple.object_id = lt.id RETURN gene {.name}, st '
                        '{.predicate}, lt {.id, .name, .type}, collect(l.id) AS '
                        'pubmed_id',
               'total_seconds': 0.018363},
  'results': [{'gene': {'name': 'IL23R'},
               'lt': {'id': 'C0021390',
                      'name': 'Inflammatory Bowel Diseases',
                      'type': ['dsyn']},
               'pubmed_id': ['21155887',
                             '18383521',
                             '18383363',
                             '25159710',
                             '18341487',
                             '18047540',
                             '19575361',
                             '17484863',
                             '19496308',
                             '18698678',
                             '18088064',
                             '19175939',
                             '19817673',
                             '29248579',
                             '19747142',
                             '20393462',
                             '20067801',
                             '18368064',
                             '21846945',
                             '18164077',
                             '24280935',
                             '23131344',
                             '21155887',
                             '17484863',
                             '27852544',
                             '31728561'],
               'st': {'predicate': 'PREDISPOSES'}},
              {'gene': {'name': 'IL23R'},
               'lt': {'id': 'C0021390',
                      'name': 'Inflammatory Bowel Diseases',
                      'type': ['dsyn']},
               'pubmed_id': ['21155887',
                             '18383521',
                             '18383363',
                             '25159710',

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.007531},
  '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.071918},
  'results': [{'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': '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': 'bbj-a-3', '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': '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': 'bbj-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-94', 'trait': 'Body mass index'},
               'r': {'score': 1.0}},
              {'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0
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.012765},
  'results': [{'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-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-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': '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': 'bbj-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-835', 'trait': 'Body mass index'},
               'r': {'score': 1.0}},
              {'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0004340',
                       'type': 'typed-l

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.080355},
  '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_0020322',
                           'label': 'acute biphenotypic leukemia'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_1000828',
                       'type': 'typed-literal',
                       'value': 'B- and T-cell mixed leukemia'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0019461',
                           'label': 'B-cell prolymphocytic leukemia'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_1000102',
                       'type': 'typed-literal',
                       'value': 'B-Cell Prolymphocytic 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_0006115',
                           'label': 'blast phase chronic myelogenous leukemia, '
                                    'BCR-ABL1 positive'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_1000131',
                       'type': 'typed-literal',
                       'value': 'Blast Phase Chronic Myelogenous Leukemia, '
                                'BCR-ABL1 Positive'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0006147',
                           'label': 'chronic eosinophilic leukemia, not '
                                    'otherwise specified'},
               'efo': {'id': 'http://www.ebi.ac

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.07403},
  'results': [{'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0005550',
                           'label': 'infectious disease'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0005741',
                       'type': 'typed-literal',
                       'value': 'infectious disease'},
               'ge': {'score': 0.7459719},
               'gwas': {'id': 'finn-a-AB1_OTHER_INFECTIONS',
                        'trait': 'Other infectious diseases'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0005550',
                           'label': 'infectious disease'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0005741',
                       'type': 'typed-literal',
                       'value': 'infectious disease'},
               'ge': {'score': 0.7459719},
               '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.ac.uk/efo/EFO_0007301',
                       'type': 'typed-literal',
                       'value': 'Hepadnaviridae infectious disease'},
               'ge': {'score': 0.7315803000000001},
               'gwas': {'id': 'finn-a-AB1_OTHER_INFECTIONS',
                        'trait': 'Other infectious diseases'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0005786',
                           'label': 'Hepadnaviridae infectious disease'},
               'efo': {'id': 'http://www.ebi.ac.uk/efo/EFO_0007301',
                       'type': 'typed-literal',
                       'value': 'Hepadnaviridae infectious disease'},
               'ge': {'score': 
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.079149},
  '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.8038048000000001},
               '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.9299452},
               '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.8038048000000001},
               '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.9299452},
               'gwas': {'id': 'ukb-b-3957',
                        'trait': 'Sleeplessness / insomnia'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0013600',
                           'label': 'insomnia (d
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.065842},
  '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.8038048000000001},
               '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.9299452},
               '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.8038048000000001},
               '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.9299452},
               'gwas': {'id': 'ukb-b-3957',
                        'trait': 'Sleeplessness / insomnia'}},
              {'disease': {'id': 'http://purl.obolibrary.org/obo/MONDO_0013600',
                           'label': 'insomnia

GET /literature/gene

  For a gene, search for its literature evidence
  related to a SemMedDB term

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)-[:TERM_TO_GENE]-(lt_gene:LiteratureTerm)-[st:SEMMEDDB_PREDICATE]->(lt:LiteratureTerm) '
                        "WHERE gene.name = 'IL23R' AND lt.name =~ "
                        '"(?i).*Inflammatory bowel disease.*" WITH gene, '
                        'lt_gene, st, lt MATCH '
                        '(triple:LiteratureTriple)-[:SEMMEDDB_TO_LIT]-(l:Literature) '
                        'WHERE triple.subject_id = lt_gene.id AND '
                        'triple.object_id = lt.id RETURN gene {.name}, st '
                        '{.predicate}, lt {.id, .name, .type}, collect(l.id) AS '
                        'pubmed_id',
               'total_seconds': 0.017847},
  'results': [{'gene': {'name': 'IL23R'},
               'lt': {'id': 'C0021390',
                      'name': 'Inflammatory Bowel Diseases',
                      'type': ['dsyn']},
               'pubmed_id': ['21155887',
                             '18383521',
                             '18383363',
                             '25159710',
                             '18341487',
                             '18047540',
                             '19575361',
                             '17484863',
                             '19496308',
                             '18698678',
                             '18088064',
                             '19175939',
                             '19817673',
                             '29248579',
                             '19747142',
                             '20393462',
                             '20067801',
                             '18368064',
                             '21846945',
                             '18164077',
                             '24280935',
                             '23131344',
                             '21155887',
                             '17484863',
                             '27852544',
                             '31728561'],
               'st': {'predicate': 'PREDISPOSES'}},
              {'gene': {'name': 'IL23R'},
               'lt': {'id': 'C0021390',
                      'name': 'Inflammatory Bowel Diseases',
                      'type': ['dsyn']},
               'pubmed_id': ['21155887',
                             '18383521',
                             '18383363',
                             '25159710',

GET /literature/gwas

  Search for literature evidence of a Gwas trait via semmed.
  
  - `semmed_triple_id`: search for a specific semmed triple id
    (see EpiGraphDB documentation)
  - `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_TO_LITERATURE_TRIPLE]->(triple:LiteratureTriple) '
                        '-[sl:SEMMEDDB_TO_LIT]->(lit:Literature) WHERE '
                        'gwas.trait = "Sleep duration" AND gs.pval < 0.001 WITH '
                        'gwas, triple, lit, gs MATCH '
                        '(gwas)-[gl:GWAS_TO_LITERATURE]-(lit) RETURN gwas {.id, '
                        '.trait}, gs {.pval, .localCount}, triple {.id, .name, '
                        '.predicate}, lit {.id} SKIP 0 LIMIT 50',
               'total_seconds': 0.023393},
  'results': [{'gs': {'localCount': 2, 'pval': 4.129090490384296e-06},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'id': '30683158'},
               'triple': {'id': 'C0851578:COEXISTS_WITH:C0018099',
                          'name': 'Sleep Disorders COEXISTS_WITH Gout',
                          'predicate': 'COEXISTS_WITH'}},
              {'gs': {'localCount': 2, 'pval': 2.4785163389458493e-06},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'id': '22425576'},
               'triple': {'id': 'C0028754:PREDISPOSES:C0751249',
                          'name': 'Obesity PREDISPOSES Chronic Insomnia',
                          'predicate': 'PREDISPOSES'}},
              {'gs': {'localCount': 2, 'pval': 1.8541137780475587e-05},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'id': '12527604'},
               'triple': {'id': 'C0030054:TREATS:C0018802',
                          'name': 'Oxygen TREATS Congestive heart failure',
                          'predicate': 'TREATS'}},
              {'gs': {'localCount': 2, 'pval': 1.8541137780475587e-05},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'id': '2817624'},
               'triple': {'id': 'C0030054:TREATS:C0018802',
                          'name': 'Oxygen TREATS Congestive heart failure',
                          'predicate': 'TREATS'}},
              {'gs': {'localCount': 2, 'pval': 4.129090490384296e-06},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'id': '19194159'},
               'triple': {'id': 'C0033487:STIMULATES:C0628385',
                          'name
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_TO_LITERATURE_TRIPLE]->(triple:LiteratureTriple) '
                        '-[sl:SEMMEDDB_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_LITERATURE]-(lit) '
                        'RETURN gwas {.id, .trait}, gs {.pval, .localCount}, '
                        'triple {.id, .name, .predicate}, lit {.id} SKIP 0 '
                        'LIMIT 50',
               'total_seconds': 0.017208},
  'results': [{'gs': {'localCount': 2, 'pval': 4.129090490384296e-06},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'id': '30683158'},
               'triple': {'id': 'C0851578:COEXISTS_WITH:C0018099',
                          'name': 'Sleep Disorders COEXISTS_WITH Gout',
                          'predicate': 'COEXISTS_WITH'}},
              {'gs': {'localCount': 2, 'pval': 2.4785163389458493e-06},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'id': '22425576'},
               'triple': {'id': 'C0028754:PREDISPOSES:C0751249',
                          'name': 'Obesity PREDISPOSES Chronic Insomnia',
                          'predicate': 'PREDISPOSES'}},
              {'gs': {'localCount': 2, 'pval': 1.8541137780475587e-05},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'id': '12527604'},
               'triple': {'id': 'C0030054:TREATS:C0018802',
                          'name': 'Oxygen TREATS Congestive heart failure',
                          'predicate': 'TREATS'}},
              {'gs': {'localCount': 2, 'pval': 1.8541137780475587e-05},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'id': '2817624'},
               'triple': {'id': 'C0030054:TREATS:C0018802',
                          'name': 'Oxygen TREATS Congestive heart failure',
                          'predicate': 'TREATS'}},
              {'gs': {'localCount': 2, 'pval': 4.129090490384296e-06},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'id': '19194159'},
               'triple': {'id': 'C0033487:STIMULATES:C0628385',
                          'name': 'Pro
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': 'C0060135:INTERACTS_WITH:C0001962', '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_TO_LITERATURE_TRIPLE]->(triple:LiteratureTriple) '
                        '-[sl:SEMMEDDB_TO_LIT]->(lit:Literature) WHERE gwas.id '
                        '= "ieu-a-1088" AND triple.id = '
                        '"C0060135:INTERACTS_WITH:C0001962" AND gs.pval < 0.001 '
                        'WITH gwas, triple, lit, gs MATCH '
                        '(gwas)-[gl:GWAS_TO_LITERATURE]-(lit) RETURN gwas {.id, '
                        '.trait}, gs {.pval, .localCount}, triple {.id, .name, '
                        '.predicate}, lit {.id} SKIP 0 LIMIT 50',
               'total_seconds': 0.008044},
  'results': [{'gs': {'localCount': 2, 'pval': 2.4785163389458493e-06},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'id': '15481247'},
               'triple': {'id': 'C0060135:INTERACTS_WITH:C0001962',
                          'name': 'felbamate INTERACTS_WITH Ethanol',
                          'predicate': 'INTERACTS_WITH'}}]}
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_TO_LITERATURE_TRIPLE]->(triple:LiteratureTriple) '
                        '-[sl:SEMMEDDB_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_LITERATURE]-(lit) RETURN gwas {.id, '
                        '.trait}, gs {.pval, .localCount}, triple {.id, .name, '
                        '.predicate}, lit {.id} SKIP 0 LIMIT 50',
               'total_seconds': 0.025932},
  'results': [{'gs': {'localCount': 2, 'pval': 4.129090490384296e-06},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'id': '30683158'},
               'triple': {'id': 'C0851578:COEXISTS_WITH:C0018099',
                          'name': 'Sleep Disorders COEXISTS_WITH Gout',
                          'predicate': 'COEXISTS_WITH'}},
              {'gs': {'localCount': 2, 'pval': 1.8541137780475587e-05},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'id': '12527604'},
               'triple': {'id': 'C0030054:TREATS:C0018802',
                          'name': 'Oxygen TREATS Congestive heart failure',
                          'predicate': 'TREATS'}},
              {'gs': {'localCount': 2, 'pval': 1.8541137780475587e-05},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'id': '2817624'},
               'triple': {'id': 'C0030054:TREATS:C0018802',
                          'name': 'Oxygen TREATS Congestive heart failure',
                          'predicate': 'TREATS'}},
              {'gs': {'localCount': 2, 'pval': 2.7170377494970012e-05},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'id': '14655910'},
               'triple': {'id': 'C1436328:TREATS:C0751249',
                          'name': 'Eszopiclone TREATS Chronic Insomnia',
                          'predicate': 'TREATS'}},
              {'gs': {'localCount': 2, 'pval': 2.7170377494970012e-05},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               'lit': {'id': '19300573'},
               'triple': {'

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_TO_LITERATURE_TRIPLE]->(s1:LiteratureTriple) '
                        '-[:SEMMEDDB_OBJ]->(st:LiteratureTerm)<-[:SEMMEDDB_SUB]- '
                        '(s2:LiteratureTriple)<-[gs2:GWAS_TO_LITERATURE_TRIPLE]-(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 all(type in '
                        "st.type where NOT type IN ['nusq','dsyn']) MATCH "
                        '(s1)-[:SEMMEDDB_SUB]-(st1:LiteratureTerm) MATCH '
                        '(s2)-[:SEMMEDDB_OBJ]-(st2:LiteratureTerm) RETURN gwas '
                        '{.id, .trait}, gs1 {.pval, .localCount}, st1 {.name}, '
                        's1 {.id, .subject_id, .object_id, .predicate}, st '
                        '{.name, .type}, s2 {.id, .subject_id, .object_id, '
                        '.predicate}, st2 {.name}, gs2 {.pval, .localCount}, '
                        'assoc_gwas {.id, .trait} SKIP 0 LIMIT 10',
               'total_seconds': 61.349081},
  'results': [{'assoc_gwas': {'id': 'ieu-a-9',
                              'trait': 'Coronary heart disease'},
               'gs1': {'localCount': 3, 'pval': 5.30766406829485e-09},
               'gs2': {'localCount': 2, 'pval': 0.0016273514466348749},
               'gwas': {'id': 'ukb-b-4424', 'trait': 'Sleep duration'},
               's1': {'id': 'C0074414:INHIBITS:C0166417',
                      'object_id': 'C0166417',
                      'predicate': 'INHIBITS',
                      'subject_id': 'C0074414'},
               's2': {'id': 'C0166417:NEG_ASSOCIATED_WITH:C0010054',
                      'object_id': 'C0010054',
                      'predicate': 'NEG_ASSOCIATED_WITH',
                      'subject_id': 'C0166417'},
               'st': {'name': 'PPAR gamma', 'type': ['aapp', 'gngm']},
               'st1': {'name': 'sevoflurane'},
               'st2': {'name': 'Coronary Arteriosclerosis'}},
              {'assoc_gwas': {'id': 'ieu-a-6',
                              'trait': 'Coronary heart disease'},
               'gs1': {'localCount': 3, 'pval': 5.30766406829485e-09},
               'gs2': {'localCount': 2, 'pval': 0.0016273514466348749},
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_TO_LITERATURE_TRIPLE]->(s1:LiteratureTriple) '
                        '-[:SEMMEDDB_OBJ]->(st:LiteratureTerm)<-[:SEMMEDDB_SUB]- '
                        '(s2:LiteratureTriple)<-[gs2:GWAS_TO_LITERATURE_TRIPLE]-(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 '
                        "all(type in st.type where NOT type IN ['nusq','dsyn']) "
                        'MATCH (s1)-[:SEMMEDDB_SUB]-(st1:LiteratureTerm) MATCH '
                        '(s2)-[:SEMMEDDB_OBJ]-(st2:LiteratureTerm) RETURN gwas '
                        '{.id, .trait}, gs1 {.pval, .localCount}, st1 {.name}, '
                        's1 {.id, .subject_id, .object_id, .predicate}, st '
                        '{.name, .type}, s2 {.id, .subject_id, .object_id, '
                        '.predicate}, st2 {.name}, gs2 {.pval, .localCount}, '
                        'assoc_gwas {.id, .trait} SKIP 0 LIMIT 10',
               'total_seconds': 0.23323},
  'results': [{'assoc_gwas': {'id': 'ieu-a-6',
                              'trait': 'Coronary heart disease'},
               'gs1': {'localCount': 2, 'pval': 9.46898875156868e-05},
               'gs2': {'localCount': 3, 'pval': 0.04587817513562751},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               's1': {'id': 'C0038803:INTERACTS_WITH:C0003596',
                      'object_id': 'C0003596',
                      'predicate': 'INTERACTS_WITH',
                      'subject_id': 'C0038803'},
               's2': {'id': 'C0003596:TREATS:C0242350',
                      'object_id': 'C0242350',
                      'predicate': 'TREATS',
                      'subject_id': 'C0003596'},
               'st': {'name': 'Apomorphine', 'type': ['orch', 'phsu']},
               'st1': {'name': 'Sulpiride'},
               'st2': {'name': 'Erectile dysfunction'}},
              {'assoc_gwas': {'id': 'ieu-a-6',
                              'trait': 'Coronary heart disease'},
               'gs1': {'localCount': 2, 'pval': 2.4785163389458493e-06},
               'gs2': {'localCount': 2, 'pval': 0.0026822246617216835},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               's1': {'id'
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_TO_LITERATURE_TRIPLE]->(s1:LiteratureTriple) '
                        '-[:SEMMEDDB_OBJ]->(st:LiteratureTerm)<-[:SEMMEDDB_SUB]- '
                        '(s2:LiteratureTriple)<-[gs2:GWAS_TO_LITERATURE_TRIPLE]-(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 '
                        "all(type in st.type where type IN ['aapp','orch']) "
                        'MATCH (s1)-[:SEMMEDDB_SUB]-(st1:LiteratureTerm) MATCH '
                        '(s2)-[:SEMMEDDB_OBJ]-(st2:LiteratureTerm) RETURN gwas '
                        '{.id, .trait}, gs1 {.pval, .localCount}, st1 {.name}, '
                        's1 {.id, .subject_id, .object_id, .predicate}, st '
                        '{.name, .type}, s2 {.id, .subject_id, .object_id, '
                        '.predicate}, st2 {.name}, gs2 {.pval, .localCount}, '
                        'assoc_gwas {.id, .trait} SKIP 0 LIMIT 10',
               'total_seconds': 0.191176},
  'results': [{'assoc_gwas': {'id': 'ieu-a-6',
                              'trait': 'Coronary heart disease'},
               'gs1': {'localCount': 3, 'pval': 9.783804421427983e-05},
               'gs2': {'localCount': 2, 'pval': 0.0016273514466348749},
               'gwas': {'id': 'ieu-a-1088', 'trait': 'Sleep duration'},
               's1': {'id': 'C0001962:CONVERTS_TO:C0000966',
                      'object_id': 'C0000966',
                      'predicate': 'CONVERTS_TO',
                      'subject_id': 'C0001962'},
               's2': {'id': 'C0000966:STIMULATES:7124',
                      'object_id': '7124',
                      'predicate': 'STIMULATES',
                      'subject_id': 'C0000966'},
               'st': {'name': 'Acetaldehyde', 'type': ['orch']},
               'st1': {'name': 'ethanol'},
               'st2': {'name': 'TNF'}}]}

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': 2461,
                   'from_node': 'Drug',
                   'rel': 'OPENTARGETS_DRUG_TO_DISEASE',
                   'to_node': 'Disease'},
                  {'count': 5763,
                   'from_node': 'Gene',
                   'rel': 'GENE_TO_DISEASE',
                   'to_node': 'Disease'},
                  {'count': 8247,
                   'from_node': 'Disease',
                   'rel': 'MONDO_MAP_UMLS',
                   'to_node': 'LiteratureTerm'},
                  {'count': 2819,
                   'from_node': 'Disease',
                   'rel': 'MONDO_MAP_EFO',
                   'to_node': 'Efo'},
                  {'count': 2463,
                   'from_node': 'Pathway',
                   'rel': 'PATHWAY_CHILD_OF',
                   'to_node': 'Pathway'},
                  {'count': 121873,
                   'from_node': 'Protein',
                   'rel': 'PROTEIN_IN_PATHWAY',
                   'to_node': 'Pathway'},
                  {'count': 1969,
                   'from_node': 'LiteratureTriple',
                   'rel': 'MEDRXIV_SUB',
                   'to_node': 'LiteratureTerm'},
                  {'count': 5584547,
                   'from_node': 'LiteratureTerm',
                   'rel': 'SEMMEDDB_PREDICATE',
                   'to_node': 'LiteratureTerm'},
                  {'count': 5584547,
                   'from_node': 'LiteratureTriple',
                   'rel': 'SEMMEDDB_SUB',
                   'to_node': 'LiteratureTerm'},
                  {'count': 5556,
                   'from_node': 'Gwas',
                   'rel': 'METAMAP_LITE',
                   'to_node': 'LiteratureTerm'},
                  {'count': 16435,
                   'from_node': 'LiteratureTerm',
                   'rel': 'TERM_TO_GENE',
                   'to_node': 'Gene'},
                  {'count': 1969,
                   'from_node': 'LiteratureTerm',
                   'rel': 'MEDRXIV_PREDICATE',
                   'to_node': 'LiteratureTerm'},
                  {'count': 1969,
                   'from_node': 'LiteratureTriple',
                   'rel': 'MEDRXIV_OBJ',
                   'to_node': 'LiteratureTerm'},
                  {'count': 32651,
                   'from_node': 'LiteratureTriple',
                   'rel': 'BIORXIV_OBJ',
                   'to_node': 'LiteratureTerm'},
                  {'count': 32657,
                   'fro
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 38,960 </B>  | _name: STRING indexed  | doid: '
  'LIST indexed  | umls: LIST   | label: STRING indexed  | efo: LIST   | '
  'definition: STRING   | _source: LIST   | id: STRING indexed unique | _id: '
  'STRING indexed  | mesh: LIST   | icd9: LIST   | icd10: LIST   >]\n'
  '\tPathway [label=< <B> Pathway 2,441 </B>  | _name: STRING indexed  | name: '
  'STRING indexed  | _source: LIST   | id: STRING indexed unique | _id: STRING '
  'indexed  | url: STRING   >]\n'
  '\tLiteratureTerm [label=< <B> LiteratureTerm 108,905 </B>  | _name: STRING '
  'indexed  | name: STRING indexed  | _source: LIST   | id: STRING indexed '
  'unique | _id: STRING indexed  | type: LIST indexed  >]\n'
  '\tGene [label=< <B> Gene 57,737 </B>  | druggability_tier: STRING indexed  | '
  '_name: STRING indexed  | small_mol_druggable: STRING   | start: INTEGER   | '
  'description: STRING   | ensembl_id: STRING indexed unique | type: STRING   | '
  'chr: STRING indexed  | bio_druggable: STRING   | adme_gene: STRING   | name: '
  'STRING indexed  | _source: LIST   | end: INTEGER   | _id: STRING indexed  | '
  'biomart_source: STRING   >]\n'
  '\tLiteratureTriple [label=< <B> LiteratureTriple 5,609,945 </B>  | '
  'subject_id: STRING indexed  | predicate: STRING indexed  | _name: STRING '
  'indexed  | name: STRING indexed  | _source: LIST   | id: STRING indexed '
  'unique | _id: STRING indexed  | object_id: STRING indexed  >]\n'
  '\tLiterature [label=< <B> Literature 3,995,672 </B>  | issn: STRING   | '
  '_name: STRING indexed  | year: INTEGER   | _source: LIST   | id: STRING '
  'indexed  | _id: STRING indexed  | dp: STRING   | title: STRING   | edat: '
  'STRING   | doi: STRING   >]\n'
  '\tProtein [label=< <B> Protein 20,280 </B>  | name: STRING indexed  | '
  '_source: LIST   | uniprot_id: STRING indexed unique | _id: STRING indexed  | '
  '_name: STRING indexed  >]\n'
  '\tVariant [label=< <B> Variant 99,005 </B>  | ref: STRING   | _name: STRING '
  'indexed  | pos: INTEGER indexed  | build: STRING   | name: STRING indexed '
  'unique | alt: STRING   | _source: LIST   | _id: STRING indexed  | chr: '
  'STRING indexed  >]\n'
  '\tEfo [label=< <B> Efo 25,390 </B>  | _name: STRING indexed  | _source: '
  'LIST   | id: STRING indexed unique | _id: STRING indexed  | type: STRING   | '
  'value: 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

 ['Disease',
  'Drug',
  'Efo',
  'Gene',
  'Gwas',
  'Literature',
  'LiteratureTerm',
  'Pathway',
  'Protein',
  'Tissue',
  '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'},
  'Gene': {'id': 'ensembl_id', 'name': 'name'},
  'Gwas': {'id': 'id', 'name': 'trait'},
  'Literature': {'id': 'id', 'name': 'id'},
  'LiteratureTerm': {'id': 'id', 'name': 'name'},
  'LiteratureTriple': {'id': 'id', 'name': 'name'},
  'Pathway': {'id': 'id', 'name': 'name'},
  'Protein': {'id': 'uniprot_id', 'name': 'uniprot_id'},
  'Tissue': {'id': 'id', 'name': 'name'},
  '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

 ['BIORXIV_OBJ',
  'BIORXIV_PREDICATE',
  'BIORXIV_SUB',
  'BIORXIV_TO_LIT',
  'CPIC',
  'EFO_CHILD_OF',
  'EXPRESSED_IN',
  'GENE_TO_PROTEIN',
  'GEN_COR',
  'GWAS_EFO_EBI',
  'GWAS_NLP',
  'GWAS_NLP_EFO',
  'GWAS_TO_LITERATURE',
  'GWAS_TO_LITERATURE_TRIPLE',
  'GWAS_TO_VARIANT',
  'MEDRXIV_OBJ',
  'MEDRXIV_PREDICATE',
  'MEDRXIV_SUB',
  'MEDRXIV_TO_LIT',
  'METAMAP_LITE',
  'MONDO_MAP_EFO',
  'MONDO_MAP_UMLS',
  'MR_EVE_MR',
  'OBS_COR',
  'OPENTARGETS_DRUG_TO_DISEASE',
  'OPENTARGETS_DRUG_TO_TARGET',
  'PATHWAY_CHILD_OF',
  'PROTEIN_IN_PATHWAY',
  'PRS',
  'TERM_TO_GENE',
  'SEMMEDDB_OBJ',
  'SEMMEDDB_PREDICATE',
  'SEMMEDDB_SUB',
  'SEMMEDDB_TO_LIT',
  'STRING_INTERACT_WITH',
  'OPENGWAS_TOPHITS',
  'VARIANT_TO_GENE',
  'XQTL_MULTI_SNP_MR',
  'XQTL_SINGLE_SNP_MR_GENE_GWAS',
  'XQTL_SINGLE_SNP_MR_SNP_GENE',
  'GENE_TO_DISEASE']

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.009386},
  'results': [{'id': 'ieu-b-43',
               'name': 'frontotemporal dementia (TDP subtype)'},
              {'id': 'ieu-b-40', 'name': 'body mass index'},
              {'id': 'ieu-b-39', 'name': 'diastolic blood pressure'},
              {'id': 'ieu-b-38', 'name': 'systolic blood pressure'},
              {'id': 'ieu-b-35', 'name': 'C-Reactive protein level'}]}
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.009713},
  'results': [{'n': {'_id': 'ieu-b-43',
                     '_name': 'frontotemporal dementia (TDP subtype)',
                     '_source': ['OpenGWAS-2020-10-13'],
                     'author': 'Van Deerlin,V',
                     'build': 'HG19/GRCh37',
                     'category': 'Binary',
                     'id': 'ieu-b-43',
                     'mr': '1',
                     'ncase': '515.0',
                     'ncontrol': '2509.0',
                     'nsnp': '494577',
                     'pmid': '20154673.0',
                     'population': 'European',
                     'sample_size': '3024.0',
                     'sex': 'Males and Females',
                     'subcategory': 'Psychiatric / neurological',
                     'trait': 'frontotemporal dementia (TDP subtype)',
                     'unit': 'log odds ratio',
                     'year': '2010.0'}},
              {'n': {'_id': 'ieu-b-40',
                     '_name': 'body mass index',
                     '_source': ['OpenGWAS-2020-10-13'],
                     'author': 'Yengo, L',
                     'build': 'HG19/GRCh37',
                     'category': 'Continuous',
                     'consortium': 'GIANT',
                     'id': 'ieu-b-40',
                     'mr': '1',
                     'nsnp': '2336260',
                     'pmid': '30124842.0',
                     'population': 'European',
                     'sample_size': '681275.0',
                     'sex': 'Males and Females',
                     'subcategory': 'Anthropometric',
                     'trait': 'body mass index',
                     'unit': 'SD',
                     'year': '2018.0'}},
              {'n': {'_id': 'ieu-b-39',
                     '_name': 'diastolic blood pressure',
                     '_source': ['OpenGWAS-2020-10-13'],
                     'author': 'Evangelou, E',
                     'build': 'HG19/GRCh37',
                     'category': 'Continuous',
                     'consortium': 'International Consortium of Blood Pressure',
                     'id': 'ieu-b-39',
                     'mr': '1',
                     'nsnp': '7160619',
                     'pmid': '30224653.0',
                     'population': 'European',

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.008462},
  'results': [{'node': {'_id': 'ieu-a-2',
                        '_name': 'Body mass index',
                        '_source': ['OpenGWAS-2020-10-13'],
                        'author': 'Locke AE',
                        'build': 'HG19/GRCh37',
                        'category': 'Risk factor',
                        'id': 'ieu-a-2',
                        'mr': '1',
                        'nsnp': '2555511',
                        'pmid': '25673413.0',
                        'population': 'Mixed',
                        'sample_size': '339224.0',
                        'sd': '4.77',
                        'sex': 'Males and Females',
                        'subcategory': 'Anthropometric',
                        'trait': 'Body mass index',
                        'year': '2015.0'}}]}
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.015016},
  'results': [{'node': {'_id': 'ieu-a-1089',
                        '_name': 'Body mass index',
                        '_source': ['OpenGWAS-2020-10-13'],
                        'author': 'Wood',
                        'build': 'HG19/GRCh37',
                        'category': 'Risk factor',
                        'id': 'ieu-a-1089',
                        'mr': '0',
                        'note': 'Dominance model? If so then not necessarily of '
                                'value for MR; Results from interim Biobank '
                                'release enriched for smokers; could lead to '
                                'bias through collider issues in MR',
                        'nsnp': '8654252',
                        'pmid': '26961502.0',
                        'population': 'European',
                        'sample_size': '120286.0',
                        'sex': 'Males and Females',
                        'subcategory': 'Anthropometric',
                        'trait': 'Body mass index',
                        'year': '2016.0'}},
              {'node': {'_id': 'ieu-a-974',
                        '_name': 'Body mass index',
                        '_source': ['OpenGWAS-2020-10-13'],
                        'author': 'Locke AE',
                        'build': 'HG19/GRCh37',
                        'category': 'Risk factor',
                        'id': 'ieu-a-974',
                        'mr': '1',
                        'nsnp': '2494613',
                        'pmid': '25673413.0',
                        'population': 'European',
                        'sample_size': '171977.0',
                        'sd': '4.77',
                        'sex': 'Females',
                        'subcategory': 'Anthropometric',
                        'trait': 'Body mass index',
                        'year': '2015.0'}},
              {'node': {'_id': 'ieu-a-95',
                        '_name': 'Body mass index',
                        '_source': ['OpenGWAS-2020-10-13'],
                        'author': 'Randall JC',
                        'build': 'HG19/GRCh37',
                        'category': 'Risk factor',
                        'id': 'ieu-a-95',

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.46017},
  'results': [{'data': {'id': 'ieu-a-2',
                        'meta_node': 'Gwas',
                        'neighbour': [{'meta_node': 'Efo',
                                       'meta_rel': 'GWAS_NLP_EFO',
                                       'node_data': {'_id': 'http://www.ebi.ac.uk/efo/EFO_0005936',
                                                     '_name': 'underweight body '
                                                              'mass index '
                                                              'status',
                                                     '_source': ['EpiGraphDB '
                                                                 'v0.3'],
                                                     'id': 'http://www.ebi.ac.uk/efo/EFO_0005936',
                                                     'type': 'typed-literal',
                                                     'value': 'underweight body '
                                                              'mass index '
                                                              'status'}},
                                      {'meta_node': 'Efo',
                                       'meta_rel': 'GWAS_NLP_EFO',
                                       'node_data': {'_id': 'http://www.ebi.ac.uk/efo/EFO_0007041',
                                                     '_name': 'obese body mass '
                                                              'index status',
                                                     '_source': ['EpiGraphDB '
                                                                 'v0.3'],

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 (MR EvE) relationships

Script

 import requests


 url = f'{EPIGRAPHDB_API_URL}/meta/rels/MR_EVE_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_EVE_MR]-(m) RETURN n, r, m SKIP 0 '
                        'LIMIT 10',
               'total_seconds': 0.022385},
  'results': [{'m': {'_id': 'prot-a-1171',
                     '_name': 'Polypeptide N-acetylgalactosaminyltransferase 2',
                     '_source': ['OpenGWAS-2020-10-13'],
                     'author': 'Sun BB',
                     'build': 'HG19/GRCh37',
                     'category': 'Immune system',
                     'id': 'prot-a-1171',
                     'mr': '1',
                     'nsnp': '10534735',
                     'pmid': '29875488.0',
                     'population': 'European',
                     'sample_size': '3301.0',
                     'sex': 'Males and Females',
                     'subcategory': 'Protein',
                     'trait': 'Polypeptide N-acetylgalactosaminyltransferase 2',
                     'year': '2018.0'},
               'n': {'_id': 'ukb-d-XIII_MUSCULOSKELET',
                     '_name': 'Diseases of the musculoskeletal system and '
                              'connective tissue',
                     '_source': ['OpenGWAS-2020-10-13'],
                     'author': 'Neale lab',
                     'build': 'HG19/GRCh37',
                     'category': 'Binary',
                     'id': 'ukb-d-XIII_MUSCULOSKELET',
                     'mr': '1',
                     'ncase': '77099.0',
                     'ncontrol': '284095.0',
                     'nsnp': '13586589',
                     'population': 'European',
                     'sample_size': '361194.0',
                     'sex': 'Males and Females',
                     'trait': 'Diseases of the musculoskeletal system and '
                              'connective tissue',
                     'year': '2018.0'},
               'r': {'_source': ['MR-EvE-2021-03-10'],
                     'b': -0.851781600575194,
                     'ci_low': -2.60590765161164,
                     'ci_upp': 0.9023444504612571,
                     'method': 'FE IVW',
                     'moescore': 1.0,
                     'nsnp': 2,
                     'pval': 0.341223071383756,
                     'se': 0.8949622709369641,
                     'selection': 'DF'}},
              {'m': {'_id': 'prot-a-1171',
                     '_name': 'Polypeptide N-acetylgalactosaminyltransferase 2'

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.034871},
  'results': [{'node_data': [{'_id': 218133,
                              'meta_node': 'Gwas',
                              'node_value': {'_id': 'ieu-a-2',
                                             '_name': 'Body mass index',
                                             '_source': ['OpenGWAS-2020-10-13'],
                                             'author': 'Locke AE',
                                             'build': 'HG19/GRCh37',
                                             'category': 'Risk factor',
                                             'id': 'ieu-a-2',
                                             'mr': '1',
                                             'nsnp': '2555511',
                                             'pmid': '25673413.0',
                                             'population': 'Mixed',
                                             'sample_size': '339224.0',
                                             'sd': '4.77',
                                             'sex': 'Males and Females',
                                             'subcategory': 'Anthropometric',
                                             'trait': 'Body mass index',
                                             'year': '2015.0'}},
                             {'_id': 384631,
                              'meta_node': 'Gwas',
                              'node_value': {'_id': 'ieu-a-10',
                                             '_name

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.008845},
  '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.008687},
  'results': [{'gene': {'ensembl_id': 'ENSG00000162594', 'name': 'IL23R'},
               'protein': {'uniprot_id': 'Q5VWK5'}},
              {'gene': {'ensembl_id': 'ENSG00000113302', 'name': 'IL12B'},
               'protein': {'uniprot_id': 'P29460'}}]}

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_EVE_MR]-(m:Gwas) WHERE r.pval < 1e-5 RETURN properties(n), properties(r), properties(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_EVE_MR]-(m:Gwas) WHERE r.pval < '
                        '1e-5 RETURN properties(n), properties(r), '
                        'properties(m) LIMIT 10',
               'total_seconds': 0.023732},
  'results': [{'properties(m)': {'_id': 'ukb-d-K11_APPENDIX',
                                 '_name': 'Diseases of appendix',
                                 '_source': ['OpenGWAS-2020-10-13'],
                                 'author': 'Neale lab',
                                 'build': 'HG19/GRCh37',
                                 'category': 'Binary',
                                 'id': 'ukb-d-K11_APPENDIX',
                                 'mr': '1',
                                 'ncase': '2953.0',
                                 'ncontrol': '358241.0',
                                 'nsnp': '11121577',
                                 'population': 'European',
                                 'sample_size': '361194.0',
                                 'sex': 'Males and Females',
                                 'trait': 'Diseases of appendix',
                                 'year': '2018.0'},
               'properties(n)': {'_id': 'prot-a-1171',
                                 '_name': 'Polypeptide '
                                          'N-acetylgalactosaminyltransferase 2',
                                 '_source': ['OpenGWAS-2020-10-13'],
                                 'author': 'Sun BB',
                                 'build': 'HG19/GRCh37',
                                 'category': 'Immune system',
                                 'id': 'prot-a-1171',
                                 'mr': '1',
                                 'nsnp': '10534735',
                                 'pmid': '29875488.0',
                                 'population': 'European',
                                 'sample_size': '3301.0',
                                 'sex': 'Males and Females',
                                 'subcategory': 'Protein',
                                 'trait': 'Polypeptide '
                                          'N-acetylgalactosaminyltransferase 2',
                                 'year': '2018.0'},
               'properties(r)': {'_source': ['MR-EvE-2021-03-10'],
                                 'b': 5.0276653757678,
                                 'ci_low':