The original dataframe gene2disease_group looks like this and has no empty values:
eidh;symbh
1;A1BG
1;A1BG
2;A2M
This call
gene2disease_group <- mapEntrezToEnsembl(1, gene2disease_group)
of the follwing function
mapEntrezToEnsembl <- function(columnIndex, result, mart = useDataset("hsapiens_gene_ensembl", useMart("ensembl"))){
#as.data.frame is needed, because result[, columnIndex] throws error if result is a data.table
result <- as.data.frame(result)
val <- result[, columnIndex]
colnames(result)[columnIndex] <- "GeneID"
attributes <- c("ensembl_gene_id", "entrezgene_id")
ensemblGenes <- getBM(filters = "entrezgene_id", attributes= attributes, values = val, mart = mart)
}
ended with the error
Batch submitting query [============================>----------------------------------------------------------------------------------------------] 24% eta: 47mError in getBM(filters = "entrezgene_id", attributes = attributes, values = val, :
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
Called from: getBM(filters = "entrezgene_id", attributes = attributes, values = val,
mart = mart)
Any idea to solve this problem?
Frank
#
> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Scientific Linux 7.4 (Nitrogen)
Matrix products: default
BLAS/LAPACK: /apps/prod/easybuild/sl7.x86_64/software/OpenBLAS/0.2.20-GCC-6.4.0-2.28/lib/libopenblasp-r0.2.20.so
Random number generation:
RNG: Mersenne-Twister
Normal: Inversion
Sample: Rounding
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] openxlsx_4.1.0.1 R.utils_2.9.0 R.oo_1.22.0 R.methodsS3_1.7.1 InterMineR_1.6.1 tidyr_1.0.0 ggplot2_3.2.1 readxl_1.3.1 biomaRt_2.40.3
[10] rvest_0.3.4 xml2_1.2.0 jsonlite_1.6 RCurl_1.95-4.12 bitops_1.0-6 png_0.1-7 stringr_1.4.0 optparse_1.6.2 dplyr_0.8.3
[19] data.table_1.12.2 magrittr_1.5 flextable_0.5.5 officer_0.3.5 plyr_1.8.4 hash_2.2.6.1
...