Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fix #112 #121 #139 #148

Merged
merged 3 commits into from Apr 27, 2021
Merged

bug fix #112 #121 #139 #148

merged 3 commits into from Apr 27, 2021

Conversation

MingLi-929
Copy link
Contributor

@MingLi-929 MingLi-929 commented Apr 13, 2021

This pull request is to fix #112, #121, #139, which reflects the same problem having two parts.

The first part is that when change the options(ChIPseeker.downstreamDistance = 500), the marker in the picture change but the ratio of Downstream(<=N) do not change.The reason is because #112 (comment).

library(ChIPseeker)
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene

files <- getSampleFiles()
peak <- readPeakFile(files[[4]])

options(ChIPseeker.downstreamDistance = 3000)
getOption('ChIPseeker.downstreamDistance')
x <- annotatePeak(peak,
                  tssRegion = c(-1000,1000),
                  TxDb = txdb)
plotAnnoPie(x,cex = 0.7)

distance3000

options(ChIPseeker.downstreamDistance = 500)
getOption('ChIPseeker.downstreamDistance')
x1 <- annotatePeak(peak,
                  tssRegion = c(-1000,1000),
                  TxDb = txdb)
plotAnnoPie(x1,cex = 0.7)

distance500
As it shows above the marker is changed, but the ratio do not change.

The second part is the misuse of precede(), which reported in #139. This problem causes the different between the result of annotatePeak and peakAnno@detailGenomicAnnotation$downstream.

# issue139
library(ChIPseeker)
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
TxDb <- TxDb.Hsapiens.UCSC.hg19.knownGene

files <- getSampleFiles()
peakAnno <- annotatePeak(files[[2]], tssRegion=c(-500, 0),
                         TxDb=TxDb, 
                         level = "gene")

# According to the peakAnno result, there will be about 20 peaks in the downstream. 
> peakAnno
Annotated peaks generated by ChIPseeker
2296/2296  peaks were annotated
Genomic Annotation Summary:
             Feature  Frequency
9           Promoter  0.7404181
4             5' UTR  0.6533101
3             3' UTR  1.5243902
1           1st Exon  0.4355401
7         Other Exon  2.6567944
2         1st Intron 14.5905923
8       Other Intron 31.6637631
6 Downstream (<=300)  0.8710801
5  Distal Intergenic 46.8641115

# But according to the result below, it seems no peak locating downstream
> sum(peakAnno@detailGenomicAnnotation$downstream)
[1] 0

the reason is because #139 (comment).

After doing the changing, the two parts are corrected.

options(ChIPseeker.downstreamDistance = 3000)
getOption('ChIPseeker.downstreamDistance')
x <- annotatePeak(peak,
                  tssRegion = c(-1000,1000),
                  TxDb = txdb)
plotAnnoPie(x,cex = 0.7)

4
The reason that ratio changes from 1.13% to 1.05% is that I use follow() to replace precede(). Different functions get different result.

options(ChIPseeker.downstreamDistance = 500)
getOption('ChIPseeker.downstreamDistance')
x1 <- annotatePeak(peak,
                   tssRegion = c(-1000,1000),
                   TxDb = txdb)
plotAnnoPie(x1,cex = 0.7)

3

All that above is what the PR do.

@GuangchuangYu GuangchuangYu merged commit e034e87 into YuLab-SMU:master Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

options(ChIPseeker.downstreamDistance = 500) seems not work
2 participants