Learn R Programming

QTLRel (version 0.2-9)

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 scanTwo.
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.
cv
threshold to be drawn on the plot.
cex
see par.
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, one may need to provide a genetic map gmap that should be data fr

Examples

Run this code
data(miscEx)

# impute missing genotypes
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))
# estimate variance components
o<- estVC(y, x, v = list(AA=v,DD=NULL,HH=NULL,AD=NULL,
   MH=NULL,EE=diag(20)))

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

# plotting
plot(llk,gmap=genMap) # gmap is needed

# plotting in another way
idx<- match(colnames(gdat.imp[,1:20]),genMap$snp)
tmp<- data.frame(chr=genMap$chr[idx],dist=genMap$dist[idx],y=llk$p)
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