Performs Single Marker Regressions Using BGData Objects
Implements single marker regressions. The regression model includes all the
covariates specified in the right-hand-side of the formula plus one
column of the genotypes at a time. The data from the association tests is
obtained from a BGData object.
GWAS(formula, data, method = "lsfit", i = seq_len(nrow(geno(data))),
j = seq_len(ncol(geno(data))), chunkSize = 5000L,
nCores = getOption("mc.cores", 2L), verbose = FALSE, ...)formula |
The formula for the GWAS model without including the marker, e.g.
|
data |
A |
method |
The regression method to be used. Currently, the following methods are
implemented: |
i |
Indicates which rows of the genotypes should be used. Can be integer, boolean, or character. By default, all rows are used. |
j |
Indicates which columns of the genotypes should be used. Can be integer, boolean, or character. By default, all columns are used. |
chunkSize |
The number of columns of the genotypes that are brought into physical
memory for processing per core. If |
nCores |
The number of cores (passed to |
verbose |
Whether progress updates will be posted. Defaults to |
... |
Additional arguments for chunkedApply and regression method. |
The same matrix that would be returned by coef(summary(model)).
file-backed-matrices for more information on file-backed
matrices. multi-level-parallelism for more information on
multi-level parallelism. BGData-class for more information on
the BGData class. lsfit,
lm, lm.fit,
glm, lmer, and
SKAT for more information on regression methods.
# Restrict number of cores to 1 on Windows
if (.Platform$OS.type == "windows") {
options(mc.cores = 1)
}
# Load example data
bg <- BGData:::loadExample()
# Perform a single marker regression
res1 <- GWAS(formula = FT10 ~ 1, data = bg)
# Draw a Manhattan plot
plot(-log10(res1[, 4]))
# Use lm instead of lsfit (the default)
res2 <- GWAS(formula = FT10 ~ 1, data = bg, method = "lm")
# Use glm instead of lsfit (the default)
y <- pheno(bg)$FT10
pheno(bg)$FT10.01 <- y > quantile(y, 0.8, na.rm = TRUE)
res3 <- GWAS(formula = FT10.01 ~ 1, data = bg, method = "glm")
# Perform a single marker regression on the first 50 markers (useful for
# distributed computing)
res4 <- GWAS(formula = FT10 ~ 1, data = bg, j = 1:50)Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.