Learn R Programming

rNeighborQTL (version 1.1.1)

calc_pve: Calculating phenotypic variation explained by neighbor effects

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

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.

Value

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

  • scale Maximum neighbor distance given as an argument

  • Var_self Proportion or ratio of phenotypic variation explained (PVE or RVE) by self-genotype effects for linear or logistic mixed models, respectively

  • Var_nei Proportion or ratio of phenotypic variation explained (PVE or RVE) by neighbor effects for linear or logistic mixed models, respectively

  • p-value p-value by a likelihood ratio test between models with or without neighbor effects. Self effects are tested when the scale is zero

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 =\(\sigma^2_2/(\sigma^2_1+\sigma^2_2+\sigma^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 =\(\sigma^2_2/\sigma^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 \(\sigma^2_e\) and log-likelihood (see Chen et al. 2016 for the theory).

References

  • Perdry H, Dandine-Roulland C (2019) gaston: Genetic Data Handling (QC, GRM, LD, PCA) & Linear Mixed Models. R package version 1.5.5. https://CRAN.R-project.org/package=gaston

  • Chen H, Wang C, Conomos M. et al. (2016) Control for population structure and relatedness for binary traits in genetic association studies via logistic mixed models. The American Journal of Human Genetics 98: 653-666.

Examples

Run this code
# NOT RUN {
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,
                     )
# }

Run the code above in your browser using DataLab