getTagMatrix with Granges without type attribute gives an error
tiagochst opened this issue · 1 comments
tiagochst commented
Prerequisites
Hello, https://guangchuangyu.github.io is not reachable.
Describe your issue
If Granges does not have an attribute type, the code does not work. As far as I know, it is also not a required argument to create a GRanges.
Line 179 in 0e597a5
Code to reproduce the error:
library(ChIPseeker)
library(ChIPseeker)
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
library(clusterProfiler)
package.version("ChIPseeker")
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
files <- getSampleFiles()
print(files)
peak <- readPeakFile(files[[4]])
peak
promoter <- getPromoters(TxDb=txdb, upstream=3000, downstream=3000)
attributes(promoter)$type <- NULL
tagMatrix <- getTagMatrix(peak, windows=promoter)
MingLi-929 commented
As far as I know, it is also not a required argument to create a GRanges.
Definitely, there is no need to create a Granges by adding any argument.
But the attributes are added to simplify the input argument (#160 (comment)).
An attribute was attached to the output of getPromoters()
in order to make getTagMatrix()
work properly without making the users to input more arguments.