mr(
  exposure_trait = NULL,
  outcome_trait = NULL,
  pval_threshold = 1e-05,
  mode = c("table", "raw")
)

Arguments

exposure_trait

A trait name, e.g. "Body mass index", leaving exposure_trait as NULL will return MR information related to a specific outcome. NOTE: exposure_trait and outcome_trait cannot be both NULL.

outcome_trait

A trait name, e.g. "Coronary heart disease", leaving outcome_trait as NULL will return MR information related to a specific exposure_trait. NOTE: exposure_trait and outcome_trait cannot be both NULL.

pval_threshold

P-value threshold

mode

If mode = "table", returns a data frame (a tibble as per tidyverse convention). If mode = "raw", returns a raw response from EpiGraphDB API with minimal parsing done by httr.

Value

Data from GET /mr

Examples

# Returns a data frame mr(exposure_trait = "Body mass index", outcome_trait = "Coronary heart disease")
#> # A tibble: 6 x 10 #> exposure.id exposure.trait outcome.id outcome.trait mr.b mr.se mr.pval #> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> #> 1 ieu-a-974 Body mass ind… ieu-a-7 Coronary hea… 0.389 0.0493 3.42e-15 #> 2 ieu-a-2 Body mass ind… ieu-a-7 Coronary hea… 0.397 0.0727 4.79e- 8 #> 3 ieu-a-95 Body mass ind… ieu-a-7 Coronary hea… 0.455 0.0931 1.02e- 6 #> 4 ieu-a-2 Body mass ind… ieu-a-8 Coronary hea… 0.331 0.0684 1.31e- 6 #> 5 ieu-a-835 Body mass ind… ieu-a-7 Coronary hea… 0.360 0.0756 1.94e- 6 #> 6 ieu-a-974 Body mass ind… ieu-a-8 Coronary hea… 0.328 0.0731 6.97e- 6 #> # … with 3 more variables: mr.method <chr>, mr.selection <chr>, #> # mr.moescore <dbl>
# Returns raw response mr( exposure_trait = "Body mass index", outcome_trait = "Coronary heart disease", mode = "raw" ) %>% str()
#> List of 2 #> $ metadata:List of 3 #> ..$ query : chr "MATCH (exposure:Gwas)-[mr:MR]->(outcome:Gwas) WHERE exposure.trait = \"Body mass index\" AND outcome.trait = \""| __truncated__ #> ..$ total_seconds: num 0.0143 #> ..$ empty_results: logi FALSE #> $ results :List of 6 #> ..$ :List of 3 #> .. ..$ exposure:List of 2 #> .. .. ..$ id : chr "ieu-a-974" #> .. .. ..$ trait: chr "Body mass index" #> .. ..$ outcome :List of 2 #> .. .. ..$ id : chr "ieu-a-7" #> .. .. ..$ trait: chr "Coronary heart disease" #> .. ..$ mr :List of 6 #> .. .. ..$ b : num 0.389 #> .. .. ..$ se : num 0.0493 #> .. .. ..$ pval : num 3.42e-15 #> .. .. ..$ method : chr "FE IVW" #> .. .. ..$ selection: chr "DF" #> .. .. ..$ moescore : num 0.89 #> ..$ :List of 3 #> .. ..$ exposure:List of 2 #> .. .. ..$ id : chr "ieu-a-2" #> .. .. ..$ trait: chr "Body mass index" #> .. ..$ outcome :List of 2 #> .. .. ..$ id : chr "ieu-a-7" #> .. .. ..$ trait: chr "Coronary heart disease" #> .. ..$ mr :List of 6 #> .. .. ..$ b : num 0.397 #> .. .. ..$ se : num 0.0727 #> .. .. ..$ pval : num 4.79e-08 #> .. .. ..$ method : chr "Simple median" #> .. .. ..$ selection: chr "HF" #> .. .. ..$ moescore : num 0.92 #> ..$ :List of 3 #> .. ..$ exposure:List of 2 #> .. .. ..$ id : chr "ieu-a-95" #> .. .. ..$ trait: chr "Body mass index" #> .. ..$ outcome :List of 2 #> .. .. ..$ id : chr "ieu-a-7" #> .. .. ..$ trait: chr "Coronary heart disease" #> .. ..$ mr :List of 6 #> .. .. ..$ b : num 0.455 #> .. .. ..$ se : num 0.0931 #> .. .. ..$ pval : num 1.02e-06 #> .. .. ..$ method : chr "Penalised median" #> .. .. ..$ selection: chr "DF" #> .. .. ..$ moescore : num 0.78 #> ..$ :List of 3 #> .. ..$ exposure:List of 2 #> .. .. ..$ id : chr "ieu-a-2" #> .. .. ..$ trait: chr "Body mass index" #> .. ..$ outcome :List of 2 #> .. .. ..$ id : chr "ieu-a-8" #> .. .. ..$ trait: chr "Coronary heart disease" #> .. ..$ mr :List of 6 #> .. .. ..$ b : num 0.331 #> .. .. ..$ se : num 0.0684 #> .. .. ..$ pval : num 1.31e-06 #> .. .. ..$ method : chr "FE IVW" #> .. .. ..$ selection: chr "DF" #> .. .. ..$ moescore : num 0.75 #> ..$ :List of 3 #> .. ..$ exposure:List of 2 #> .. .. ..$ id : chr "ieu-a-835" #> .. .. ..$ trait: chr "Body mass index" #> .. ..$ outcome :List of 2 #> .. .. ..$ id : chr "ieu-a-7" #> .. .. ..$ trait: chr "Coronary heart disease" #> .. ..$ mr :List of 6 #> .. .. ..$ b : num 0.36 #> .. .. ..$ se : num 0.0756 #> .. .. ..$ pval : num 1.94e-06 #> .. .. ..$ method : chr "Simple median" #> .. .. ..$ selection: chr "Tophits" #> .. .. ..$ moescore : num 0.91 #> ..$ :List of 3 #> .. ..$ exposure:List of 2 #> .. .. ..$ id : chr "ieu-a-974" #> .. .. ..$ trait: chr "Body mass index" #> .. ..$ outcome :List of 2 #> .. .. ..$ id : chr "ieu-a-8" #> .. .. ..$ trait: chr "Coronary heart disease" #> .. ..$ mr :List of 6 #> .. .. ..$ b : num 0.328 #> .. .. ..$ se : num 0.0731 #> .. .. ..$ pval : num 6.97e-06 #> .. .. ..$ method : chr "FE IVW" #> .. .. ..$ selection: chr "DF" #> .. .. ..$ moescore : num 0.85
# Use a different threshold mr(exposure_trait = "Body mass index", pval_threshold = 1e-8)
#> # A tibble: 602 x 10 #> exposure.id exposure.trait outcome.id outcome.trait mr.b mr.se mr.pval #> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> #> 1 ieu-a-2 Body mass ind… ukb-a-74 Non-cancer i… 0.0346 0.00242 0 #> 2 ieu-a-2 Body mass ind… ukb-a-388 Hip circumfe… 0.724 0.0266 0 #> 3 ieu-a-2 Body mass ind… ukb-a-382 Waist circum… 0.656 0.0245 0 #> 4 ieu-a-2 Body mass ind… ukb-a-35 Comparative … 0.137 0.00791 0 #> 5 ieu-a-2 Body mass ind… ukb-a-34 Comparative … 0.366 0.0236 0 #> 6 ieu-a-2 Body mass ind… ukb-a-293 Trunk predic… 0.358 0.0167 0 #> 7 ieu-a-2 Body mass ind… ukb-a-292 Trunk fat-fr… 0.360 0.0177 0 #> 8 ieu-a-2 Body mass ind… ukb-a-291 Trunk fat ma… 0.737 0.0280 0 #> 9 ieu-a-2 Body mass ind… ukb-a-290 Trunk fat pe… 0.527 0.0275 0 #> 10 ieu-a-2 Body mass ind… ukb-a-289 Arm predicte… 0.416 0.0177 0 #> # … with 592 more rows, and 3 more variables: mr.method <chr>, #> # mr.selection <chr>, mr.moescore <dbl>