neiGWAS {rNeighborGWAS} | R Documentation |
Genome-wide association mapping of neighbor effects
Description
A function to test neighbor effects for each marker and to calculate p-values at a given reference scale.
Usage
neiGWAS(
geno,
pheno,
gmap,
smap,
scale,
addcovar = NULL,
grouping = rep(1, nrow(smap)),
response = c("quantitative", "binary"),
model = c("lmm", "lm"),
n_core = 1L
)
Arguments
geno |
An individual x marker matrix. Bialleles (i.e., A or a) must be converted into -1 or 1 digit. |
pheno |
A numeric vector including phenotypes for individuals |
gmap |
A matrix or data.frame including chromosome numbers in the first column, and SNP positions in the second column. |
smap |
A matrix showing a spatial map for individuals. The first and second column include spatial points along an x-axis and y-axis, respectively. |
scale |
A numeric scalar indicating the maximum spatial distance between a focal individual and neighbors to define neighbor effects. |
addcovar |
An optional matrix including additional non-genetic covariates. It contains no. of individuals x no. of covariates. |
grouping |
A positive integer vector assigning each individual to a group. This argument can be useful when a "smap" contains different experimental replicates. Default setting means that all individuals are belong to a single group. |
response |
An option to select if the phenotype is a |
model |
An option to select linear mixed model |
n_core |
No. of cores for a multi-core computation. This does not work for Windows OS. Default is a single-core computation. |
Details
This function calls a mixed model via the gaston
package. If "lmm"
with "binary"
is selected, p-values are based on Wald tests.
This is because the logistic mixed model is based on a pseudo-likelihood and thus likelihood ratio tests are not applicable. See Chen et al. (2016) for the theory.
Value
A data.frame including the chromosome number, marker position, and p-values.
chr
Chromosome numberpos
Marker positionp
p-value by a likelihood ratio test between models with or without neighbor effects
Author(s)
Yasuhiro Sato (sato.yasuhiro.36c@kyoto-u.jp)
References
Chen H, Wang C, Conomos M. et al. (2016) Control for population structure and relatedness for binary traits in genetic association studies via logistic mixed models. The American Journal of Human Genetics 98: 653-666.
Examples
set.seed(1)
g <- matrix(sample(c(-1,1),100*1000,replace = TRUE),100,1000)
gmap <- cbind(c(rep(1,nrow(g)/2),rep(2,nrow(g)/2)),c(1:ncol(g)))
x <- runif(nrow(g),1,100)
y <- runif(nrow(g),1,100)
smap <- cbind(x,y)
grouping <- c(rep(1,nrow(g)/2),rep(2,nrow(g)/2))
pheno <- nei_simu(geno=g,smap=smap,scale=44,grouping=grouping,n_causal=50,pveB=0.4,pve=0.8)
fake_nei <- list()
fake_nei[[1]] <- g
fake_nei[[2]] <- gmap
fake_nei[[3]] <- smap
fake_nei[[4]] <- data.frame(pheno,grouping)
names(fake_nei) <- c("geno","gmap","smap","pheno")
scale <- 43
gwas_out <- neiGWAS(geno=fake_nei$geno, pheno=fake_nei$pheno[,1],
gmap=fake_nei$gmap, smap=fake_nei$smap,
scale=scale, addcovar=as.matrix(fake_nei$pheno$grouping),
grouping=fake_nei$pheno$grouping)
gaston::manhattan(gwas_out)
gaston::qqplot.pvalues(gwas_out$p)