I am converting murine gene lists to human genes using the code below from https://www.r-bloggers.com/2016/10/converting-mouse-to-human-gene-names-with-biomart-package/
convertMouseGeneList <- function(x){
require("biomaRt")
human = useMart("ensembl", dataset = "hsapiens_gene_ensembl")
mouse = useMart("ensembl", dataset = "mmusculus_gene_ensembl")
genesV2 = getLDS(attributes = c("mgi_symbol"), filters = "mgi_symbol", values = x , mart = mouse, attributesL = c("hgnc_symbol"), martL = human, uniqueRows=T)
humanx <- unique(genesV2[, 2])
# Print the first 6 genes found to the screen
print(head(humanx))
return(humanx)
}
I have used this function to great success in the very recent past! as recently as early March 2022!
Today I wanted to clean up my code, and regenerate some lists. So I copied and pasted the code exactly as i used it before. The only thing I changed was the list names, but the contents of the lists are the same but now upon using it I get the following error:
Error: biomaRt has encountered an unexpected server error.
Consider trying one of the Ensembl mirrors (for more details look at ?useEnsembl)
I have tried using mirrors however it has failed as well! Those errors usually just say things like it didnt understand the arguments anymore... but other times it says err_msg with no explanation. i could really use some help.
I have uninstalled and reinstalled R and R studio and updated all my packages.
Sometimes the main Ensembl BioMart server can break, which leads to this error. It's not a problem with your code, and hopefully the Ensembl team will fix the issue shortly.
However, this is why the mirrors exists. If you're having problems using them, perhaps you can share the code you're trying to use and the output message you receive so we can see what the issue is.
Thanks for such a quick response!!!
Yeah, I am aware of the issues that biomart and ensembl can have. It is frustrating.
I ran the code again this morning, this time it automatically tried to use mirrors (yesterday it did not attempt this), each time failing.
The messages were as follows:
Trying to use a mirror on my own i adapted the code as follows:
The error message i received was:
i dont understand what this error is at all unfortunately (I am not great at programming languages in general)
I tried using useEnsembl instead
same result
Thanks for sharing the code. At a quick glance I can see that at least one of these issues is a bug in biomaRt. The part with:
is a mistake in the package. The
.createErrorMessage()
function is suppose to give you (or me) some hints as to what's gone wrong. However the server seems to be generating a error code I've never seen before, and rather than handling that nicely biomaRt is crashing. That's not good for anyone and I will try to fix this ASAP.I'll take a longer long to try and understand what's actually going wrong. However the new Ensembl release happened today, so it may be that the server issues are related to that and will be better soon.
Again, thanks for the quick response!
I have a little more to share in case this helps.
I used biomaRt to do some different conversions today and it worked just fine so i was definitely a bit concerned what the problem with the mouse to human gene ID code might be
the code i ran successfully was this. to convert my lists of human gene IDs to ensembl IDs
It worked every time, though it had to check different ensembl mirrors. (and it often spits out several ensemble IDs per gene ID. but for what I wanted, it worked)
The mouse to human conversion still does not work (i tried it again after my success with human to human gene IDs)
I dont know if this helps or not. But it demonstrates that biomaRt is working, and it is successfully communicating with ensembl .
I think there might be something wrong with the linked dataset functionality after the latest Ensembl release (that's
getLDS()
is accessing). You're not the only person experiencing problems withgetLDS()
e.g. Problems with biomaRt's getLDS and https://github.com/grimbough/biomaRt/issues/59 . I am also failing to run the queries using the web interface at https://www.ensembl.org/biomart/martview/I've reported this to Ensembl, hopefully they're be able to diagnose the issue.
Hello, I am also having the same issue and have for a couple of days now...is there any update on when it might be fixed? or does anyone have an alternative way of translating? I need to get from ensembl mouse to human entrez - any ideas greatly received! thanks :)
Hey, I just solve this problem by adding : human <- useMart("ensembl", dataset = "hsapiens_gene_ensembl", host = "https://dec2021.archive.ensembl.org/") mouse <- useMart("ensembl", dataset = "mmusculus_gene_ensembl", host = "https://dec2021.archive.ensembl.org/")
Give this code a shot. It will amaze you.
This worked for me, thanks!
This was working for me briefly, but is now resulting in connection timeout errors. Is anybody else having this issue using the December 2021 archive?
Wow! this worked perfectly! thanks so much!
This worked for me, thanks!
This does not work for me :( It seems the problem is with the getLDS function. Has anyone else found a different solution?
Same here problem with getLDS(). Anyone has any idea that can run in a website or other R package?
Mike Smith I would like to mention that I received the same error
while using the functions
useMart() + getBM()
inside a foreach function in the context of this task.