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

I use the latest release version of Chipseeker #67

Closed sunxuwu closed 6 years ago

sunxuwu commented 6 years ago

Prerequisites

Describe you issue

Ask in right place

sunxuwu commented 6 years ago

library(ChIPseeker) library(TxDb.Athaliana.BioMart.plantsmart22) txdb <- TxDb.Athaliana.BioMart.plantsmart22 library(clusterProfiler) files <- getSampleFiles() print(files) peak <- readPeakFile(files[[5]]) peak covplot(peak, weightCol="V4") covplot(peak, weightCol="V4", chrs=c("2", "3"), xlim=c(4.5e6, 5e6))promoter <- getPromoters(TxDb=txdb, upstream=3000, downstream=3000, by = "gene") tagMatrix <- getTagMatrix(peak, windows=promoter) tagMatrix <- getTagMatrix(peak, weightCol = NULL,windows = promoter) tagMatrixList <- lapply(files, getTagMatrix, windows=promoter) tagMatrix <- tagMatrixList[[5]] tagHeatmap(tagMatrix, xlim=c(-3000, 3000), color="red") peakHeatmap(files[[5]], TxDb=txdb, upstream=3000, downstream=3000, color="red") plotAvgProf(tagMatrix, xlim=c(-3000, 3000), xlab="Genomic Region (5'->3')", ylab = "Read Count Frequency") plotAvgProf2(files[[5]], TxDb=txdb, upstream=3000, downstream=3000, xlab="Genomic Region (5'->3')", ylab = "Read Count Frequency") plotAvgProf(tagMatrix, xlim=c(-3000, 3000), conf = 0.95, resample = 3000) library(org.At.tair.db) peakAnno <- annotatePeak(files[[5]], tssRegion=c(-3000, 3000), TxDb=txdb, annoDb="org.At.tair.db")

I use library(org.At.tair.db)for peak annotate, but doesn't work

would you please suggest me a right annotation library for Arabidopsis?

GuangchuangYu commented 6 years ago
files <- getSampleFiles()
print(files)
peak <- readPeakFile(files[[5]])

why you expect to annotate the peak (from hg19) using Arabidopsis TxDb to be succeed?

sunxuwu commented 6 years ago

I have replaced the sample data in your package with my own data that come from Arabidopsis.

There are many error massages in Console windows. I don't know how to solve them. Could you please give me a solution?

tagMatrix <- getTagMatrix(peak, windows=promoter) Error in split.default(1:length(windows), as.factor(seqnames(windows))) : group length is 0 but data length > 0 In addition: Warning message: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) tagMatrix <- getTagMatrix(peak, weightCol = NULL,windows = promoter) Error in split.default(1:length(windows), as.factor(seqnames(windows))) : group length is 0 but data length > 0 In addition: Warning message: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) tagMatrixList <- lapply(files, getTagMatrix, windows=promoter) Error in split.default(1:length(windows), as.factor(seqnames(windows))) : group length is 0 but data length > 0 In addition: Warning message: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.)

GuangchuangYu commented 6 years ago

Describe you issue

sunxuwu commented 6 years ago

loading packages

library(ChIPseeker) library(TxDb.Athaliana.BioMart.plantsmart22) txdb <- TxDb.Athaliana.BioMart.plantsmart22 library(clusterProfiler) files <- getSampleFiles() print(files) peak <- readPeakFile(files[[5]]) peak covplot(peak, weightCol="V5") covplot(peak, weightCol="V5", chrs=c("chr2", "chr3"), xlim=c(4.5e6, 5e6)) promoter <- getPromoters(TxDb=txdb, upstream=3000, downstream=3000, by = "gene") tagMatrix <- getTagMatrix(peak, windows=promoter) tagMatrixList <- lapply(files, getTagMatrix, windows=promoter) tagMatrix <- tagMatrixList[[5]] tagHeatmap(tagMatrix, xlim=c(-3000, 3000), color="red") peakHeatmap(files[[5]], TxDb=txdb, upstream=3000, downstream=3000, color="red") plotAvgProf(tagMatrix, xlim=c(-3000, 3000), xlab="Genomic Region (5'->3')", ylab = "Read Count Frequency") plotAvgProf2(files[[5]], TxDb=txdb, upstream=3000, downstream=3000, xlab="Genomic Region (5'->3')", ylab = "Read Count Frequency") plotAvgProf(tagMatrix, xlim=c(-3000, 3000), conf = 0.95, resample = 3000) library(org.At.tair.db) peakAnno <- annotatePeak(files[[5]], tssRegion=c(-3000, 3000), TxDb=txdb, annoDb="org.At.tair.db") plotAnnoPie(peakAnno) plotAnnoBar(peakAnno) vennpie(peakAnno) upsetplot(peakAnno) upsetplot(peakAnno, vennpie=TRUE) plotDistToTSS(peakAnno, title="Distribution of transcription factor-binding loci\nrelative to TSS") library(ReactomePA)

pathway1 <- enrichPathway(as.data.frame(peakAnno)$geneId) head(pathway1, 2) gene <- seq2gene(peak, tssRegion = c(-1000, 1000), flankDistance = 3000, TxDb=txdb) pathway2 <- enrichPathway(gene) head(pathway2, 2) dotplot(pathway2)

==========================================

in console windows

=============================> peak <- readPeakFile(files[[5]])

peak GRanges object with 15569 ranges and 2 metadata columns: seqnames ranges strand | V4 V5

| [1] chr1 [ 3589, 4098] * | MACS_peak_1 237.06 [2] chr1 [ 8314, 8808] * | MACS_peak_2 125.13 [3] chr1 [12484, 13025] * | MACS_peak_3 187.49 [4] chr1 [23134, 23807] * | MACS_peak_4 236.10 [5] chr1 [37304, 37697] * | MACS_peak_5 127.79 ... ... ... ... . ... ... [15565] chr5 [26957878, 26958401] * | MACS_peak_15565 499.40 [15566] chr5 [26959898, 26960232] * | MACS_peak_15566 107.73 [15567] chr5 [26962975, 26963673] * | MACS_peak_15567 246.45 [15568] chr5 [26968829, 26969475] * | MACS_peak_15568 457.56 [15569] chr5 [26969862, 26970715] * | MACS_peak_15569 279.40 ------- seqinfo: 5 sequences from an unspecified genome; no seqlengths> promoter <- getPromoters(TxDb=txdb, upstream=3000, downstream=3000, by = "gene") tagMatrix <- getTagMatrix(peak, windows=promoter) Error in split.default(1:length(windows), as.factor(seqnames(windows))) : group length is 0 but data length > 0 In addition: Warning message: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) tagMatrix <- getTagMatrix(peak, weightCol = NULL,windows = promoter) Error in split.default(1:length(windows), as.factor(seqnames(windows))) : group length is 0 but data length > 0 In addition: Warning message: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) tagMatrixList <- lapply(files, getTagMatrix, windows=promoter) Error in split.default(1:length(windows), as.factor(seqnames(windows))) : group length is 0 but data length > 0 In addition: Warning message: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.)

I have replaced the sample data in your package with my data from Arabidopsis. But results in many errors. Could you please give me a solution? Thank you very much!