Skip to contents

This function performs Mendelian Randomization (MR) analyses based on the core gene hypothesis for polygenic exposures. MR Corge identifies a small number of putative core instruments that are more likely to affect genes with a direct biological role in an exposure and obtains causal effect estimates based on these instruments, thereby reducing the risk of horizontal pleiotropy.

Usage

mrcorge(
  harmonized_data,
  rank = "beta",
  K = 5,
  method_list = c("mr_ivw", "mr_weighted_mode", "mr_weighted_median"),
  seed = 1
)

Arguments

harmonized_data

Data frame containing the harmonized data from the TwoSampleMR package.

rank

Character, method to rank instruments, one of 'beta' (absolute per-allele effect size), 'h2' (per-variant heritability), 'pval' (significance), or 'zscore' (sample size-normalized z-score). Default is 'beta'.

K

Integer, number of instrument groups. Default is 5.

method_list

Character vector, list of MR methods to apply. Default is c("mr_ivw", "mr_weighted_mode", "mr_weighted_median").

seed

Integer, seed for random number generation. Default is 1.

Value

A list containing:

mrcorge

The main MR results.

result

All MR results including group-specific and cumulative estimates.

instrument

Data frame of instruments with their respective groups.

Q

Q statistics for heterogeneity.

I2

I2 statistics for heterogeneity.

het_P

P-values for heterogeneity tests.

Examples

# Example usage:
library(MRCorge)
data("HDL_CAD")
res <- mrcorge(HDL_CAD, rank='beta', K=20, method_list = c("mr_ivw"))
#> TwoSampleMR version 0.5.10 
#> [>] New: Option to use non-European LD reference panels for clumping etc
#> [>] Some studies temporarily quarantined to verify effect allele
#> [>] See news(package='TwoSampleMR') and https://gwas.mrcieu.ac.uk for further details
#> 
#> Warning:
#> You are running an old version of the TwoSampleMR package.
#> This version:   0.5.10
#> Latest version: 0.6.8
#> Please consider updating using remotes::install_github('MRCIEU/TwoSampleMR')
#> Analysing '0GbyEu' on '7n4jWF'
#> MR CORGE estimates: 
#>   id.exposure id.outcome outcome exposure                    method nsnp
#> 1      0GbyEu     7n4jWF outcome exposure Inverse variance weighted    6
#>             b        se      pval    Fstat group       category
#> 1 -0.03943587 0.1004654 0.6946652 750.7501     1 Group-specific
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 2 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 3 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 4 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 5 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 6 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 7 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 8 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 9 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 10 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 11 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 12 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 13 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 14 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 15 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 16 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 17 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 18 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 19 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining group-specific estimates for instrument group 20 / 20 ... 
#> obtaining cumulative estimates for instrument group 1 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 2 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 3 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 4 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 5 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 6 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 7 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 8 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 9 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 10 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 11 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 12 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 13 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 14 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 15 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 16 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 17 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 18 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 19 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'
#> obtaining cumulative estimates for instrument group 20 / 20 ... 
#> Analysing '0GbyEu' on '7n4jWF'