Learn R Programming

cape (version 2.0.2)

singlescan: Run the single-variant regression for all phenotypes

Description

This function runs the single-variant regression for either raw phenotypes or eigentraits using a kinship correction if desired. It also performs permutation testing and calculates significance thresholds.

Usage

singlescan(data.obj, geno.obj = NULL, n.perm = NULL, covar = NULL, alpha = c(0.01, 0.05), scan.what = c("eigentraits", "raw.traits"), use.kinship = FALSE, kin.full.geno = FALSE, run.parallel = TRUE, sample.kinship = FALSE, num.kin.samples = 1000, n.per.sample = 10, verbose = FALSE, overwrite.alert = TRUE, n.cores = 2)

Arguments

data.obj
The object in which all results are stored. See read.population.
geno.obj
The object in which the genotype matrix and marker information are stored. See read.geno.
n.perm
The number of permutations to be performed.
covar
A vector of marker names to be used as covariates. See pheno2covar and marker2covar.
alpha
A vector of alpha values for which significant standardized effect values will be calculated.
scan.what
A character string indicating uniquely whether raw traits or eigentraits should be tested.
use.kinship
A logical value indicating whether a kinship correction should be implemented.
kin.full.geno
A logical value indicating whether the entire genotype matrix should be used to calculate kinship corrections. If FALSE, only the subset of genetic markers being scanned will be used to calculate kinship corrections.
run.parallel
A logial value indicating whether to run calculations in parallel.
sample.kinship
A logical value indicating whether kinship matrices should be sampled (TRUE) or calculated directly (FALSE). Sampling kinshp matrices can be faster in the case of very large genotype matrices.
num.kin.samples
If sample.kinship is TRUE, this integer indicates how many samples should be used to calculate kinship matrices.
n.per.sample
If sample.kinship is TRUE, this integer indicates how many markers should be used in each sample of the genotype matrix for calculating kinship matrices.
verbose
A logical value indicating whether the progress of the scan should be printed to the screen.
overwrite.alert
If TRUE, this triggers an alert warning the user that the output of this function should be saved separately from the data.obj.
n.cores
An integer specifying the number of cores to be used in parallel processing.

Value

IMPORTANT NOTE: Prior versions of this function modified the data.obj. The new version creates a separate singlescan.obj, and the output of this function should NOT be assigned to the data.obj. The singlescan.obj is a list containing the following four elements:
alpha
A vector containing the alpha values requested by the user.
alpha.thresh
A list containing the same number of elements as alpha values requested. For each value, a significance threshold in terms of t statistic is given.
singlescan.results
A list in which each element corresponds to one trait being scanned. Each element contains a table with the results from the single-marker scan. The table includes, in columns, the effect size marker, the standard error of the effect size, the t statistic from the regression, and the p value. There is one row for each marker.

References

Carter, G. W., Hays, M., Sherman, A., & Galitski, T. (2012). Use of pleiotropy to model genetic interactions in a population. PLoS genetics, 8(10), e1003010. doi:10.1371/journal.pgen.1003010

See Also

plotSinglescan