- pheno
Data frame where the first column is the line name (gid). The remaining columns should be a phenotype to test.
- geno
Data frame with the marker names in the first column. The second and third columns contain the chromosome and map position.
Columns 4 and higher contain the marker scores for each line, coded as [-1, 0, 1] = [aa, Aa, AA].
- ZETA
A list of covariance (relationship) matrix (K: \(m \times m\)) and its design matrix (Z: \(n \times m\)) of random effects.
Please set names of list "Z" and "K"! You can use more than one kernel matrix.
For example,
ZETA = list(A = list(Z = Z.A, K = K.A), D = list(Z = Z.D, K = K.D))
- Z.A, Z.D
Design matrix (\(n \times m\)) for the random effects. So, in many cases, you can use the identity matrix.
- K.A, K.D
Different kernels which express some relationships between lines.
For example, K.A is additive relationship matrix for the covariance between lines, and K.D is dominance relationship matrix.
package.MM
The package name to be used when solving mixed-effects model. We only offer the following three packages:
"RAINBOWR", "MM4LMM" and "gaston". Default package is `gaston`.
See more details at EM3.general
.
covariate
A \(n \times 1\) vector or a \(n \times p _ 1\) matrix. You can insert continuous values, such as other traits or genotype score for special markers.
This argument is regarded as one of the fixed effects.
covariate.factor
A \(n \times p _ 2\) dataframe. You should assign a factor vector for each column.
Then RGWAS changes this argument into model matrix, and this model matrix will be included in the model as fixed effects.
structure.matrix
You can use structure matrix calculated by structure analysis when there are population structure.
You should not use this argument with n.PC > 0.
interaction.with.SNPs
A \(m \times q\) matrix. Interaction between each SNP and this matrix will also be tested.
For example, principal components of genomic relationship matrix can be used as this matrix to test the interaction between SNPs and the genetic background.
Or you can test the interaction with some environmental factors by inputting some omics data that represent the environment. (Test inluding GxE effects.)
interaction.mat.method
Method to compute `interaction.with.SNPs` when `interaction.with.SNPs` is NULL.
We offer the following four different methods:
"PCA": Principal component analysis for genomic relationship matrix (`K` in `ZETA`) using `prcomp` function
"LDA": Linear discriminant analysis with independent variables as genomic relationship matrix (`K` in `ZETA`)
and dependent variables as some group information (`interaction.group`) using `lda` function
"GROUP": Dummy variables for some group information (`interaction.group`)
"DAPC": Perform LDA to the principal components of PCAfor genomic relationship matrix (`K` in `ZETA`)
using `dapc` function in `adgenet` package. See Jombart et al., 2010 and dapc
for more details.
n.interaction.element
Number of elements (variables) that are included in the model as interaction term for `interaction.with.SNPs`.
If `interaction.with.SNPs = NULL` and `n.interaction.element = 0`, then the standard SNP-based GWAS will be performed by `RGWAS.normal` function.
interaction.group
When you use "LDA", "GROUP", or "DAPC", the information on groups (e.g., subgroups for the population) will be required.
You can set a vector of group names (or clustering ids) for each genotype as this argument. This vector should be factor.
n.interaction.group
When `interaction.group = NULL`, `interaction.group` will be automatically determined by using k-medoids method (`pam` function in `cluster` package).
You should specify the number of groups by this argument to decide `interaction.group`.
interaction.group.method
The method to perform clustering when `interaction.group = NULL`.
We offer the following two methods "find.clusters" and "pam".
"find.clusters" performs `adegenet::find.clusters` functions to conduct successive K-means clustering,
"pam" performs `cluster::pam` functions to conduct k-medoids clustering.
See find.clusters
and pam
for more details.
n.PC.dapc
Number of principal components to be used for `adegenet::find.clusters` or `adegenet::dapc` functions.
test.method.interaction
Method for how to test SNPs and the interactions between SNPs and the genetic background.
We offer three methods as follows:
"simultaneous": All effects (including SNP efects) are tested simultanously.
"snpSeparate": SNP effects are tested as one effect, and the other interaction effects are simulateneously.
"oneByOne": All efects are tested separately, one by one.
n.PC
Number of principal components to include as fixed effects. Default is 0 (equals K model).
min.MAF
Specifies the minimum minor allele frequency (MAF).
If a marker has a MAF less than min.MAF, it is assigned a zero score.
P3D
When P3D = TRUE, variance components are estimated by REML only once, without any markers in the model.
When P3D = FALSE, variance components are estimated by REML for each marker separately.
n.core
Setting n.core > 1 will enable parallel execution on a machine with multiple cores.
This argument is not valid when `parallel.method = "furrr"`.
parallel.method
Method for parallel computation. We offer three methods, "mclapply", "furrr", and "foreach".
When `parallel.method = "mclapply"`, we utilize pbmclapply
function in the `pbmcapply` package
with `count = TRUE` and mclapply
function in the `parallel` package with `count = FALSE`.
When `parallel.method = "furrr"`, we utilize future_map
function in the `furrr` package.
With `count = TRUE`, we also utilize progressor
function in the `progressr` package to show the progress bar,
so please install the `progressr` package from github (https://github.com/HenrikBengtsson/progressr).
For `parallel.method = "furrr"`, you can perform multi-thread parallelization by
sharing memories, which results in saving your memory, but quite slower compared to `parallel.method = "mclapply"`.
When `parallel.method = "foreach"`, we utilize foreach
function in the `foreach` package
with the utilization of makeCluster
function in `parallel` package,
and registerDoParallel
function in `doParallel` package.
With `count = TRUE`, we also utilize setTxtProgressBar
and
txtProgressBar
functions in the `utils` package to show the progress bar.
We recommend that you use the option `parallel.method = "mclapply"`, but for Windows users,
this parallelization method is not supported. So, if you are Windows user,
we recommend that you use the option `parallel.method = "foreach"`.
sig.level
Significance level for the threshold. The default is 0.05.
method.thres
Method for detemining threshold of significance. "BH" and "Bonferroni are offered.
plot.qq
If TRUE, draw qq plot.
plot.Manhattan
If TRUE, draw manhattan plot.
plot.method
If this argument = 1, the default manhattan plot will be drawn.
If this argument = 2, the manhattan plot with axis based on Position (bp) will be drawn.
Also, this plot's color is changed by all chromosomes.
plot.col1
This argument determines the color of the manhattan plot.
You should substitute this argument as color vector whose length is 2.
plot.col1[1] for odd chromosomes and plot.col1[2] for even chromosomes
plot.col2
Color of the manhattan plot. color changes with chromosome and it starts from plot.col2 + 1
(so plot.col2 = 1 means color starts from red.)
plot.type
This argument determines the type of the manhattan plot. See the help page of "plot".
plot.pch
This argument determines the shape of the dot of the manhattan plot. See the help page of "plot".
saveName
When drawing any plot, you can save plots in png format. In saveName, you should substitute the name you want to save.
When saveName = NULL, the plot is not saved.
main.qq
The title of qq plot. If this argument is NULL, trait name is set as the title.
main.man
The title of manhattan plot. If this argument is NULL, trait name is set as the title.
plot.add.last
If saveName is not NULL and this argument is TRUE, then you can add lines or dots to manhattan plots.
However, you should also write "dev.off()" after adding something.
return.EMM.res
When return.EMM.res = TRUE, the results of equation of mixed models are included in the result of RGWAS.
optimizer
The function used in the optimization process.
We offer "optim", "optimx", and "nlminb" functions.
This argument is only valid when `package.MM = 'RAINBOWR'`.
thres
If thres = TRUE, the threshold of the manhattan plot is included in the result of RGWAS.
When return.EMM.res or thres is TRUE, the results will be "list" class.
skip.check
As default, RAINBOWR checks the type of input data and modifies it into the correct format.
However, it will take some time, so if you prepare the correct format of input data, you can skip this procedure
by setting `skip.check = TRUE`.
verbose
If this argument is TRUE, messages for the current steps will be shown.
verbose2
If this argument is TRUE, welcome message will be shown.
count
When count is TRUE, you can know how far RGWAS has ended with percent display.
time
When time is TRUE, you can know how much time it took to perform RGWAS.