Skip to contents

Performs Mendelian randomization analysis using the CARE (Causal Analysis Robust to plEiotropy) method which is designed to be robust to horizontal pleiotropy and winner's curse.

Usage

mr_care(
  exposure_data,
  outcome_data,
  clump_r2 = 0.001,
  clump_kb = 10000,
  p_threshold = 5e-05,
  ref_panel = NULL,
  bias_correction = c("rerand", "direct", "no"),
  algorithm = c("CD", "Lasso"),
  nrep = 5000,
  random_start = 0,
  etamean = 0.5,
  temp_dir = NULL,
  verbose = TRUE,
  plink_path = NULL,
  config = TRUE
)

Arguments

exposure_data

A data frame containing exposure GWAS summary statistics, or a path to a file containing exposure data

outcome_data

A data frame containing outcome GWAS summary statistics, or a path to a file containing outcome data

clump_r2

Clumping r-squared threshold. Default is 0.001

clump_kb

Clumping window size in kb. Default is 10000

p_threshold

P-value threshold for selecting significant SNPs. Default is 5e-5

ref_panel

Path to reference panel for LD clumping. If NULL, will use configured reference panel

bias_correction

Method for correcting winner's curse bias: "no", "direct", or "rerand" (re-randomization). Default is "rerand"

algorithm

Algorithm for analysis: "Lasso" or "CD" (coordinate descent). Default is "CD"

nrep

Number of bootstrap repetitions. Default is 5000

random_start

Number of random starting points for optimization. Default is 0

etamean

Mean of the random variable for re-randomization. Default is 0.5

temp_dir

Directory for temporary files. Default is automatically created in a system temp location

verbose

Whether to print detailed progress messages. Default is TRUE

Path to plink executable. If NULL, will use configured plink path

config

Use configuration from configure_mrcare()? Default is TRUE

Value

A list containing the CARE results with various bias correction methods and model selection approaches

Examples

if (FALSE) { # \dontrun{
# Using file paths with configured environment
care_results <- mr_care(
  exposure_data = "path/to/exposure_gwas.txt",
  outcome_data = "path/to/outcome_gwas.txt"
)

# Using data frames with custom configuration
care_results <- mr_care(
  exposure_data = exposure_df,
  outcome_data = outcome_df,
  config = FALSE,
  ref_panel = "/path/to/reference/panel",
  plink_path = "/path/to/plink"
)
} # }