首页 > 其他 > 详细

Converting mouse to human gene names with biomaRt package

时间:2019-07-04 19:48:00      阅读:136      评论:0      收藏:0      [点我收藏+]
musGenes <- c("Hmmr", "Tlx3", "Cpeb4")
 
# Basic function to convert mouse to human gene names
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)
}

  We can just as easily write a function to go from human to mouse genes.

# Basic function to convert human to mouse gene names
convertHumanGeneList <- function(x){
 
require("biomaRt")
human = useMart("ensembl", dataset = "hsapiens_gene_ensembl")
mouse = useMart("ensembl", dataset = "mmusculus_gene_ensembl")
 
genesV2 = getLDS(attributes = c("hgnc_symbol"), filters = "hgnc_symbol", values = x , mart = human, attributesL = c("mgi_symbol"), martL = mouse, uniqueRows=T)
 
humanx <- unique(genesV2[, 2])
 
# Print the first 6 genes found to the screen
print(head(humanx))
return(humanx)
}
 
genes <- convertMouseGeneList(humGenes)

  

Converting mouse to human gene names with biomaRt package

原文:https://www.cnblogs.com/qiniqnyang/p/11133933.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!