scan1perm: Permutation test for genome scan with a single-QTL model

Description Usage Arguments Details Value References See Also Examples

View source: R/scan1perm.R

Description

Permutation test for a enome scan with a single-QTL model by Haley-Knott regression or a linear mixed model, with possible allowance for covariates.

Usage

1
2
3
4
scan1perm(genoprobs, pheno, kinship = NULL, addcovar = NULL,
  Xcovar = NULL, intcovar = NULL, weights = NULL, reml = TRUE,
  model = c("normal", "binary"), n_perm = 1, perm_Xsp = FALSE,
  perm_strata = NULL, chr_lengths = NULL, cores = 1, ...)

Arguments

genoprobs

Genotype probabilities as calculated by qtl2geno::calc_genoprob().

pheno

A matrix of phenotypes, individuals x phenotypes.

kinship

Optional kinship matrix, or a list of kinship matrices (one per chromosome), in order to use the LOCO (leave one chromosome out) method.

addcovar

An optional matrix of additive covariates.

Xcovar

An optional matrix with additional additive covariates used for null hypothesis when scanning the X chromosome.

intcovar

An optional matrix of interactive covariates.

weights

An optional vector of positive weights for the individuals. As with the other inputs, it must have names for individual identifiers. Ignored if kinship is provided.

reml

If kinship provided: if reml=TRUE, use REML; otherwise maximum likelihood.

model

Indicates whether to use a normal model (least squares) or binary model (logistic regression) for the phenotype. If model="binary", the phenotypes must have values in [0, 1].

n_perm

Number of permutation replicates.

perm_Xsp

If TRUE, do separate permutations for the autosomes and the X chromosome.

perm_strata

Vector of strata, for a stratified permutation test. Should be named in the same way as the rows of pheno. The unique values define the strata.

chr_lengths

Lengths of the chromosomes; needed only if perm_Xsp=TRUE. See chr_lengths().

cores

Number of CPU cores to use, for parallel calculations. (If 0, use parallel::detectCores().) Alternatively, this can be links to a set of cluster sockets, as produced by parallel::makeCluster().

...

Additional control parameters; see Details.

Details

If kinship is not provided, so that analysis proceeds by Haley-Knott regression, we permute the rows of the phenotype data; the same permutations are also applied to the rows of the covariates (addcovar, Xcovar, and intcovar) are permuted.

If kinship is provided, we instead permute the rows of the genotype data and fit an LMM with the same residual heritability (estimated under the null hypothesis of no QTL).

If Xcovar is provided and perm_strata=NULL, we do a stratified permutation test with the strata defined by the rows of Xcovar. If a simple permutation test is desired, provide perm_strata that is a vector containing a single repeated value.

The ... argument can contain three additional control parameters; suspended for simplicity (or confusion, depending on your point of view). tol is used as a tolerance value for linear regression by QR decomposition (in determining whether columns are linearly dependent on others and should be omitted); default 1e-12. intcovar_method indicates whether to use a high-memory (but potentially faster) method or a low-memory (and possibly slower) method, with values "highmem" or "lowmem"; default "lowmem". Finally, max_batch indicates the maximum number of phenotypes to run together; default is 1000.

Value

If perm_Xsp=FALSE, the result is matrix of genome-wide maximum LOD scores, permutation replicates x phenotypes. If perm_Xsp=TRUE, the result is a list of two matrices, one for the autosomes and one for the X chromosome.

References

Churchill GA, Doerge RW (1994) Empirical threshold values for quantitative trait mapping. Genetics 138:963–971.

Manichaikul A, Palmer AA, Sen S, Broman KW (2007) Significance thresholds for quantitative trait locus mapping under selective genotyping. Genetics 177:1963–1966.

Haley CS, Knott SA (1992) A simple regression method for mapping quantitative trait loci in line crosses using flanking markers. Heredity 69:315–324.

Kang HM, Zaitlen NA, Wade CM, Kirby A, Heckerman D, Daly MJ, Eskin E (2008) Efficient control of population structure in model organism association mapping. Genetics 178:1709–1723.

See Also

scan1(), chr_lengths(), mat2strata()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# load qtl2geno package for data and genoprob calculation
library(qtl2geno)

# read data
iron <- read_cross2(system.file("extdata", "iron.zip", package="qtl2geno"))


# insert pseudomarkers into map
map <- insert_pseudomarkers(iron$gmap, step=1)

# calculate genotype probabilities
probs <- calc_genoprob(iron, map, error_prob=0.002)

# grab phenotypes and covariates; ensure that covariates have names attribute
pheno <- iron$pheno
covar <- match(iron$covar$sex, c("f", "m")) # make numeric
names(covar) <- rownames(iron$covar)
Xcovar <- get_x_covar(iron)

# strata for permutations
perm_strata <- mat2strata(Xcovar)

# permutations with genome scan
## Not run: 
operm <- scan1perm(probs, pheno, addcovar=covar, Xcovar=Xcovar,
                   n_perm=1000, perm_Xsp=TRUE, perm_strata=perm_strata,
                   chr_lengths=chr_lengths(iron$gmap))
## End(Not run)

summary(operm)

# leave-one-chromosome-out kinship matrices
kinship <- calc_kinship(probs, "loco")

# genome scan with a linear mixed model
## Not run: 
operm_lmm <- scan1perm(probs, pheno, kinship, covar, Xcovar, n_perm=1000,
                       perm_Xsp=TRUE, perm_strata=perm_strata,
                       chr_lengths=chr_lengths(map))
## End(Not run)

summary(operm_lmm)

rqtl/qtl2scan documentation built on May 28, 2019, 2:36 a.m.