This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Convert ensembl IDs from dataframe to entrez IDs vector

I want to convert ensembl IDs in to entrez IDs to perform Ontology Analysis. I need to create a vector of ensembl IDs and it does not work.

library(ChIPpeakAnno) #to use the function convert2EntrezID

library(BSgenome.Athaliana.TAIR.TAIR9) #to get the entrez IDs

#I have a dataframe df of 2 columns: GENE_ID (ensembl IDs) and LFCs.

genes<-df$GENE_ID #to get a vector of gene ids
orgAnn<-BSgenome.Athaliana.TAIR.TAIR9

convert2EntrezID(genes, orgAnn, ID_type="ensembl_gene_id")

Error in as.character.default(x) : 
  no method for coercing this S4 class to a vector
entrez-id gene-ontology athaliana chippeakanno

gene_ID should be genes in your function.

Yes sorry I wrote wrongly here

are you sure that BSgenome.Athaliana.TAIR.TAIR9 is compatible for use as the orgAnn for convert2EntrezID?

Good point. I wanted to use a standard annotation dataset from Bioconductor, just to see if this converting function was working or not. Where would you recommend to download this annotation dataset?

Upsi. Thank you, I will try that

0 answers

No answers yet.

Log in to answer this question.