Learn R Programming

solarius (version 0.2.3)

solarAssoc: Run association analysis.

Description

The association analysis is conducted in the following sequence: parse input files of SNP markers, export data to a directory by df2solar function, run the polygenic analysis in a directory, run the association analysis on the top of the polygenic analysis, parse output files and store results in an object of solarAssoc class (see solarAssocClass).

Usage

solarAssoc(formula, data, dir, kinship, traits, covlist = "1", snpformat,
  snpdata, snpcovdata, snpmap, snplist, snpind, genocov.files, snplists.files,
  snpmap.files, assoc.outformat = c("df", "outfile", "outfile.gz"),
  assoc.outdir, cores = getOption("cores"), ..., verbose = 0)

Arguments

formula
an object of class formula or one that can be coerced to that class. It is a symbolic description of fixed effects (covariates) to be fitted.
data
A data frame containing the variables in the model, including ID fields needed to construct random effects: genetic and house-hold (both optional). Other classes such as list, environment or object coercible by as.data.frame to a data frame a
dir
an optional character string, the name of directory, where SOLAR performs the analysis. In this case, the analysis within related input/output files is conducted in the given folder instead of a temporary one (the default work flow).
kinship
A matrix of the kinship coefficients (custom kinship matrix). The IDs are required to be in row and column names.
traits
a vector of characters to specify trait(s) in the model. It is alternative to the formula interface.
covlist
a vector of characters to specify fixed effects (covariates) in the model. It is alternative to the formula interface. The default value is "1".
snpformat
a character, the format of SNP data passsed by snpdata argument. Currently, this argument is not used.
snpdata
A matrix of SNP data. SNPs are given in the columns, and individuals correspond to the rows. The IDs of individuals are required to be in row and column names.
snpcovdata
A matrix of SNP data, which are converted to covariates (numeric format). SNPs are given in the columns, and individuals correspond to the rows. The IDs of individuals are required to be in row and column names.
snpmap
A data.frame of annotation for SNPs.
snplist
a vector of characters, the names of SNPs to be used in the analysis. This argument may be used when a subset of SNPs is of the interest.
snpind
a vector of positive integers, the indices of SNPs to be used in the analysis. This argument may be used when a subset of SNPs is of the interest.
genocov.files
A vector of characters, the file paths to genocov SOLAR files.
snplists.files
A vector of characters, the file paths to snplists SOLAR files.
snpmap.files
A vector of characters (optional), the file paths to snpmap SOLAR files.
assoc.outformat
A character, the output format. Possible values are "df", "outfile" and "outfile.gz". Currently, the only supported output format is "df". That means the table of results is stored in snpf s
assoc.outdir
a character, the path to the output directory. Currently, this argument is not used.
cores
A positive integer, the number of cores for parallel computing. The default value is taken from getOption("cores"). If the default value is NULL then the number of cores is 1.
...
Arguments to be passed to solarPolygenic function. For example, one of such arguments may be polygenic.settings = "option EnableDiscrete 0". Arguments of solarMultipoint, w
verbose
An non-negative integer of the verbose level. The default value is 0.

Examples

Run this code
### load data
data(dat50)
dim(phenodata)
dim(kin)
dim(genodata)

### basic (univariate) association model with a custom kinship
mod <- solarAssoc(trait~age+sex, phenodata,
  kinship = kin, snpdata = genodata)
mod$snpf # table of results for 50 SNPs

Run the code above in your browser using DataLab