I am trying to convert from ensembl ID to gene symbol. Here is the chunk of code I'm using:
ensembl = useMart( "ensembl", dataset = "hsapiens_gene_ensembl")
genemap <- getBM( attributes = c("ensembl_gene_id", "entrezgene", "hgnc_symbol"),
filters = "ensembl_gene_id",
values = dat$ensembl,
mart = ensembl )
idx <- match( dat$ensembl, genemap$ensembl_gene_id )
dat$entrez <- genemap$entrezgene[idx]
dat$hgnc_symbol <- genemap$hgnc_symbol[idx]
dat <- subset(dat, select = -c(ensembl, entrez))
I get this error when I run it:
The query to the BioMart webservice returned an invalid result: biomaRt expected a character string of length 1.
Please report this on the support site at http://support.bioconductor.org
Anyone able to help? Thanks.
When you tag a post with a package name, it sends an email alert to the package maintainer. As this isn't a DESeq2 post, I'm removing the tag.