使用"biomaRt"包进行基因ID转换
1、安装"biomaRt"包
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("biomaRt")
library("biomaRt")
2、"ensembl_transcript_id_version" 转 "refseq_mrna", "ensembl_gene_id", "hgnc_symbol"
输入文件file.txt如下所示:
转换命令如下:
values<- read.table("file.txt",header=F)
ensembl = useEnsembl(biomart = "ensembl", dataset = "hsapiens_gene_ensembl", mirror = "useast")
new=getBM(attributes=c("ensembl_transcript_id_version","refseq_mrna", "ensembl_gene_id", "hgnc_symbol"), filters = "ensembl_transcript_id_version", values = values, mart= ensembl)
输出文件new如下所示:
本文来自博客园,作者:橙子牛奶糖(陈文燕),转载请注明原文链接:https://www.cnblogs.com/chenwenyan/p/15064848.html