我想提取染色體的基因間座標。我做的代碼塊,但因爲我是新來的這些包,我不知道我是否按照正確的邏輯在這裏:查找基因間區域
library(IRanges)
library(GenomicFeatures)
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
txdb = transcriptsBy(TxDb.Hsapiens.UCSC.hg19.knownGene, by = "gene",use.names=TRUE)
#For example, only I am interested in intergenic coordinates in chromosome 1
seqlevels(txdb, force=TRUE) = c("chr1")
#Creates IRanges
ir = IRanges(start=unlist(start(txdb)), end=unlist(end(txdb)), names=names(txdb))
# Reduce overlapping gene positions to continuous range
ir.red = reduce(ir) # Collapses ranges of overlapping genes to continuous range.
#Identify overlaps among the initial and reduced range data sets
overlap = findOverlaps(ir, ir.red)
我必須採取的「+」和關懷「 - 」鏈?