perm_neighbor: Permutation tests for neighbor effects with a QTL model

Description Usage Arguments Value Author(s) See Also Examples

View source: R/perm_neighbor.R

Description

A function to calculate a genome-wide LOD threshold using permutation tests for self or neighbor effects.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
perm_neighbor(
  genoprobs,
  pheno,
  smap,
  scale,
  addcovar = NULL,
  addQTL = NULL,
  intQTL = NULL,
  grouping = rep(1, nrow(smap)),
  response = c("quantitative", "binary"),
  type = c("neighbor", "self", "int"),
  times = 99,
  p_val = 0.05,
  n_core = 1L,
  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.

scale

A numeric scalar indicating the maximum spatial distance between a focal individual and neighbors to define neighbor effects.

addcovar

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

addQTL

An optional vector containing marker names that are considered covariates. Namely, this option allows composite interval mapping (Jansen 1993).

intQTL

An option when using int_neighbor(). A name of a focal marker to be tested for its epistasis with the other markers in neighbor effects. The marker name must be included by addQTL.

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" calls the "gaussian" or "binomial" family in glm(), respectively.

type

Select "self", "neighbor", or "int" to perform permutation tests for self effects, neighbor effects, or neighbor epistasis, respectively.

times

No. of permutation iterations. Default at 99 times

p_val

A vector indicating upper quantiles for permutation LOD scores

n_core

No. of cores for a parallel computation. This does not work for Windows OS. Default is a single-core computation.

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

LOD thresholds at given quantiles by p-val

Author(s)

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

See Also

plot_nei scan_neighbor int_neighbor

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)

test_perm <- perm_neighbor(genoprobs=test_genoprobs,
                           pheno=test_cross$pheno$phenotype,
                           smap=test_smap,scale=20,
                           times=3, p_val=c(1.0,0.5)
                           )

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