0

I would like to reverse the default annotation for row:

library(NMF) #any other packages for this task are welcome
car<-cars
car$p<-sample(1:600, 50)*0.0001
aheatmap(as.matrix(cars[,1:2,drop=FALSE]),annRow =car[,"p",drop=FALSE])

enter image description here

As you can see in row annotation, the 0 represents white color and larger number the deeper green. I would like to see the smaller p, the deeper green (or grey).

Moreover, if that is possible, the p larger than 0.05 would present only white color.

It is really challenging for me. Thanks for any helps or comments

Ming
  • 181
  • 2
  • 10

1 Answers1

1

You can change the colors using the annColors parameter. This reverses the order of green-white:

aheatmap(as.matrix(cars[,1:2,drop=FALSE]),annRow =car[,"p",drop=FALSE], annColors="-Greens")

To make anything above p=.05 white, you could subset your data to make anything above that value NA and do the same coloring:

car$p[car$p>.05]<-NA
aheatmap(as.matrix(cars[,1:2,drop=FALSE]),annRow =car[,"p",drop=FALSE], annColors="-Greens")

enter image description here

jalapic
  • 13,792
  • 8
  • 57
  • 87