R/Preprocedure_sum_stat.R
MR_mega_prep.Rd
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
)
A list of all GWAS file data.
The number of the cohorts.
"mr-mega" or "env-mr-mega". The default option is "mr-mega".
Whether the trait is quantitative or not. This method is only used for quantitative traits.
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.
Logical. whether need to calculate PCs based on the inputted GWAS data.
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.
The the number of cores which would be used for running in parallel.
A list containing BETA, inverse of squared SE, PCs if required, marker information, cohort_count_filt and filtered-out genetic variants.
MR_mega_MDS
is the function to calculate the MDS of Euclidean distance matrix and the associated axes of genetic variation.