Learn R Programming

lineup (version 0.44)

calc.locallod: Calculate LOD score at physical position of each gene

Description

For gene expression data with physical positions of the genes, calculate the LOD score at those positions to assess evidence for local eQTL.

Usage

calc.locallod(
  cross,
  pheno,
  pmark,
  addcovar = NULL,
  intcovar = NULL,
  verbose = TRUE,
  n.cores = 1
)

Value

A vector of LOD scores. The names indicate the gene names (columns in pheno).

Arguments

cross

An object of class "cross" containing data for a QTL experiment. See the help file for qtl::read.cross() in the R/qtl package (https://rqtl.org). There must be a phenotype named "id" or "ID" that contains the individual identifiers.

pheno

A data frame of phenotypes (generally gene expression data), stored as individuals x phenotypes. The row names must contain individual identifiers.

pmark

Pseudomarkers that are closest to the genes in pheno, as output by find.gene.pseudomarker().

addcovar

Additive covariates passed to qtl::scanone().

intcovar

Interactive covariates passed to qtl::scanone().

verbose

If TRUE, print tracing information.

n.cores

Number of CPU cores to use in the calculations. With n.cores=0, parallel::detectCores() is used to detect the number of available cores.

Author

Karl W Broman, broman@wisc.edu

Details

cross and pheno must contain exactly the same individuals in the same order. (Use findCommonID() to line them up.)

We consider the expression phenotypes in batches: those whose closest pseudomarker is the same.

We use Haley-Knott regression to calculate the LOD scores.

Actually, we use a bit of a contortion of the data to force the qtl::scanone() function in R/qtl to calculate the LOD score at a single position.

We omit any transcripts that map to the X chromosome; we can only handle autosomal loci for now.

See Also

find.gene.pseudomarker(), plotEGclass(), findCommonID(), disteg()

Examples

Run this code
data(f2cross, expr1, genepos, pmap)
library(qtl)
# \dontshow{
n_ind <- 20
n_genes <- 5
f2cross <- f2cross[,1:n_ind]
expr1 <- expr1[1:n_ind,1:n_genes]
genepos <- genepos[1:n_genes,]# }
# calc QTL genotype probabilities
f2cross <- calc.genoprob(f2cross, step=1)

# find nearest pseudomarkers
pmark <- find.gene.pseudomarker(f2cross, pmap, genepos, "prob")

# line up f2cross and expr1
id <- findCommonID(f2cross, expr1)

# calculate LOD score for local eQTL
locallod <- calc.locallod(f2cross[,id$first], expr1[id$second,], pmark)

Run the code above in your browser using DataLab