glmm.wald | R Documentation |
Fit a GLMM under the alternative hypothesis to perform Wald tests for association with genotypes in a plink .bed file (binary genotypes), a GDS file .gds, or a plain text file (or compressed .gz or .bz2 file).
glmm.wald(fixed, data = parent.frame(), kins = NULL, id, random.slope = NULL,
groups = NULL, family = binomial(link = "logit"), infile, snps,
method = "REML", method.optim = "AI", maxiter = 500, tol = 1e-5,
taumin = 1e-5, taumax = 1e5, tauregion = 10, center = T,
select = NULL, missing.method = "impute2mean", infile.nrow = NULL,
infile.nrow.skip = 0, infile.sep = "\t", infile.na = "NA",
snp.col = 1, infile.ncol.skip = 1, infile.ncol.print = 1,
infile.header.print = "SNP", is.dosage = FALSE, verbose = FALSE, ...)
fixed |
an object of class |
data |
a data frame or list (or object coercible by |
kins |
a known positive semi-definite relationship matrix (e.g. kinship matrix in genetic association studies) or a list of known positive semi-definite relationship matrices. The rownames and colnames of these matrices must at least include all samples as specified in the |
id |
a column in the data frame |
random.slope |
an optional column indicating the random slope for time effect used in a mixed effects model for cross-sectional data with related individuals, and longitudinal data. It must be included in the names of |
groups |
an optional categorical variable indicating the groups used in a heteroscedastic linear mixed model (allowing residual variances in different groups to be different). This variable must be included in the names of |
family |
a description of the error distribution and link function to be used in the model. This can be a character string naming a family function, a family function or the result of a call to a family function. (See |
infile |
the input file name. Note that for plink binary genotype files only the prefix without .bed, .bim or .fam should be used. Only SNP major mode recognized in the binary file. Alternatively, it can be the full name of a GDS file (including the suffix .gds) or a plain text file with some delimiters (comma, space, tab or something else), with one row for each SNP and one column for each individual. In that case, SNPs should be coded as numeric values (0/1/2 or dosages allowed, A/C/G/T coding is not recognized). There can be additional rows and columns to skip at the beginning. The order of individuals can be different from |
snps |
a vector of SNP names to be tested. |
method |
method of fitting the generalized linear mixed model. Either "REML" or "ML" (default = "REML"). |
method.optim |
optimization method of fitting the generalized linear mixed model. Either "AI", "Brent" or "Nelder-Mead" (default = "AI"). |
maxiter |
a positive integer specifying the maximum number of iterations when fitting the generalized linear mixed model (default = 500). |
tol |
a positive number specifying tolerance, the difference threshold for parameter estimates below which iterations should be stopped. Also the threshold for determining monomorphism. If a SNP has value range less than the tolerance, it will be considered monomorphic and its association test p-value will be NA (default = 1e-5). |
taumin |
the lower bound of search space for the variance component parameter |
taumax |
the upper bound of search space for the variance component parameter |
tauregion |
the number of search intervals for the REML or ML estimate of the variance component parameter |
center |
a logical switch for centering genotypes before tests. If TRUE, genotypes will be centered to have mean 0 before tests, otherwise raw values will be directly used in tests (default = TRUE). |
select |
an optional vector indicating the order of individuals in |
missing.method |
method of handling missing genotypes. Either "impute2mean" or "omit" (default = "impute2mean"). |
infile.nrow |
number of rows to read in |
infile.nrow.skip |
number of rows to skip at the beginning of |
infile.sep |
delimiter in |
infile.na |
symbol in |
snp.col |
a positive integer specifying which column in |
infile.ncol.skip |
number of columns to skip before genotype data in |
infile.ncol.print |
a vector indicating which column(s) in |
infile.header.print |
a character vector indicating column name(s) of column(s) selected to print by |
is.dosage |
a logical switch for whether imputed dosage should be used from a GDS |
verbose |
a logical switch for printing a progress bar and detailed information (parameter estimates in each iteration) for testing and debugging purpose (default = FALSE). |
... |
additional arguments that could be passed to |
if infile
is a plain text file, a data frame containing variables included in infile.header.print
and the following:
N |
number of individuals with non-missing genotypes for each SNP. |
AF |
effect allele frequency for each SNP. |
BETA |
effect size estimate for each SNP from the GLMM under the alternative hypothesis. |
SE |
standard error of the effect size estimate for each SNP. |
PVAL |
Wald test p-value for each SNP. |
converged |
a logical indicator for convergence for each SNP. |
if infile
is the prefix of plink binary files (.bed, .bim and .fam), a data frame containing the following:
CHR |
Chromosome, copied from .bim file. |
SNP |
SNP name, as supplied in |
cM |
genetic location in centi Morgans, copied from .bim file. |
POS |
physical position in base pairs, copied from .bim file. |
A1 |
allele 1, copied from .bim file. |
A2 |
allele 2, copied from .bim file. |
N |
number of individuals with non-missing genotypes for each SNP. |
AF |
effect allele frequency for each SNP. |
BETA |
effect size estimate for each SNP from the GLMM under the alternative hypothesis. |
SE |
standard error of the effect size estimate for each SNP. |
PVAL |
Wald test p-value for each SNP. |
converged |
a logical indicator for convergence for each SNP. |
if infile
is a GDS file (.gds), a data frame containing the following:
SNP |
SNP name, as supplied in |
CHR |
Chromosome, copied from .gds file. |
POS |
physical position in base pairs, copied from .gds file. |
REF |
reference allele, copied from .gds file. |
ALT |
alternate allele, copied from .gds file. |
N |
number of individuals with non-missing genotypes for each SNP. |
AF |
ALT allele frequency for each SNP. |
BETA |
effect size estimate for each SNP from the GLMM under the alternative hypothesis. |
SE |
standard error of the effect size estimate for each SNP. |
PVAL |
Wald test p-value for each SNP. |
converged |
a logical indicator for convergence for each SNP. |
Han Chen, Matthew P. Conomos
Brent, R.P. (1973) "Chapter 4: An Algorithm with Guaranteed Convergence for Finding a Zero of a Function", Algorithms for Minimization without Derivatives, Englewood Cliffs, NJ: Prentice-Hall, ISBN 0-13-022335-2.
Breslow, N.E. and Clayton, D.G. (1993) Approximate Inference in Generalized Linear Mixed Models. Journal of the American Statistical Association 88, 9-25.
Chen, H., Wang, C., Conomos, M.P., Stilp, A.M., Li, Z., Sofer, T., Szpiro, A.A., Chen, W., Brehm, J.M., Celedón, J.C., Redline, S., Papanicolaou, G.J., Thornton, T.A., Laurie, C.C., Rice, K. and Lin, X. (2016) Control forpopulation structure and relatedness for binary traits in genetic association studies via logistic mixed models. The American Journal of Human Genetics 98, 653-666.
Gilmour, A.R., Thompson, R. and Cullis, B.R. (1995) Average Information REML: An Efficient Algorithm for Variance Parameter Estimation in Linear Mixed Models. Biometrics 51, 1440-1450.
Nelder, J.A. and Mead, R. (1965) A simplex algorithm for function minimization. Computer Journal 7, 308-313.
Yang, J., Lee, S.H., Goddard, M.E. and Visscher, P.M. (2011) GCTA: A Tool for Genome-wide Complex Trait Analysis. The American Journal of Human Genetics 88, 76-82.
Zhou, X. and Stephens, M. (2012) Genome-wide efficient mixed-model analysis for association studies. Nature Genetics 44, 821-824.
glmmkin
, glmm.score
data(example)
attach(example)
snps <- c("SNP10", "SNP25", "SNP1", "SNP0")
plinkfiles <- strsplit(system.file("extdata", "geno.bed", package = "GMMAT"),
".bed", fixed = TRUE)[[1]]
glmm.wald(disease ~ age + sex, data = pheno, kins = GRM, id = "id",
family = binomial(link = "logit"), infile = plinkfiles, snps = snps)
if(requireNamespace("SeqArray", quietly = TRUE) && requireNamespace("SeqVarTools",
quietly = TRUE)) {
infile <- system.file("extdata", "geno.gds", package = "GMMAT")
glmm.wald(disease ~ age + sex, data = pheno, kins = GRM, id = "id",
family = binomial(link = "logit"), infile = infile, snps = snps)
}
infile <- system.file("extdata", "geno.txt", package = "GMMAT")
glmm.wald(disease ~ age + sex, data = pheno, kins = GRM, id = "id",
family = binomial(link = "logit"), infile = infile, snps = snps,
infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3,
infile.header.print = c("SNP", "Allele1", "Allele2"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.