Description Usage Arguments Details Value See Also Examples
View source: R/wga_stream.GxE.R
Performs analyses for a scan of SNPs.
1 | GxE.scan(snp.list, pheno.list, op=NULL)
|
snp.list |
See |
pheno.list |
See |
op |
See details for this list of options. The default is NULL. |
For proper anlaysis of imputed SNPs, the only option that should be used is
model
=3 (snp.score
)
See the vignette vignette_GxE
for examples of running this function.
To use this function, the data must be stored in files as defined in
snp.list
and pheno.list
. See the examples on how to
create these lists. The format of the genotype data must be a format where the SNPs
are rows (snp.list$format
="impute", "ldat", "tped") or a format where either the GLU software
or PLINK software can read and transform the data.
Options for setting the path to GLU or PLINK are found in snp.list
.
The genotype data is read in from the file
snp.list$file
, and the variables for the main effects and interactions
are read in from the file pheno.list$file
.
The subjects to be included in the analysis are the subjects with matching ids in the phenotype and
genotype data.
Users can easily run their own customized scan by setting the option model
to 0 and setting
the option scan.func
to their own scan function. The vignette "vignette_GxE" has examples of
user-defined scans.
Options list op:
Below are the names for the options list op
. All names have default values
if they are not specified.
model
0-4, where 1 = snp.logistic
, 2 = additive.test
,
3 = snp.score
, 4 = snp.matched
and 0 is for a user defined
function. The default is 1.
out.file
File name to save the results. If NULL, then the output file will be
created in the working directory as
paste(getwd(), "/GxE.scan.output.txt", sep="")
.
scan.func.op
List of specific options for the scan function. For model
=1-4, see
snp.logistic
, additive.test
,
snp.score
or snp.matched
for these options.
The default is NULL.
geno.counts
0 or 1 to write the genotype frequency counts to the output file.
The default is 1.
geno.MAF
0 or 1 to write the SNP MAF to the output file.
The default is 1.
geno.missRate
0 or 1 to write the SNP missing rate to the output file.
The default is 1.
output.methods
Character vector of "UML", "CML", "EB" to only output results for
specific methods. This option is only for snp.logistic
and snp.score
.
The default is c("UML", "CML", "EB").
output.parms
0 or 1 to output parameter estimates.
This option is only for snp.logistic
and snp.score
.
The default is 0.
output.sandwich
0 or 1 to output sandwich covariance estimates.
This option is only for snp.score
.
The default is 0.
Advanced options:
scan.func
(For model
= 0). The name of the user-defined scan function.
This function must have 2 input arguments and return a named list or named vector.
See the vignette "vignette_GxE" for examples.
The default is NULL.
scan.setup.func
(For model
= 0). NULL or the name of the user-defined function
called after the phenotype data is read in and before the genotype data is read. This function
is not required for model
= 0.
This function must have 2 input arguments and return NULL or a named list.
See the vignette "vignette_GxE" for examples.
The default is NULL.
Output variable names:
The output file will contain columns for the SNP, MAF, missing rate, and genotype frequency counts. Other
columns are specific for the specified model
. A column denoted by *.Inter.Pvalue
is a p-value
from a Wald test involving the interaction terms of the SNP and exposure variables.
A column denoted by *.Omnibus.Pvalue
is a p-value
from a Wald test involving the main effect of the SNP and interaction terms of the SNP and exposure variables.
The name of the output file containing the results. See the option out.file
.
See details for the column names in the output file.
GxE.scan.partition
, GxE.scan.combine
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # Define the list for the genotype data.
snp.list <- list()
snp.list$file <- system.file("sampleData", "geno_data.ldat.gz", package="CGEN")
snp.list$file.type <- 7
snp.list$delimiter <- "\t"
snp.list$in.miss <- " "
# Only process the first 5 SNPs in the file
snp.list$start.vec <- 1
snp.list$stop.vec <- 6
# Define pheno.list
pheno.list <- list()
pheno.list$file <- system.file("sampleData", "Xdata.txt", package="CGEN")
pheno.list$file.type <- 3
pheno.list$delimiter <- "\t"
pheno.list$id.var <- "id"
# Define the variables in the model
pheno.list$response.var <- "case.control"
pheno.list$strata.var <- "ethnic.group"
pheno.list$main.vars <- c("age.group", "oral.years", "n.children")
pheno.list$int.vars <- "n.children"
# Define the list of options
op <- list(out.file="out.txt")
# For this model, all variables are continuous
# temp <- GxE.scan(snp.list, pheno.list, op=op)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.