[BioC] affy ids from gene symbols

James W. MacDonald jmacdon at med.umich.edu
Fri Mar 7 21:49:10 CET 2008


Say your input vector of symbol names is called 'input'.

complist <- vector("list", length(input))
names(complist) <- input
library(hgu133plus2.db) ## note I am using the new package type!!

mapp <- toTable(hgu133plus2SYMBOL)

for(i in 1:length(input)) complist[[i]] <- mapp[grep(paste("^", 
input[i], "$", sep=""), mapp[,2]),1]

Depending on if you want to assume your symbols exactly match the 
annotation package symbols, you might want to add in a tolower(), and 
possibly gsub() to remove things like '(', ')', '-', etc.

Best,

Jim



IAIN GALLAGHER wrote:
> Hello list.
> 
> I would like to return the affymetrix probe ids for a list of genes. Normally I would do this through biomaRt but the service is down all weekend.
> 
> I know the probe ids can be returned one at a time using regular expressions via
> 
>> library(hgu133plus2)
>> symbols<-unlist(as.list(hgu133plus2SYMBOLS))
>> gene1<-grep('^COPA$', symbols)
>> symbols[gene1]
> 
> but I was wondering if there was a way to loop through the list of genes and 'grep' each one individually.
> 
> Thanks for any advice.
> 
> Iain
> 
> 	[[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.
Biostatistician
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623



More information about the Bioconductor mailing list