YuLab-SMU / ChIPseeker

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

some questions in ChiPseeker #108

Open xp876 opened 4 years ago

xp876 commented 4 years ago

Hello,

When I annotate my peak file using ChiPseeker, I encounted some problems. Could you please help me solve them?

Here is my code: library(ChIPseeker) library(TxDb.Hsapiens.UCSC.hg38.knownGene) txdb<-TxDb.Hsapiens.UCSC.hg38.knownGene library(clusterProfiler)

files <- getSampleFiles()

print(files)

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

setwd("C:/Users/PANJ4J/Desktop/r") narrow<-readPeakFile("flt-narrow.csv") #modify file broad<-readPeakFile("flt-broad.csv") #modify file pdf("broad-1.pdf") covplot(broad, weightCol="V5") dev.off() pdf("narrow-1.pdf") covplot(narrow, weightCol="V5") dev.off() peakhebing=GenomicRanges::GRangesList(narrow,broad) p <- covplot(peakhebing) pdf("peakhebing.pdf") p dev.off() pdf("broad-2.pdf") covplot(broad, weightCol="V5", chrs=c("chr17", "chr18"), xlim=c(4.5e7, 5e7)) dev.off() pdf("narrow-2.pdf") covplot(narrow, weightCol="V5", chrs=c("chr17", "chr18"), xlim=c(4.5e7, 5e7)) dev.off() promoter <- getPromoters(TxDb=txdb, upstream=3000, downstream=3000) broad_tagMatrix<-getTagMatrix(broad,windows=promoter) narrow_tagMatrix<-getTagMatrix(narrow,windows=promoter) pdf("broad-3.pdf") tagHeatmap(broad_tagMatrix, xlim=c(-3000, 3000), color="red") dev.off() pdf("narrow-3.pdf") tagHeatmap(narrow_tagMatrix, xlim=c(-3000, 3000), color="red") dev.off() pdf("broad-4.pdf") plotAvgProf(broad_tagMatrix,xlim=c(-3000,3000),xlab="Genomic Region (5'->3')",ylab="Red Count Frequency",conf = 0.95,resample=1000) dev.off() pdf("narrow-4.pdf") plotAvgProf(narrow_tagMatrix,xlim=c(-3000,3000),xlab="Genomic Region (5'->3')",ylab="Red Count Frequency",conf = 0.95,resample=1000) dev.off() library("org.Hs.eg.db") peakbroad1<-annotatePeak(broad,tssRegion = c(-3000,3000),TxDb = txdb,annoDb = "org.Hs.eg.db") peaknarrow1<-annotatePeak(narrow,tssRegion = c(-3000,3000),TxDb = txdb,annoDb = "org.Hs.eg.db")

peakbroad<-annotatePeak("flt-broad.csv",tssRegion = c(-1500,500),TxDb = txdb)

peakbroad2<-annotatePeak(broad,tssRegion = c(-3000,3000),TxDb = txdb) peaknarrow2<-annotatePeak(narrow,tssRegion = c(-3000,3000),TxDb = txdb) peakbroad1<-as.data.frame(peakbroad1) peaknarrow1<-as.data.frame(peaknarrow1) write.table(peakbroad1,"peakbroad1.csv",sep=",") write.table(peaknarrow1,"peaknarrow1.csv",sep=",") peakbroad2<-as.data.frame(peakbroad2) peaknarrow2<-as.data.frame(peaknarrow2) write.table(peakbroad2,"peakbroad2.csv",sep=",") write.table(peaknarrow2,"peaknarrow2.csv",sep=",")

questions: ①broad-1.pdf and narrow-1.pdf seem ugly, difficult to read and even no information, you can see them below: image image ②peakhebing.pdf is the same situation as broad-1.pdf and narrow-1.pdf, ugly and even no information. you can see them below: image ③when I run the code below, I find some errs. you can see them here:

peakbroad1<-annotatePeak(broad,tssRegion = c(-3000,3000),TxDb = txdb,annoDb = "org.Hs.eg.db")

preparing features information... 2019-12-12 11:53:29 AM identifying nearest features... 2019-12-12 11:53:29 AM calculating distance from peak to TSS... 2019-12-12 11:53:29 AM assigning genomic annotation... 2019-12-12 11:53:29 AM adding gene annotation... 2019-12-12 11:53:35 AM 'select()' returned 1:many mapping between keys and columns assigning chromosome lengths 2019-12-12 11:53:35 AM done...
how to solve "'select()' returned 1:many mapping between keys and columns", what does it mean?

④if I want to look up peak signal around TTS region, how do I use your code to this end? could you please just give me some examples?

⑤In my opinion, the peak signal could exist in plus or minus band, right? Is chipseeker is appropriate for this situation?

Thank you in advance.

pastaxingxin commented 4 years ago

I want to know it, too

pastaxingxin commented 4 years ago

After these days, I found this package is not only not reliable, but also problematic. I recommend all of you use other softwares, such as homer and so on.....

eregenyi commented 4 years ago

What do you mean unreliable and problematic? I am also having the 'select()' returned 1:many mapping between keys and columns' trouble. Although I would not like to abandon the package just because of this, but it is troubling that this issue is unaddressed since December last year....