It seems to me that gap::mhtplot needs a fix.
You might want to contact the maintainer (cc'd).

In the meantime, you should be able to place an
object ylim in your workspace before calling the
function:

  ylim <- c(0, 10)
  mhtplot(test, ylim = c(0, 10))

Of course, you could also just fixt the function
(it's short and the fix is easy).

  -Peter Ehlers

On 2010-06-23 8:47, vaneet wrote:

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

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to