scan1max: Maximum LOD score from genome scan with a single-QTL model

View source: R/scan1max.R

scan1maxR Documentation

Maximum LOD score from genome scan with a single-QTL model

Description

Maximum LOD score from genome scan with a single-QTL model by Haley-Knott regression or a linear mixed model, with possible allowance for covariates.

Usage

scan1max(
  genoprobs,
  pheno,
  kinship = NULL,
  addcovar = NULL,
  Xcovar = NULL,
  intcovar = NULL,
  weights = NULL,
  reml = TRUE,
  model = c("normal", "binary"),
  hsq = NULL,
  by_chr = FALSE,
  cores = 1,
  ...
)

Arguments

genoprobs

Genotype probabilities as calculated by calc_genoprob().

pheno

A numeric 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 numeric matrix of additive covariates.

Xcovar

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

intcovar

An numeric optional matrix of interactive covariates.

weights

An optional numeric vector of positive weights for the individuals. As with the other inputs, it must have names for individual identifiers.

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

hsq

Considered only if kinship is provided, in which case this is taken as the assumed value for the residual heritability. It should be a vector with length corresponding to the number of columns in pheno, or (if kinship corresponds to a list of LOCO kinship matrices) a matrix with dimension ⁠length(kinship) x ncol(pheno)⁠.

by_chr

If TRUE, save the individual chromosome maxima.

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

Equivalent to running scan1() and then saving the column maxima, with some savings in memory usage.

Value

Either a vector of genome-wide maximum LOD scores, or if by_chr is TRUE, a matrix with the chromosome-specific maxima, with the rows being the chromosomes and the columns being the phenotypes.

See Also

scan1(), scan1perm()

Examples

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


# 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)

# perform genome scan
out <- scan1max(probs, pheno, addcovar=covar, Xcovar=Xcovar)


rqtl/qtl2 documentation built on March 20, 2024, 6:35 p.m.