Prepare data for MR-mega approach and environment-adjusted MR-MEGA approach (mr-mega)

MR_mega_prep(
  sum_stat_pop,
  n_cohort = NULL,
  usefor = "mr-mega",
  qt = TRUE,
  pcCount = 2,
  calpc = FALSE,
  envCount = NULL,
  ncores
)

Arguments

sum_stat_pop

A list of all GWAS file data.

n_cohort

The number of the cohorts.

usefor

"mr-mega" or "env-mr-mega". The default option is "mr-mega".

qt

Whether the trait is quantitative or not. This method is only used for quantitative traits.

pcCount

The number of axes of genetic variation. Default the number of PCs is 1. The limitation of pcCount should be pcCount+envCount<n_cohort-2 for env-adjusted MR MEGA approach and The limitation of pcCount should be pcCount<n_cohort-2 for MR MEGA approach.

calpc

Logical. whether need to calculate PCs based on the inputted GWAS data.

envCount

The number of environment covariates. Default the number of environment covariates is null.The limitation of envCount should be pcCount+envCount<n_cohort-2 for env-adjusted MR MEGA approach.

ncores

The the number of cores which would be used for running in parallel.

Value

A list containing BETA, inverse of squared SE, PCs if required, marker information, cohort_count_filt and filtered-out genetic variants.

See also

MR_mega_MDS is the function to calculate the MDS of Euclidean distance matrix and the associated axes of genetic variation.

Author

Siru Wang