下面以人类基因为例:
library('biomaRt')
mart <- useDataset("hsapiens_gene_ensembl", useMart("ensembl"))
genes <- rownames(pbmc.markers)
G_list <- getBM(filters= "ensembl_gene_id", attributes= c("ensembl_gene_id","hgnc_symbol"),values=genes,mart= mart)
其中genes为一个向量,打印出来,如:
[1] "ENSG00000197579" "ENSG00000123096" "ENSG00000143815" "ENSG00000118257"