본문 바로가기

카테고리 없음

mouse symbol to human gene symbol

728x90
반응형

#' mouse genes to human gene symbol
#'
#' This function is to change mouse genes to human gene symbol
#' @param x (default=NA) : character vector of mouse gene list
#' @keywords gene
#' @export
#' @examples
#' x=c("Hmmr", "Tlx3", "Cpeb4")
#' mouse2human_symbol(x)
#-----------------------------------------
# Mouse2human_symbol
#-----------------------------------------
mouse2human_symbol <- function(x){

require("biomaRt")
if(!exists('human_ensembl')|!exists('mouse_ensembl')){
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)
colnames(genesV2)=c('mouse','human')


return(genesV2)
}

728x90
반응형