InteVenn.Rd
Create Venn Diagram for Two Differential Analysis Integration Results.
InteVenn( inte.res, inte.type = c("DEbPeak", "PeakbPeak", "DEbDE"), peak.type = c("ChIP", "ATAC", "Peak"), peak.mode = c("consensus", "diff"), gene.col = c("geneId", "ENSEMBL", "SYMBOL"), ... )
inte.res | Integration results, can be output of |
---|---|
inte.type | The integration type, choose from "DEbDE", "PeakbPeak", "DEbPeak". Default: "DEbPeak". |
peak.type | Used when |
peak.mode | Used when |
gene.col | Used when |
... | Parameters for |
A ggplot2 object.
library(DEbPeak) #### RNA-seq and RNA-seq rna.diff.file <- system.file("extdata", "RA_RNA_diff.txt", package = "DEbPeak") de1.res <- read.table(file = rna.diff.file, header = TRUE, sep = "\t") de2.res <- read.table(file = rna.diff.file, header = TRUE, sep = "\t") # use same file as example de.de <- DEbDE(de1.res = de1.res, de2.res = de2.res, de1.l2fc.threshold = 0.5, de2.l2fc.threshold = 1)#>#>de.de.venn <- InteVenn(inte.res = de.de, inte.type = "DEbDE", show_percentage = FALSE) #### peak-related and peak-related # ChIP-seq data chip.file <- system.file("extdata", "debchip_peaks.bed", package = "DEbPeak") chip.df <- GetConsensusPeak(peak.file = chip.file) chip.anno <- AnnoPeak( peak.df = chip.df, species = "Mouse", seq.style = "UCSC", up.dist = 20000, down.dist = 20000 )#> >> preparing features information... 2023-07-02 17时18分44秒 #> >> identifying nearest features... 2023-07-02 17时18分44秒 #> >> calculating distance from peak to TSS... 2023-07-02 17时18分44秒 #> >> assigning genomic annotation... 2023-07-02 17时18分44秒 #> >> adding gene annotation... 2023-07-02 17时18分46秒#>#> >> assigning chromosome lengths 2023-07-02 17时18分46秒 #> >> done... 2023-07-02 17时18分46秒#> Warning: Removed 6 rows containing non-finite values (`stat_count()`).# ATAC-seq data atac.file <- system.file("extdata", "debatac_peaks.bed", package = "DEbPeak") atac.df <- GetConsensusPeak(peak.file = atac.file) atac.anno <- AnnoPeak( peak.df = atac.df, species = "Mouse", seq.style = "UCSC", up.dist = 20000, down.dist = 20000 )#> >> preparing features information... 2023-07-02 17时18分47秒 #> >> identifying nearest features... 2023-07-02 17时18分47秒 #> >> calculating distance from peak to TSS... 2023-07-02 17时18分48秒 #> >> assigning genomic annotation... 2023-07-02 17时18分48秒 #> >> adding gene annotation... 2023-07-02 17时18分50秒#>#> >> assigning chromosome lengths 2023-07-02 17时18分50秒 #> >> done... 2023-07-02 17时18分50秒#> Warning: Removed 23 rows containing non-finite values (`stat_count()`).# integrate chip.atac <- PeakbPeak(peak1.res = chip.anno$df, peak2.res = atac.anno$df, peak.mode = "consensus", peak.anno.key = "Promoter") # functional enrichment chip.atac.venn <- InteVenn(inte.res = chip.atac, inte.type = "PeakbPeak", peak.mode = "consensus", show_percentage = FALSE) #### RNA-seq and peak-related library(DESeq2) # ChIP-Seq data peak.file <- system.file("extdata", "debchip_peaks.bed", package = "DEbPeak") peak.df <- GetConsensusPeak(peak.file = peak.file) peak.profile <- PeakProfile(peak.df, species = "Mouse", by = "gene", region.type = "body", nbin = 800)#> >> preparing promoter regions... 2023-07-02 17时18分52秒 #> >> preparing tag matrix... 2023-07-02 17时18分52秒 #> >> preparing start_site regions by ... 2023-07-02 17时18分52秒 #> >> preparing tag matrix... 2023-07-02 17时18分52秒 #> >> generating figure... 2023-07-02 17时19分00秒#> >> done... 2023-07-02 17时19分00秒#> >> binning method is used...2023-07-02 17时19分00秒 #> >> preparing start_site regions by gene... 2023-07-02 17时19分00秒 #> >> preparing tag matrix by binning... 2023-07-02 17时19分00秒 #> >> Running bootstrapping for tag matrix... 2023-07-02 17时19分08秒 #> >> binning method is used...2023-07-02 17时19分08秒 #> >> preparing body regions by gene... 2023-07-02 17时19分08秒 #> >> preparing tag matrix by binning... 2023-07-02 17时19分08秒 #> >> preparing matrix with extension from (TSS-20%)~(TTS+20%)... 2023-07-02 17时19分09秒 #> >> 1 peaks(0.1536098%), having lengths smaller than 800bp, are filtered... 2023-07-02 17时19分11秒 #> >> Running bootstrapping for tag matrix... 2023-07-02 17时19分52秒peak.anno <- AnnoPeak( peak.df = peak.df, species = "Mouse", seq.style = "UCSC", up.dist = 20000, down.dist = 20000 )#> >> preparing features information... 2023-07-02 17时19分53秒 #> >> identifying nearest features... 2023-07-02 17时19分53秒 #> >> calculating distance from peak to TSS... 2023-07-02 17时19分53秒 #> >> assigning genomic annotation... 2023-07-02 17时19分53秒 #> >> adding gene annotation... 2023-07-02 17时19分55秒#>#> >> assigning chromosome lengths 2023-07-02 17时19分55秒 #> >> done... 2023-07-02 17时19分55秒#> Warning: Removed 6 rows containing non-finite values (`stat_count()`).# RNA-Seq data count.file <- system.file("extdata", "debchip_count.txt", package = "DEbPeak") meta.file <- system.file("extdata", "debchip_meta.txt", package = "DEbPeak") count.matrix <- read.table(file = count.file, header = TRUE, sep = "\t") meta.info <- read.table(file = meta.file, header = TRUE) # create DESeqDataSet object dds <- DESeq2::DESeqDataSetFromMatrix( countData = count.matrix, colData = meta.info, design = ~condition )#> Warning: some variables in design formula are characters, converting to factors# set control level dds$condition <- relevel(dds$condition, ref = "NF") # conduct differential expressed genes analysis dds <- DESeq(dds)#>#>#>#>#>#># extract results dds.results <- results(dds, contrast = c("condition", "RX", "NF")) dds.results.ordered <- dds.results[order(dds.results$log2FoldChange, decreasing = TRUE), ] # Integrated with RNA-Seq debchip.res <- DEbPeak( de.res = dds.results.ordered, peak.res = peak.anno[["df"]], peak.anno.key = "Promoter", merge.key = "SYMBOL" )#>debatac.res.venn <- InteVenn( inte.res = debatac.res, inte.type = "DEbPeak", peak.mode = "diff", peak.type = "ATAC", show_percentage = FALSE )#> Error in dplyr::distinct(., Peak_SYMBOL, Type, .keep_all = TRUE): 找不到对象'debatac.res'