Entering edit mode
Hi,
I am using biomaRt to convert mouse gene symbols to human and vice versa.
Here is the code:
library(biomaRt)
human = useMart("ensembl", dataset = "hsapiens_gene_ensembl")
mouse = useMart("ensembl", dataset = "mmusculus_gene_ensembl")
convertMouseGeneList <- function(x, y){
# convert mouse to human
genesV1 = getLDS(attributes = c("mgi_symbol"), filters = "mgi_symbol", values = x ,
mart = mouse, attributesL = c("hgnc_symbol"), martL = human, uniqueRows=T)
print(genesV1)
# convert human to mouse
genesV2 = getLDS(attributes = c("hgnc_symbol"), filters = "hgnc_symbol", values = y ,
mart = human, attributesL = c("mgi_symbol"), martL = mouse, uniqueRows=T)
print(genesV2)
}
x <- 'Rpl18' # mouse gene
y <- 'RPL18' # human gene
convertMouseGeneList(x, y)
This returns a NULL dataframe. However, on MGI, they have mentioned that the human ortholog to Rpl18 is RPL18. How can I fix this? I have also submitted an issue on github regarding this, but I wasn't sure about the response rate there.
Thanks!
Oh yeah, that return statement was a typo. I know two returns are not possible. I'll fix that. The question is still what I have asked: why Rpl18 is not getting mapped to RPL18.
Just to emphasis what James has demonstrated, take a look at the ortholog sections on the Ensembl pages for RPL18 and TP53. Ensembl doesn't list an ortholog for RPL18 in rat, so your biomaRt query wont find anything - it only looks at the data that are in Ensembl. TP53 does has an ortholog listed, and the query returns that.
If you want to know why the data are differnet between MGI and Ensembl you'll need to contact the two institutions directly as there are many possible reasons.
Yeah I was confused because MGI reports the human ortholog but Ensembl does not. Anyway, I will report this to the respective institutions and would like to keep this open here until I get an answer from them.