[R] mhplot error with test example: "ylim not found"

vaneet vaneet.lotay at mountsinai.org
Wed Jun 23 16:47:37 CEST 2010


Hello all,

I am trying to make a genome association plot for p-values related to SNPs
and was fortunate to find that R contains a package that produces Manhattan
plots which is what's preferred for my current project.  The function
mhtplot() is found in the 'gap' package which I installed in R 2.11.1 on
Windows.  I thought I'd test out the function first with the examples they
give in the documentation:

# foo example
test <- matrix(c(1,1,4,1,1,6,1,10,3,2,1,5,2,2,6,2,4,8),byrow=TRUE,6)
mhtplot(test)
mhtplot(test,logscale=F)

# fake example with Affy500k data
affy <-c(40220, 41400, 33801, 32334, 32056, 31470, 25835, 27457, 22864,
28501, 26273, 
         24954, 19188, 15721, 14356, 15309, 11281, 14881, 6399, 12400, 7125,
6207)
CM <- cumsum(affy)
n.markers <- sum(affy)
n.chr <- length(affy)
test <- data.frame(chr=rep(1:n.chr,affy),pos=1:n.markers,p=runif(n.markers))

# to reduce size of the plot
# bitmap("mhtplot.bmp",res=72*5)
oldpar <- par()
par(las="2",cex=0.6)
colors <- rep(c("blue","green"),11)
mhtplot(test,colors=colors,pch=19,bg=colors)
title("A simulated example according to EPIC-Norfolk QCed SNPs")

When I run either of the examples the following results:

Error in mhtplot(........) : object 'ylim' not found

Even though I'm not sure why it would require this parameter, when I tried
to fill in the parameter (ylim = c(0,10)) the same error results.  I am not
sure how to get around this.

Vaneet
-- 
View this message in context: http://r.789695.n4.nabble.com/mhplot-error-with-test-example-ylim-not-found-tp2265697p2265697.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list