Can someone help explain how I can convert a list of gene symbols to entrez IDs? I am trying to use id2eg. I start by reading in a .txt file with a list of mouse gene IDs and then try to use the id2eg( ) function. I don't get how to convert the variable to make it match the data Below is an example:
library(pathview)
# Example of first 10 genes
genes <- c("Sergef", "Zfp949", "Endog", "Gstt3", "Mccc1", "Cndp2", "Cep78", "Tmem147", "Cox6a1", "Tcn2")
# convert gene symbol IDs to EntrezIDs
id.map.symbol <- id2eg(ids = names(genes), category = gene.idtype.list[1], org = "Mm")
No matter how I try to change the variable I get the same the following error:
Error in as.vector(x, "character") :
cannot coerce type 'environment' to vector of type 'character'
Any help will be greatly appreciated.
Mike
Never used it, but I'd suggest removing the
names(...)
from around 'genes'