[BioC] genenames in KEGG2heatmap, GO2heatmap

James W. MacDonald jmacdon at med.umich.edu
Mon Aug 9 17:32:56 CEST 2010

Hi Dave,

On 8/9/2010 11:03 AM, Dave Bridges wrote:
> Is there a way to display gene names as opposed to affymetrix identifiers on the y axis of a heatmap?

All you need to do is convert the Affy IDs to e.g., symbols first. Here 
I assume you are using an HG-U133plus2 chip, and have an expressionSet 
called 'eset'.

symbs <- mget(featureNames(eset), hgu133plus2SYMBOL, ifnotfound = NA)

At this point you might want to check that you only get one symbol per 
probeset ID (IIRC, you should).

table(sapply(symbs, length))

if all are length one, let's proceed. If not, you might want to do

symbs <- lapply(symbs, function(x) x[1]))

where we simply use the first symbol. At this point we can unlist.

symbs <- unlist(symbs)

Now, some of those Affy IDs might not have symbols, so you will have NA 
values there. In that case, we will just use the Affy IDs. You probably 
don't want to pollute your original expressionSet with these symbols, so 
let's make a copy and use that.

mat <- eset
featureNames(mat) <- ifelse(!is.na(symbs), symbs, featureNames(mat))

et voila! Now just go ahead with your call to GO2heatmap() or whatever.



> 	[[alternative HTML version deleted]]
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor

James W. MacDonald, M.S.
Douglas Lab
University of Michigan
Department of Human Genetics
5912 Buhl
1241 E. Catherine St.
Ann Arbor MI 48109-5618
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues 

More information about the Bioconductor mailing list