根据基因location获取基因ID

作者: 落寞的橙子 | 来源:发表于2019-02-03 05:40 被阅读5次

Get gene name from location
hg19
source("https://bioconductor.org/biocLite.R")
biocLite("Homo.sapiens")
https://www.biostars.org/p/167818/
library(Homo.sapiens)
library(dplyr)
genes(TxDb.Hsapiens.UCSC.hg19.knownGene)
rt<-read.table("macs.out.txt",header = T,skip=16,sep = "\t") #skip了16行
mycoords.gr<-rt[,1:3] %>% makeGRangesFromDataFrame # 前三列为chr 、 start、 end,构建符合条件数据结构
geneid<-subsetByOverlaps(genes(TxDb.Hsapiens.UCSC.hg19.knownGene), mycoords.gr) #获取基因id
write.csv(geneid,"geneid.csv")#输出结果

相关文章

网友评论

    本文标题:根据基因location获取基因ID

    本文链接:https://www.haomeiwen.com/subject/awtysqtx.html