You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: R/MAPIT.R
+33-32Lines changed: 33 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -1,73 +1,73 @@
1
1
#' Multivariate MArginal ePIstasis Test (mvMAPIT)
2
-
#'
2
+
#'
3
3
#' \code{MvMAPIT} will run a version of the MArginal ePIstasis Test (MAPIT) under the following model variations:
4
-
#'
4
+
#'
5
5
#' This function will run a multivariate version of the MArginal ePIstasis Test (mvMAPIT).
6
-
#'
6
+
#'
7
7
#' (1) Standard Model: y = m+g+e where m ~ MVN(0,omega^2K), g ~ MVN(0,sigma^2G), e ~ MVN(0,tau^2M).
8
8
#' Recall from Crawford et al. (2017) that m is the combined additive effects from all other variants,
9
-
#' and effectively represents the additive effect of the kth variant under the polygenic background
9
+
#' and effectively represents the additive effect of the k-th variant under the polygenic background
10
10
#' of all other variants; K is the genetic relatedness matrix computed using
11
-
#' genotypes from all variants other than the kth; g is the summation of all pairwise interaction
12
-
#' effects between the kth variant and all other variants; G represents a relatedness matrix
13
-
#' computed based on pairwise interaction terms between the kth variant and all other variants. Here,
11
+
#' genotypes from all variants other than the k-th; g is the summation of all pairwise interaction
12
+
#' effects between the k-th variant and all other variants; G represents a relatedness matrix
13
+
#' computed based on pairwise interaction terms between the k-th variant and all other variants. Here,
14
14
#' we also denote D = diag(x_k) to be an n × n diagonal matrix with the genotype vector x_k as its
15
15
#' diagonal elements. It is important to note that both K and G change with every new marker k that is
16
16
#' considered. Lastly; M is a variant specific projection matrix onto both the null space of the intercept
17
17
#' and the corresponding genotypic vector x_k.
18
-
#'
18
+
#'
19
19
#' (2) Standard + Covariate Model: y = Wa+m+g+e where W is a matrix of covariates with effect sizes a.
20
-
#'
20
+
#'
21
21
#' (3) Standard + Common Environment Model: y = m+g+c+e where c ~ MVN(0,eta^2C) controls for extra
22
22
#' environmental effects and population structure with covariance matrix C.
23
-
#'
23
+
#'
24
24
#' (4) Standard + Covariate + Common Environment Model: y = Wa+m+g+c+e
25
-
#'
25
+
#'
26
26
#' This function will consider the following three hypothesis testing strategies which are featured in Crawford et al. (2017):
27
27
#' (1) The Normal or Z test
28
28
#' (2) Davies Method
29
29
#' (3) Hybrid Method (Z test + Davies Method)
30
-
#'
30
+
#'
31
31
#' @param X is the p x n genotype matrix where p is the number of variants and n is the number of samples. Must be a matrix and not a data.frame.
32
32
#' @param Y is the d x n matrix of d quantitative or continuous traits for n samples.
33
33
#' @param Z is the matrix q x n matrix of covariates. Must be a matrix and not a data.frame.
34
34
#' @param C is an n x n covariance matrix detailing environmental effects and population structure effects.
35
-
#' @param hybrid is a parameter detailing if the function should run the hybrid hypothesis testing procedure between the normal Z test and the Davies method. Default is TRUE.
36
35
#' @param threshold is a parameter detailing the value at which to recalibrate the Z test p values. If nothing is defined by the user, the default value will be 0.05 as recommended by the Crawford et al. (2017).
37
36
#' @param accuracy is a parameter setting the davies function numerical approximation accuracy. This parameter is not needed for the normal test. Smaller p-values than the accuracy will be zero.
38
-
#' @param test is a parameter defining what hypothesis test should be implemented. Takes on values 'normal' or 'davies'. This parameter only matters when hybrid = FALSE. If test is not defined when hybrid = FALSE, the function will automatically use test = 'normal'.
37
+
#' @param test is a parameter defining what hypothesis test should be implemented. Takes on values 'normal', 'davies', and 'hybrid'. The 'hybrid' test runs first the 'normal' test and then the 'davies' test on the significant variants.
39
38
#' @param cores is a parameter detailing the number of cores to parallelize over. It is important to note that this value only matters when the user has implemented OPENMP on their operating system. If OPENMP is not installed, then please leave cores = 1 and use the standard version of this code and software.
40
39
#' @param variantIndex is a vector containing indices of variants to be included in the computation.
41
-
#' @param phenotypeCovariance is a string parameter defining how to model the covariance between phenotypes of effects. Possible values: 'identity', 'covariance', 'homogeneous'.
42
-
#' @param logLevel is a string parameter defining the log level for the logging package.
40
+
#' @param phenotypeCovariance is a string parameter defining how to model the covariance between phenotypes of effects. Possible values: 'identity', 'covariance', 'homogeneous', 'combinatorial'.
41
+
#' @param logLevel is a string parameter defining the log level for the logging package.
43
42
#' @param logFile is a string parameter defining the name of the log file for the logging output.
0 commit comments