Entering edit mode
2.7 years ago
alyyha
•
0
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
gene_ID
should begenes
in your function.Yes sorry I wrote wrongly here
are you sure that
BSgenome.Athaliana.TAIR.TAIR9
is compatible for use as theorgAnn
forconvert2EntrezID
?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?
You probably want to use the A. thaliana bioconductor organism database. BSgenome objects are usually just the genome assembly, whereas organism databases have collections of useful things like various gene name formats and ontologies.
http://bioconductor.org/packages/release/data/annotation/html/org.At.tair.db.html
Upsi. Thank you, I will try that