YuLab-SMU / ChIPseeker

:dart: ChIP peak Annotation, Comparison and Visualization
https://onlinelibrary.wiley.com/share/author/GYJGUBYCTRMYJFN2JFZZ?target=10.1002/cpz1.585
220 stars 74 forks source link

tagMatrix upstream and downstream should be actual number error #175

Open tiagochst opened 2 years ago

tiagochst commented 2 years ago

If upstream and downstream are not in the attributes of the Granges, the arguments downstream and upstream are not working https://github.com/YuLab-SMU/ChIPseeker/blob/0e597a539bcffd1105e032d73d7365f303d64a0c/R/tagMatrix.R#L201

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)$upstream <- NULL
attributes(promoter)$downstream <- NULL
tagMatrix <- getTagMatrix(peak, windows=promoter,downstream = 3000,upstream = 3000)
Screen Shot 2022-01-05 at 11 57 41 AM
MingLi-929 commented 2 years ago

If upstream and downstream are not in the attributes of the Granges, the arguments downstream and upstream are not working

Definitely, it would not work. Because getPromoters() and getTagMatrix() worked in cooperation. For the reason raised in the previous issue(#174), attributes were added to the output in order to simplify the input arguments. The only reason to do all the actions is to make the function friendly to users. So many arugments are attributed to the output in the funcions in ChIPseeker.