Learn R Programming

QTLRel (version 0.1)

plotit: Plotting

Description

Plot mapping results.

Usage

## S3 method for class 'scanOne':
plot(x,...)

plotit(lrt, cv, bychr = FALSE, chr.labels = TRUE,
   type="p", lty=NULL, col=NULL, pch=NULL, cex=NULL,...)

Arguments

x
object from scanOne or scanOne4p.
cv
threshold to be drawn on the plot.
cex
see par.
lrt
a data frame with (chr, dist, y,...) or (chr, dist, y, group,...), where "chr" represents chromosome, "dist" position on the chromosome, "y" the test statistic.
bychr
a logical variable. If true, the plot will be displayed per chromosomes.
chr.labels
a logical variable. If true, the chromosome names will be drawn.
type,lty,col,pch
...
other options passed to R plot function. To call plot to plot results of scanOne or scanOne4p, one may need t

Examples

Run this code
data(miscEx)

gdat.imp<- genoImpute(gdat, gmap=genMap, step=Inf,
   gr=2, na.str=NA)
y<- rnorm(20)
x<- matrix(1,nrow=20,ncol=1)
v<- cov(matrix(rnorm(500*20),ncol=20))
o<- estVC(y, x, v = list(AA=v,DD=NULL,HH=NULL,AD=NULL,
   MH=NULL,EE=diag(20)))

gcv<- v*o$par["AA"]
llk<- scanOne(y=y, x=x, vc=gcv, gdat=gdat.imp[,1:20])
plot(llk,gmap=genMap) # gmap is needed

idx<- match(colnames(gdat.imp[,1:20]),genMap$snp)
tmp<- data.frame(chr=genMap$chr[idx],dist=genMap$dist[idx],y=llk$lr)
plotit(tmp, main="Mapping Plot", xlab="Chromosome", ylab="LRT",
   col=as.integer(tmp$ch)%%2+2,type="b")

Run the code above in your browser using DataLab