PVE: Function to determine the percentage variance explained (PVE)...

Description Usage Arguments Value Examples

View source: R/polyqtlR_functions.R

Description

This function builds a (maximal) QTL model from previously detected QTL peaks and outputs the percentage variance explained (PVE) of the full QTL model and all sub-models. It uses a similar approach to the fitting of genetic co-factors in the function QTLscan. The PVE is very similar to but not exactly equal to the adjusted R2 returned in QTLscan at each position (and note: in the former case, these R2 values are per-locus, while this function can estimate the PVE combined over multiple loci). The discrepancy has to do with how PVE is calculated using the formula 100(1 - RSS0/RSS1), where RSS0 and RSS1 are the residual sums of squares of the NULL and QTL models, respectively.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
PVE(
  IBD_list,
  Phenotype.df,
  genotype.ID,
  trait.ID,
  block = NULL,
  QTL_df = NULL,
  prop_Pheno_rep = 0.5,
  log = NULL,
  verbose = FALSE
)

Arguments

IBD_list

List of IBD probabilities

Phenotype.df

A data.frame containing phenotypic values

genotype.ID

The colname of Phenotype.df that contains the offspring identifiers (F1 names)

trait.ID

The colname of Phenotype.df that contains the response variable to use in the model

block

The blocking factor to be used, if any (must be colname of Phenotype.df). By default NULL, in which case no blocking structure (for unreplicated experiments)

QTL_df

A 2-column data frame of previously-detected QTL; column 1 gives linkage group identifiers, column 2 specifies the cM position of the QTL. If not specified, an error results. It can be convenient to generate a compatible data.frame by first running the function check_cofactors to build a multi-QTL model.

prop_Pheno_rep

The minimum proportion of phenotypes represented across blocks. If less than this, the individual is removed from the analysis. If there is incomplete data, the missing phenotypes are imputed using the mean values across the recorded observations.

log

Character string specifying the log filename to which standard output should be written. If NULL log is send to stdout.

verbose

Should messages be written to standard output?

Value

A list with percentage variance explained of maximal QTL model and all sub-models

Examples

1
2
3
4
5
6
data("IBD_4x","Phenotypes_4x")
PVE(IBD_list = IBD_4x,
    Phenotype.df = Phenotypes_4x,
    genotype.ID = "geno",trait.ID = "pheno",
    block = "year",
    QTL_df = data.frame(LG=1,cM=12.3))

polyqtlR documentation built on Feb. 2, 2022, 5:09 p.m.

Related to PVE in polyqtlR...