Description Usage Arguments Value Examples
View source: R/solarPolygenic.R
The polygenic analysis is conducted in the following sequence:
export data to a directory by df2solar
function,
form a SOLAR call with a list of settings and options,
execute SOLAR by solar
function,
parse output files and
store results in an object of solarPolygenic
class (see solarPolygenicClass
).
1 2 3 4 |
formula |
an object of class |
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 |
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. Currently, it does not work for unrelated individuals (SOLAR issue). |
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.
It could be convenient to indicate covariates in the SOLAR format,
for example, |
covtest |
a logical value, indicating whether to test the significance of the fixed effects (covariates).
Likelihood ratio test (LRT) is used by SOLAR.
|
screen |
a logical value, indicating whether to screen the fixed effects (covariates).
|
household |
a logical value, saying to forcedly include or exclude the house-hold effect.
The default value is |
transforms |
a named vector of characters, indicating the transformations to be applied to traits.
A list of available transforms is returned by function |
alpha |
a number between 0 an 1, that is the value of
|
polygenic.settings |
A vector of characters, that contains SOLAR commands to be executed just before calling |
polygenic.options |
A character of options to be passed to |
verbose |
An non-negative integer of the verbose level.
The default value is |
... |
additional parameters to be passed to other functions called inside of |
An object of solarPolygenic
class. See solarPolygenicClass
.
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 30 31 32 33 34 35 36 | ### load data and check out ID names
data(dat30)
matchIdNames(names(dat30))
## Not run:
### basic (univariate) polygenic model
mod <- solarPolygenic(trait1 ~ age + sex, dat30)
### (univariate) polygenic model with parameters
mod <- solarPolygenic(trait1 ~ age + sex, dat30, covtest = TRUE)
mod$cf # look at test statistics for covariates
### basic (bivariate) polygenic model
mod <- solarPolygenic(trait1 + trait2 ~ 1, dat30)
mod$vcf # look at variance components
### (bivariate) polygenic model with trait specific covariates
mod <- solarPolygenic(trait1 + trait2 ~ age + sex(trait1), dat30)
### (bivariate) polygenic model with a test of the genetic correlation
mod <- solarPolygenic(trait1 + trait2 ~ 1, dat30, polygenic.options = "-testrhog")
mod$lf # look at a p-value of the test
### transforms for (univariate) polygenic model
mod <- mod <- solarPolygenic(trait1 ~ 1, dat30, transforms = "log")
### transforms for (bivariate) polygenic model
mod <- solarPolygenic(trait1 + trait2 ~ 1, dat30,
transforms = c(trait1 = "log", trait2 = "inormal"))
### SOLAR format of introducing covariates
mod <- solarPolygenic(traits = "trait1", covlist = "age^1,2,3#sex", data = dat30)
mod$cf # 8 covariate terms will be printed
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.