fit1: Fit single-QTL model at a single position

Description Usage Arguments Details Value References Examples

View source: R/fit1.R

Description

Fit a single-QTL model at a single putative QTL position and get detailed results about estimated coefficients and individuals contributions to the LOD score.

Usage

1
2
3
4
fit1(genoprobs, pheno, kinship = NULL, addcovar = NULL, nullcovar = NULL,
  intcovar = NULL, weights = NULL, contrasts = NULL, model = c("normal",
  "binary"), se = TRUE, hsq = NULL, reml = TRUE, tol = 0.000000000001,
  maxit = 100)

Arguments

genoprobs

A matrix of genotype probabilities, individuals x genotypes

pheno

A numeric vector of phenotype values (just one phenotype, not a matrix of them)

kinship

Optional kinship matrix.

addcovar

An optional matrix of additive covariates.

nullcovar

An optional matrix of additional additive covariates that are used under the null hypothesis (of no QTL) but not under the alternative (with a QTL). This is needed for the X chromosome, where we might need sex as a additive covariate under the null hypothesis, but we wouldn't want to include it under the alternative as it would be collinear with the QTL effects.

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.

contrasts

An optional matrix of genotype contrasts, size genotypes x genotypes. For an intercross, you might use cbind(c(1,1,1), c(-1, 0, 1), c(-0.5, 1, -0.5)) to get mean, additive effect, and dominance effect. The default is the identity matrix.

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].

se

If TRUE, calculate the standard errors.

hsq

(Optional) residual heritability; used only if kinship provided.

reml

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

tol

Tolerance value for linear regression by QR decomposition (in determining whether columns are linearly dependent on others and should be omitted)

maxit

Maximum number of iterations in logistic regression fit (when model="binary").

Details

For each of the inputs, the row names are used as individual identifiers, to align individuals.

If kinship is absent, Haley-Knott regression is performed. If kinship is provided, a linear mixed model is used, with a polygenic effect estimated under the null hypothesis of no (major) QTL, and then taken as fixed as known in the genome scan.

Value

A list containing

References

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.

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
# 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[,1]
covar <- match(iron$covar$sex, c("f", "m")) # make numeric
names(covar) <- rownames(iron$covar)

# leave-one-chromosome-out kinship matrix for chr 7
kinship7 <- calc_kinship(probs, "loco")[[7]]

# scan chromosome 7 to find peak
out <- scan1(probs[,7], pheno, kinship7, addcovar=covar)

# find peak position
max_pos <- rownames(max(out, map[7]))

# fit QTL model just at that position
out_fit1 <- fit1(probs[[7]][,,max_pos], pheno, addcovar=covar)

# fit QTL model just at that position, with polygenic effect
out_fit1_pg <- fit1(probs[[7]][,,max_pos], pheno, kinship7, addcovar=covar)

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