fitQTL: Fit multiple QTL model

View source: R/fitQTL.R

fitQTLR Documentation

Fit multiple QTL model

Description

Fit multiple QTL model

Usage

fitQTL(
  data,
  trait,
  qtl,
  epistasis = NULL,
  polygenic = FALSE,
  params = list(burnIn = 100, nIter = 5000),
  CI.prob = 0.9
)

Arguments

data

variable of class diallel_geno_pheno

trait

name of trait

qtl

data frame, see Details

epistasis

optional data frame, see Details

polygenic

TRUE/FALSE whether to include additive polygenic effect

params

list containing the number of burn-in (burnIn) and total iterations (nIter)

CI.prob

probability for Bayesian credible interval

Details

Argument qtl is a data frame with columns marker and dominance to specify the marker name and highest order effect (1 = additive, 2 = digenic dominance, 3 = trigenic dominance, 4 = quadrigenic dominance). All effects up to the value in dominance are included. Optional argument epistasis is a data frame with columns marker1 and marker2, where each row specifies an additive x additive epistatic interaction. The number of burn-in and total iterations in params can be estimated using set_params. Parameter CI.prob sets the probability (e.g., 0.90, 0.95) for the Bayesian credible interval for the estimated effects (to disable plotting of the CI, use CI.prob=NULL).

Value

List containing

deltaDIC

DIC relative to model with GCA but no QTL effects

resid

residuals

var

matrix with proportion of variance for the effects

effects

list with two matrices, additive and digenic, with markers on the rows and effects on the columns

plots

list of ggplot objects, one for each marker, containing elements additive and digenic. The digenic plot has digenic effects above the diagonal and the sum of additive and digenic effects below the diagonal.

Examples

## Not run: 
## getting minimum burnIn and nIter for one qtl
set_params(data = diallel_example, 
           trait = "tuber_shape", 
           q = 0.05, 
           r = 0.025, 
           qtl = data.frame(marker="solcap_snp_c2_25522",dominance=2),
           polygenic = TRUE)
           
## additive effects
fit1 <- fitQTL(data = diallel_example, 
               trait = "tuber_shape", 
               params = list(burnIn=100,nIter=5000), 
               qtl = data.frame(marker="solcap_snp_c2_25522",dominance=1),
               CI.prob = 0.9)

## additive + digenic dominance effects                            
fit2 <- fitQTL(data = diallel_example, 
               trait = "tuber_shape", 
               params = list(burnIn=100,nIter=5000), 
               qtl = data.frame(marker="solcap_snp_c2_25522",dominance=2),
               CI.prob=0.9)
               
## getting minimum burnIn and nIter for two qtl with epistasis
set_params(data = diallel_example, 
           trait = "tuber_shape", 
           q = 0.05, 
           r = 0.025, 
           qtl = data.frame(marker=c("PotVar0099535","solcap_snp_c2_25522"),
                            dominance=c(2,1)),
           epistasis = data.frame(marker1="solcap_snp_c2_25522",marker2="PotVar0099535"),
           polygenic = TRUE)
           
## additive + digenic dominance effects for both QTL
fit3 <- fitQTL(data = diallel_example, trait = "tuber_shape", 
               params = list(burnIn=100,nIter=5000),
               qtl = data.frame(marker=c("PotVar0099535","solcap_snp_c2_25522"),
                                dominance=c(2,2)), 
               polygenic = TRUE, CI.prob = 0.9)
               
## additive + digenic dominance effects for both QTL + their epistatic effects
fit4 <- fitQTL(data = diallel_example, trait = "tuber_shape", 
               params = list(burnIn=100,nIter=5000),
               qtl = data.frame(marker=c("PotVar0099535","solcap_snp_c2_25522"),
                                dominance=c(2,2)), 
               epistasis = data.frame(marker1="solcap_snp_c2_25522",marker2="PotVar0099535"),
               polygenic = TRUE, CI.prob = 0.9)
               
## additive + digenic dominance effects for three QTL + all their epistatic effects
fit5 <- fitQTL(data = diallel_example, trait = "tuber_shape", 
               params = list(burnIn=100,nIter=5000),
               qtl = data.frame(marker=c("PotVar0099535",
                                         "solcap_snp_c1_6427",
                                         "solcap_snp_c2_25522"),
                                dominance=c(2,2,2)), 
               epistasis = data.frame(marker1=c("solcap_snp_c2_25522",
                                                "solcap_snp_c2_25522",
                                                "PotVar0099535"),
                                      marker2=c("PotVar0099535",
                                                "solcap_snp_c1_6427",
                                                "solcap_snp_c1_6427")),
               polygenic = TRUE, CI.prob = 0.9)


## End(Not run)
                 

jendelman/diaQTL documentation built on Jan. 27, 2024, 6:39 a.m.