Skip to content

Instantly share code, notes, and snippets.

@thomaskelder
Last active December 15, 2015 22:39
Show Gist options
  • Select an option

  • Save thomaskelder/5334672 to your computer and use it in GitHub Desktop.

Select an option

Save thomaskelder/5334672 to your computer and use it in GitHub Desktop.
script to convert affy probes to entrez ids
## Only first time: install bioconductor package for your affy array
## Find the proper package here: http://www.bioconductor.org/packages/release/data/annotation/
source("http://bioconductor.org/biocLite.R")
biocLite("hgu95d.db")
## Load the affy annotation library
library(hgu95d.db)
ids = read.delim("omzetten ids.txt", as.is=T, header=T)
entrez = unlist(mget(ids[,2], hgu95dENTREZID, ifnotfound=NA))
ids = cbind(ids, entrez)
write.table(ids, "omzetten ids met entrez.txt", sep="\t", row.names=F)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment