Error in getBM(attributes = c("ensemblgeneid", "entrezgene", "hgnc_symbol"), : The query to the BioMart webservice returned an invalid result: biomaRt expected a character string of length 1.
I have previously used BioMart without any problems. But now I get this error message, with code that previously worked fine.
My code:
library( "biomaRt" ) res <- fc$counts tmp <- sapply( strsplit( rownames(res), split="\+" ), "[", 1 ) tmp <- sapply( strsplit(tmp, split="\." ), "[", 1 ) res$ensembl <- tmp ensembl = useMart( "ensembl", dataset = "hsapiensgeneensembl" ) genemap <- getBM( attributes = c("ensemblgeneid", "entrezgene", "hgncsymbol"), filters = "ensemblgene_id", values = res$ensembl, mart = ensembl )
fc$counts are gene IDs and counts from featureCounts function.
Thank you! It seems correct. Now it's working fine and much faster as well. I also tried BiomaRt web server at Ensembl, but that doesn't respond very well either at the moment.