calc_pve: Calculating phenotypic variation explained by neighbor...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/calc_pve.R

Description

A function to calculate the proportion or ratio of phenotypic variation explained (PVE or RVE) by neighbor effects for a series of neighbor distance (s_seq) using mixed models.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
calc_pve(
  genoprobs,
  pheno,
  smap,
  s_seq,
  addcovar = NULL,
  grouping = rep(1, nrow(smap)),
  response = c("quantitative", "binary"),
  fig = TRUE,
  contrasts = NULL
)

Arguments

genoprobs

Conditional genotype probabilities as taken from qtl::calc.genoprob().

pheno

A vector of individual phenotypes.

smap

A matrix showing a spatial map for individuals. The first and second column include spatial positions along an x-axis and y-axis, respectively.

s_seq

A numeric vector including a set of the maximum spatial distance between a focal individual and neighbors to define neighbor effects. A scalar is also allowed.

addcovar

An optional matrix including additional non-genetic covariates. It contains no. of individuals x no. of covariates.

grouping

An optional integer vector assigning each individual to a group. This argument can be used when smap contains different experimental replicates. Default setting means that all individuals are belong to a single group.

response

An optional argument to select trait types. The "quantitative" or "binary" applies the "lmm.aireml()" or "logistic.mm.aireml()" for a mixed model, respectively.

fig

TRUE/FALSE to add a figure of Delta PVE or not.

contrasts

An optional vector composed of three TRUE/FALSE values, which represents the presence/absence of specific genotypes as c(TRUE/FALSE, TRUE/FALSE, TRUE/FALSE) = AA, AB, BB. If NULL, it is compiled from genoprobs automatically.

Details

This function calls linear or logistic mixed models via the gaston package (Perdry & Dandine-Roulland 2020). If "quantitative" is selected, Var_self or Var_nei in the output is given by the proportion of phenotypic variation explained (PVE) by neighbor effects as PVEnei =σ^2_2/(σ^2_1+σ^2_2+σ^2_e). If "binary" is selected, Var_self or Var_nei is given by the ratio of phenotypic variation explained (RVE) by neighbor effects as RVEnei =σ^2_2/σ^2_1 and p-values are not available. This is because a logistic mixed model logistic.mm.aireml() called via the gaston package does not provide σ^2_e and log-likelihood (see Chen et al. 2016 for the theory).

Value

A matrix containing the maximum neighbor distance, phenotypic variation explained by neighbor effects, and p-value by a likelihood ratio test.

Author(s)

Yasuhiro Sato (sato.yasuhiro.36c@kyoto-u.jp)

References

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
set.seed(1234)
test_map <- qtl::sim.map(len=rep(20,5),n.mar=3,include.x=FALSE)
test_cross <- qtl::sim.cross(test_map,n.ind=50)
test_smap <- cbind(runif(50,1,100),runif(50,1,100))
test_genoprobs <- qtl::calc.genoprob(test_cross,step=2)
s_seq <- quantile(dist(test_smap),c(0.1*(1:10)))

test_pve <- calc_pve(genoprobs=test_genoprobs,
                     pheno=test_cross$pheno$phenotype,
                     smap=test_smap, s_seq=s_seq,
                     )

rNeighborQTL documentation built on April 9, 2021, 9:06 a.m.