Title: | Venn Diagram for genomic interaction data |
---|---|
Description: | A package to generate high-resolution Venn and Upset plots for genomic interaction data from HiC, ChIA-PET, HiChIP, PLAC-Seq, Hi-TrAC, HiCAR and etc. The package generates plots specifically crafted to eliminate the deceptive visual representation caused by the counts method. |
Authors: | Jianhong Ou [aut, cre] |
Maintainer: | Jianhong Ou <[email protected]> |
License: | GPL-3 |
Version: | 1.5.0 |
Built: | 2024-10-30 08:15:43 UTC |
Source: | https://github.com/bioc/hicVennDiagram |
Brow the venn plot in a web browser to adjust the plot and export the result.
browseVenn(plot, width = NULL, height = NULL)
browseVenn(plot, width = NULL, height = NULL)
plot |
|
width |
width of the figure |
height |
height of the figure |
An object of class htmlwidget that will intelligently print itself into HTML in a variety of contexts including the R console, within R Markdown documents, and within Shiny output bindings.
pd <- system.file("extdata", package = "hicVennDiagram", mustWork = TRUE) fs <- dir(pd, pattern = ".bedpe", full.names = TRUE) vc <- vennCount(fs) p <- vennPlot(vc) browseVenn(p)
pd <- system.file("extdata", package = "hicVennDiagram", mustWork = TRUE) fs <- dir(pd, pattern = ".bedpe", full.names = TRUE) vc <- vennCount(fs) p <- vennPlot(vc) browseVenn(p)
Output and render functions for using browseVenn within Shiny applications and interactive Rmd documents.
browseVennOutput(outputId, width = "100%", height = "400px") renderbrowseVenn(expr, env = parent.frame(), quoted = FALSE)
browseVennOutput(outputId, width = "100%", height = "400px") renderbrowseVenn(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from |
width , height
|
Must be a valid CSS unit (like |
expr |
An expression that generates a browseVenn |
env |
The environment in which to evaluate |
quoted |
Is |
Create background based on the distance distribution of input GInteractions.
createGIbackground(gi, size = 2 * lengths(gi))
createGIbackground(gi, size = 2 * lengths(gi))
gi |
A vector of bedpe files or a list of genomic interaction data (Pairs or GInteractions). |
size |
The maximal size of the background |
pd <- system.file("extdata", package = "hicVennDiagram", mustWork = TRUE) fs <- dir(pd, pattern = ".bedpe", full.names = TRUE)[1] set.seed(123) # createGIbackground(fs)
pd <- system.file("extdata", package = "hicVennDiagram", mustWork = TRUE) fs <- dir(pd, pattern = ".bedpe", full.names = TRUE)[1] set.seed(123) # createGIbackground(fs)
Run Genomic Loops Enrichment Analysis Method test
gleamTest(query, subject, background, method = c("binom", "hyper"), ...)
gleamTest(query, subject, background, method = c("binom", "hyper"), ...)
query , subject
|
A vector of bedpe files or a list of genomic interaction data (Pairs or GInteractions) or a list of GRanges object. 'subject' is optional if length of query > 1. |
background |
The test will restricted within the region. The background is the background of subject if subject is available. Otherwise, the background is the the background of second element of comparison group. |
method |
Distribution type for p-value. |
... |
parameters used by findOverlaps. |
# example code pd <- system.file("extdata", package = "hicVennDiagram", mustWork = TRUE) fs <- dir(pd, pattern = ".bedpe", full.names = TRUE) library(TxDb.Hsapiens.UCSC.hg38.knownGene) ## set.seed(123) ## background <- createGIbackground(fs) ## gleamTest(fs, background = background) ## gleamTest(fs, background = background, method = 'hyper') grl <- GRangesList(exons=reduce(exons(TxDb.Hsapiens.UCSC.hg38.knownGene)), genes=reduce(genes(TxDb.Hsapiens.UCSC.hg38.knownGene))) gleamTest(fs[seq_along(grl)], grl, background = grl[['exons']]) gleamTest(grl[c(2, 1)], grl, background = grl[['exons']]) gleamTest(grl, background = grl[['genes']])
# example code pd <- system.file("extdata", package = "hicVennDiagram", mustWork = TRUE) fs <- dir(pd, pattern = ".bedpe", full.names = TRUE) library(TxDb.Hsapiens.UCSC.hg38.knownGene) ## set.seed(123) ## background <- createGIbackground(fs) ## gleamTest(fs, background = background) ## gleamTest(fs, background = background, method = 'hyper') grl <- GRangesList(exons=reduce(exons(TxDb.Hsapiens.UCSC.hg38.knownGene)), genes=reduce(genes(TxDb.Hsapiens.UCSC.hg38.knownGene))) gleamTest(fs[seq_along(grl)], grl, background = grl[['exons']]) gleamTest(grl[c(2, 1)], grl, background = grl[['exons']]) gleamTest(grl, background = grl[['genes']])
Plot the overlaps counts by ComplexUpset.
upsetPlot( vennTable, label_all = list(na.rm = TRUE, color = "gray30", alpha = 0.7, label.padding = unit(0.1, "lines")), coln_prefix = NULL, ... )
upsetPlot( vennTable, label_all = list(na.rm = TRUE, color = "gray30", alpha = 0.7, label.padding = unit(0.1, "lines")), coln_prefix = NULL, ... )
vennTable |
An vennTable object, the first element in the output of vennCount. |
label_all |
A list of parameters used by geom_label for text labels of counts for each group. If it set to FALSE or length of the list is zero, the labels will be ignored. |
coln_prefix |
The prefix to be removed for colnumn names of vennTable. |
... |
Parameters could be passed to upset
except |
A ggplot object.
pd <- system.file("extdata", package = "hicVennDiagram", mustWork = TRUE) fs <- dir(pd, pattern = ".bedpe", full.names = TRUE) vc <- vennCount(fs) upset_themes_fix <- lapply(ComplexUpset::upset_themes, function(.ele){ .ele[names(.ele) %in% names(formals(ggplot2::theme))] }) upsetPlot(vc, theme = upset_themes_fix) ## change the font size of lables and numbers themes <- ComplexUpset::upset_modify_themes( ## get help by vignette('Examples_R', package = 'ComplexUpset') list('intersections_matrix'= ggplot2::theme(axis.text.y=ggplot2::element_text(size=24))) ) themes <- lapply(themes, function(.ele){ .ele[names(.ele) %in% names(formals(ggplot2::theme))] }) upsetPlot(vc, label_all=list( na.rm = TRUE, color = 'gray30', alpha = .7, label.padding = grid::unit(0.1, "lines"), size = 5 ), themes = themes)
pd <- system.file("extdata", package = "hicVennDiagram", mustWork = TRUE) fs <- dir(pd, pattern = ".bedpe", full.names = TRUE) vc <- vennCount(fs) upset_themes_fix <- lapply(ComplexUpset::upset_themes, function(.ele){ .ele[names(.ele) %in% names(formals(ggplot2::theme))] }) upsetPlot(vc, theme = upset_themes_fix) ## change the font size of lables and numbers themes <- ComplexUpset::upset_modify_themes( ## get help by vignette('Examples_R', package = 'ComplexUpset') list('intersections_matrix'= ggplot2::theme(axis.text.y=ggplot2::element_text(size=24))) ) themes <- lapply(themes, function(.ele){ .ele[names(.ele) %in% names(formals(ggplot2::theme))] }) upsetPlot(vc, label_all=list( na.rm = TRUE, color = 'gray30', alpha = .7, label.padding = grid::unit(0.1, "lines"), size = 5 ), themes = themes)
Given a collection of bedpe files or a list of genomic interaction data,
vennCount
will compute all possible combinations of interactions
and return an object of class vennTable, storing the combinations
as well as the number of elements in each intersection.
vennCount(gi, FUN = min, ...)
vennCount(gi, FUN = min, ...)
gi |
A vector of bedpe files or a list of genomic interaction data (Pairs or GInteractions) |
FUN |
Function to summarize the overlapping number. |
... |
parameters used by findOverlaps |
An object of vennTable
pd <- system.file("extdata", package = "hicVennDiagram", mustWork = TRUE) fs <- dir(pd, pattern = ".bedpe", full.names = TRUE) vc <- vennCount(fs)
pd <- system.file("extdata", package = "hicVennDiagram", mustWork = TRUE) fs <- dir(pd, pattern = ".bedpe", full.names = TRUE) vc <- vennCount(fs)
Plot the overlaps counts by eulerr.
vennPlot(vennTable, shape = "circle", ...)
vennPlot(vennTable, shape = "circle", ...)
vennTable |
An vennTable object, the first element in the output of vennCount. |
shape |
Geometric shape used in the diagram used by euler. |
... |
parameters to update fills and edges with and thereby a shortcut to set these parameters plot.euler. |
A grid object.
pd <- system.file("extdata", package = "hicVennDiagram", mustWork = TRUE) fs <- dir(pd, pattern = ".bedpe", full.names = TRUE) vc <- vennCount(fs) vennPlot(vc) ## change the font size of venn plot lables and numbers, ## both cex or fontsize should work vennPlot(vc, quantities=list(fontsize=24), labels=list(cex=1.5))
pd <- system.file("extdata", package = "hicVennDiagram", mustWork = TRUE) fs <- dir(pd, pattern = ".bedpe", full.names = TRUE) vc <- vennCount(fs) vennPlot(vc) ## change the font size of venn plot lables and numbers, ## both cex or fontsize should work vennPlot(vc, quantities=list(fontsize=24), labels=list(cex=1.5))
"vennTable"
An object of class "vennTable"
represents Venn counts.
vennTable(...) ## S4 method for signature 'vennTable' x$name ## S4 replacement method for signature 'vennTable' x$name <- value ## S4 method for signature 'vennTable,ANY,ANY' x[[i]] ## S4 replacement method for signature 'vennTable,ANY,ANY' x[[i]] <- value ## S4 method for signature 'vennTable' show(object)
vennTable(...) ## S4 method for signature 'vennTable' x$name ## S4 replacement method for signature 'vennTable' x$name <- value ## S4 method for signature 'vennTable,ANY,ANY' x[[i]] ## S4 replacement method for signature 'vennTable,ANY,ANY' x[[i]] <- value ## S4 method for signature 'vennTable' show(object)
... |
Each argument in ... becomes an slot in the new vennTable. |
x |
an object of vennTable |
name |
slot name of vennTable |
value |
values to assign |
i |
slot name of vennTable |
object |
an object of vennTable. |
An object of vennTable.
combinations
A logical "matrix"
, specify the combinations.
counts
A "numeric"
vector, the overall counts number for
each combination.
vennCounts
A "matrix"
object, specify the counts number for
each sample in the combination.
overlapList
"list"
, overlapping list of the genomic
interactions.
vt <- vennTable()
vt <- vennTable()