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"),
  ...
)

Arguments

inte.res

Integration results, can be output of DEbPeak, PeakbPeak, DEbDE.

inte.type

The integration type, choose from "DEbDE", "PeakbPeak", "DEbPeak". Default: "DEbPeak".

peak.type

Used when inte.type is "DEbPeak". The source of peaks, chosen from ATAC, ChIP and Peak (ChIP and ATAC). Default: ChIP.

peak.mode

Used when inte.type is "DEbPeak" or "PeakbPeak". The source of peak results, choose from consensus (peak annotation) and diff (differential expression analysis). Default: consensus.

gene.col

Used when inte.type is "DEbPeak" and peak.type is Peak or peak.mode is "consensus" in peak.type ATAC or ChIP. Column of inte.res contains genes. Same as merge.key in DEbPeak.

...

Parameters for ggvenn.

Value

A ggplot2 object.

Examples

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)
#> Differential expression analysis with DESeq2!
#> Differential expression analysis with DESeq2!
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秒
#> 'select()' returned 1:many mapping between keys and columns
#> >> 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秒
#> 'select()' returned 1:many mapping between keys and columns
#> >> 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秒
#> 'select()' returned 1:many mapping between keys and columns
#> >> 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)
#> estimating size factors
#> estimating dispersions
#> gene-wise dispersion estimates
#> mean-dispersion relationship
#> final dispersion estimates
#> fitting model and testing
# 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" )
#> Differential expression analysis with DESeq2!
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'