b0a4776d |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/GxE.test.R
\name{GxE.test}
\alias{GxE.test}
|
c60ab145 |
\title{A function to run a test of interaction between a collection of SNPs and exposures (experimental).}
|
b0a4776d |
\usage{
GxE.test(
snp.cols,
preprocessed.list,
|
c60ab145 |
null.mean.vec = c(0, 0),
null.sd.vec = c(1, 1),
|
b0a4776d |
n.permutes = 10000,
n.different.snps.weight = 2,
n.both.one.weight = 1,
|
cc5fbdbc |
weight.function.int = 2
|
b0a4776d |
)
}
\arguments{
|
c60ab145 |
\item{snp.cols}{An integer vector specifying the columns in the input data
containing the SNPs to be tested.}
|
b0a4776d |
|
c60ab145 |
\item{preprocessed.list}{The initial list produced by function
\code{preprocess.genetic.data}.}
|
b0a4776d |
|
c60ab145 |
\item{null.mean.vec}{A vector of estimated null means for each
of the components of the E-GADGETS fitness score.
It should be set to the values of the "null.mean" element of the file
"null.mean.sd.info.rds" for the observed data, that is saved by the
\code{run.gadgets} function.}
|
b0a4776d |
|
c60ab145 |
\item{null.sd.vec}{A vector of estimated null means for each
of the components of the E-GADGETS fitness score.
It should be set to the values of the "null.se" element of the file
"null.mean.sd.info.rds" for the observed data, that is saved by the
\code{run.gadgets} function.}
|
b0a4776d |
|
c60ab145 |
\item{n.permutes}{The number of permutations on which to base the test.
Defaults to 10000.}
|
b0a4776d |
|
c60ab145 |
\item{n.different.snps.weight}{The number by which the number of different
SNPs between a case and complement/unaffected sibling is multiplied in
computing the family weights. Defaults to 2.}
\item{n.both.one.weight}{The number by which the number of SNPs equal to 1
in both the case and complement/unaffected sibling is multiplied in computing
the family weights. Defaults to 1.}
\item{weight.function.int}{An integer used to assign family weights.
Specifically, we use \code{weight.function.int} in a function that takes the
weighted sum of the number of different SNPs and SNPs both equal to one as an
argument, denoted as x, and returns a family weight equal to
\code{weight.function.int}^x. Defaults to 2.}
|
b0a4776d |
}
\value{
|
cc5fbdbc |
A list of three elements:
|
b0a4776d |
\describe{
\item{pval}{The p-value of the test.}
\item{obs.fitness.score}{The fitness score from the observed data}
|
c60ab145 |
\item{perm.fitness.scores}{A vector of fitness scores for the
permuted datasets.}
|
b0a4776d |
}
}
\description{
This function runs a permutation based test run a test of
|
c60ab145 |
interaction between a collection of SNPs and exposure variables.
|
b0a4776d |
}
\examples{
data(case.gxe)
data(dad.gxe)
data(mom.gxe)
data(exposure)
|
2f41e630 |
data(snp.annotations.mci)
|
07780556 |
pp.list <- preprocess.genetic.data(case.gxe, father.genetic.data = dad.gxe,
mother.genetic.data = mom.gxe,
|
2f41e630 |
ld.block.vec = rep(6, 4),
categorical.exposures = exposure)
|
cc5fbdbc |
run.gadgets(pp.list, n.chromosomes = 5, chromosome.size = 3,
results.dir = "tmp_gxe", cluster.type = "interactive",
registryargs = list(file.dir = "tmp_reg_gxe", seed = 1300),
n.islands = 8, island.cluster.size = 4,
n.migrations = 1)
|
b0a4776d |
|
2f41e630 |
combined.res <- combine.islands('tmp_gxe', snp.annotations.mci, pp.list, 1)
|
b0a4776d |
top.snps <- as.vector(t(combined.res[1, 1:3]))
set.seed(10)
|
2f41e630 |
GxE.test.res <- GxE.test(top.snps, pp.list)
|
b0a4776d |
|
07780556 |
unlink('tmp_gxe', recursive = TRUE)
unlink('tmp_reg_gxe', recursive = TRUE)
|
b0a4776d |
}
|