An MR object is a container for vectors and matrices of 2 or more GWAS data.

MR(
  exposure,
  outcome,
  harmonise_strictness = 2,
  with_proxies = FALSE,
  proxy_r2 = 0.8,
  proxy_kb = 250,
  proxy_window = 15,
  plink2 = genepi.utils::which_plink2(),
  pfile = genepi.utils::which_1000G_reference(build = "GRCh37"),
  correlation = NULL,
  verbose = TRUE
)

Arguments

exposure

a GWAS object or list of GWAS objects

outcome

a GWAS object

harmonise_strictness

an integer (1,2,3) corresponding to the TwoSampleMR harmonisation options of the same name.

with_proxies

a logical, whether to search for outcome proxy SNPs if the original variant is not present in the data.

proxy_r2

a numeric (0-1), the minimum r2 threshold used to define a suitable proxy variant.

proxy_kb

an integer, the maximum distance in kb that a proxy variant can be from the index variant.

proxy_window

an integer, the maximum number of variants to search either side of the index variant.

correlation

a matrix, correlation matrix of signed R values between variants

verbose

a logical, print more information

proxy_eaf

a numeric, the minimum minor allele frequency required to define a suitable proxy.

Value

an S7 class genepi.utils::MR object

Slots

snps

character, variant ID

chr

character, chromosome identifier

bp

integer, base position

ea

character, effect allele

oa

character, other allele

eafx

numeric, exposure effect allele frequency

nx

integer, exposure total number of samples

ncasex

integer, exposure number of cases

bx

numeric, exposure effect size

bxse

numeric, exposure effect size standard error

px

numeric, exposure p-value

eafy

numeric, exposure effect allele frequency

ny

integer, exposure total number of samples

ncasey

integer, exposure number of cases

by

numeric, exposure effect size

byse

numeric, exposure effect size standard error

py

numeric, exposure p-value

exposure_id

character, the GWAS identifier

exposure

character, the GWAS exposure

outcome_id

character, the GWAS identifier

outcome

character, the GWAS outcome

group

integer, grouping variable used for plotting

index_snp

logical, whether the variant is an index variant (via clumping)

proxy_snp

character, the id of the proxy snp

ld_info

logical, whether there is LD information

info

data.frame, information about the loaded GWAS objects

correlation

matrix, a correlation matrix of signed R values between variants