biomart getLDS giving errors.
Entering edit mode
hnthirim ▴ 10
Last seen 10 months ago
United States

I'm trying to use biomaRt to convert mouse genes to human genes. I used the getLDS function and the code below. I keep getting the following error despite trying different mirrors. Is there anything wrong with my code? Or should I just wait and try again later.

```human = useEnsembl("ensembl", dataset = "hsapiens_gene_ensembl") mouse = useEnsembl("ensembl", dataset = "mmusculus_gene_ensembl") genes = getLDS(attributes = c("mgi_symbol"), mart = mouse, attributesL = c("hgnc_symbol"), martL = human, uniqueRows = T)

Error: biomaRt has encountered an unexpected server error. Consider trying one of the Ensembl mirrors (for more details look at ?useEnsembl)


biomaRt • 1.2k views
Entering edit mode
Mike Smith ★ 6.0k
Last seen 5 hours ago
EMBL Heidelberg

There seems to be an issue with the linked dataset queries after the latest update to Ensembl version 106. I've reported this to the Ensembl help desk, hopefully there will be a fix soon. As a temporary workaround you can try using the version 105 archive.

Entering edit mode

Thank you for the update. I was able to get it to work by using a previous archive.

human = useEnsembl("ensembl", dataset = "hsapiens_gene_ensembl", host="")

Entering edit mode
Last seen 5 hours ago
United States

If you are just using Gene symbols to do the mapping, you don't need biomaRt. You could use the package instead. It maps NCBI Gene IDs between species, so you need to also map symbols to Gene IDs, But a simple function will do that.

mapfun <- function(mousegenes){
    gns <- mapIds(, mousegenes, "ENTREZID", "SYMBOL")
    mapped <- select(, gns, "Homo_sapiens","Mus_musculus")
    naind <-$Homo_sapiens)
    hsymb <- mapIds(, as.character(mapped$Homo_sapiens[!naind]), "SYMBOL", "ENTREZID")
    out <- data.frame(Mouse_symbol = mousegenes, mapped, Human_symbol = NA)
    out$Human_symbol[!naind] <- hsymb

> library(
> library(
> library(
## just get some symbols
> z <- head(keys(, "SYMBOL"), 40)
> z
 [1] "Pzp"      "Aanat"    "Aatk"     "Abca1"    "Abca4"    "Abca2"   
 [7] "Abcb7"    "Abcg1"    "Abi1"     "Abl1"     "Abl2"     "Scgb1b27"
[13] "ac"       "Acadl"    "Acadm"    "Acadvl"   "Acads"    "Slc33a1" 
[19] "Asic2"    "Asic1"    "Ace"      "Ache"     "Apoc4"    "Macf1"   
[25] "Aco1"     "Aco2"     "Acox1"    "Acp1"     "Acp2"     "Acp5"    
[31] "Acr"      "Chrna1"   "Chrna4"   "Chrna6"   "Chrna7"   "Chrnb1"  
[37] "Chrnb2"   "Chrnd"    "Chrne"    "Chrng"   
> mapfun(z)
'select()' returned 1:1 mapping between keys and columns
'select()' returned 1:1 mapping between keys and columns
         Mouse_symbol Mus_musculus Homo_sapiens Human_symbol
Pzp               Pzp        11287           NA         <NA>
Aanat           Aanat        11298           15        AANAT
Aatk             Aatk        11302         9625         AATK
Abca1           Abca1        11303           19        ABCA1
Abca4           Abca4        11304           24        ABCA4
Abca2           Abca2        11305           20        ABCA2
Abcb7           Abcb7        11306           22        ABCB7
Abcg1           Abcg1        11307         9619        ABCG1
Abi1             Abi1        11308        10006         ABI1
Abl1             Abl1        11350           25         ABL1
Abl2             Abl2        11352           27         ABL2
Scgb1b27     Scgb1b27        11354           NA         <NA>
ac                 ac        11358           NA         <NA>
Acadl           Acadl        11363           33        ACADL
Acadm           Acadm        11364           34        ACADM
Acadvl         Acadvl        11370           37       ACADVL
Acads           Acads        11409           35        ACADS
Slc33a1       Slc33a1        11416         9197      SLC33A1
Asic2           Asic2        11418           40        ASIC2
Asic1           Asic1        11419           41        ASIC1
Ace               Ace        11421         1636          ACE
Ache             Ache        11423           43         ACHE
Apoc4           Apoc4        11425          346        APOC4
Macf1           Macf1        11426        23499        MACF1
Aco1             Aco1        11428           48         ACO1
Aco2             Aco2        11429           50         ACO2
Acox1           Acox1        11430           51        ACOX1
Acp1             Acp1        11431           52         ACP1
Acp2             Acp2        11432           53         ACP2
Acp5             Acp5        11433           54         ACP5
Acr               Acr        11434           49          ACR
Chrna1         Chrna1        11435         1134       CHRNA1
Chrna4         Chrna4        11438         1137       CHRNA4
Chrna6         Chrna6        11440         8973       CHRNA6
Chrna7         Chrna7        11441         1139       CHRNA7
Chrnb1         Chrnb1        11443         1140       CHRNB1
Chrnb2         Chrnb2        11444         1141       CHRNB2
Chrnd           Chrnd        11447         1144        CHRND
Chrne           Chrne        11448         1145        CHRNE
Chrng           Chrng        11449         1146        CHRNG

I didn't really check to see the directionality of your mapping, but if you mean to go from human to mouse, it's simple to modify that function to go the other way. Or modify to use another argument to define the directionality.

Entering edit mode

Thank you! Right now I'm facing issues trying to install the package, but I'll try this and share an update.

Entering edit mode

It should install no problem, so long as you are using the current release (R-4.2.0/bioc3.15) or even last release (R-4.1.2/Bioc3.14).


Login before adding your answer.

Traffic: 362 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6