### Load Example Data: cis-eQTLs Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Loads the 'eqtls' dataset, which contains lists of cis-eQTL genes from different brain regions. ```r data(eqtls) ``` -------------------------------- ### Analyze Cancer Gene Sets with SuperExactTest Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html This example demonstrates how to analyze cancer gene sets using the `supertest` function. It requires loading the `Cancer` dataset and specifies a background population size `n`. The results can then be summarized and visualized. ```R #Analyze the cancer gene sets data(Cancer) Result=supertest(Cancer, n=20687) summary(Result) plot(Result,degree=2:7,sort.by='size') ``` -------------------------------- ### Load Example Data Source: https://cran.r-project.org/web/packages/SuperExactTest/vignettes/set_html.html Load the pre-compiled cis-eQTL gene sets data included with the SuperExactTest package. This dataset is used for demonstrating the package's functionality. ```r data("eqtls") ``` -------------------------------- ### Cancer Census Dataset Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html An example dataset containing a list of seven cancer predisposition gene sets. ```APIDOC ## Cancer Census Dataset ### Description This example dataset contains a list of seven cancer predisposition gene sets. ### Usage ```R data(Cancer) ``` ### Details The seven cancer predisposition gene sets are: * NRG (Rahman, N. Realizing the promise of cancer predisposition genes. Nature 2014, 505:302-308); * NBG (Tamborero, D. et al. Comprehensive identification of mutational cancer driver genes across 12 tumor types. Scientific reports 2013, 3:2650); * LDG (Kandoth, C. et al. Mutational landscape and significance across 12 major cancer types. Nature 2013, 502:333-339); * GGG (Lawrence, M. S. et al. Discovery and saturation analysis of cancer genes across 21 tumour types. Nature 2014, 505:495-501); * ELG (Garraway, L. A. & Lander, E. S. Lessons from the cancer genome. Cell 2013, 153:17-37); * CCG (Futreal, P. A. et al. A census of human cancer genes. Nature reviews. Cancer 2004, 4:177-183); * BVG (Vogelstein, B. et al. Cancer genome landscapes. Science 2013, 339:1546-1558). ### References Minghui Wang, Yongzhong Zhao, and Bin Zhang (2015). Efficient Test and Visualization of Multi-Set Intersections. _Scientific Reports_ 5: 16923. ### See Also `supertest` ``` -------------------------------- ### GAWS Catalog Dataset Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html An example dataset containing a list of gene sets associated with six types of clinical traits curated in the GWAS Catalog. ```APIDOC ## GAWS Catalog Dataset ### Description This example dataset contains a list of gene sets associated with six types of clinical traits curated in the GWAS Catalog. ### Usage ```R data(GWAS) ``` ### Details The six clinical traits are: * NEU (Bipolar disorder and schizophrenia, Schizophrenia, Major depressive disorder, Alzheimer's disease, Parkinson's disease, Cognitive performance, Bipolar disorder); * INF (Crohn's disease, Ulcerative colitis, Inflammatory bowel disease, Rheumatoid arthritis, Multiple sclerosis, Systemic lupus erythematosus); * CVD (Type 2 diabetes, Coronary heart disease, Blood pressure, total Cholesterol, HDL cholesterol, Triglycerides); * HT (height); * IgG (IgG glycosylation); * OB (obesity, obesity related traits). ### References Minghui Wang, Yongzhong Zhao, and Bin Zhang (2015). Efficient Test and Visualization of Multi-Set Intersections. _Scientific Reports_ 5: 16923. ### See Also `supertest` ``` -------------------------------- ### Access Summary Help Source: https://cran.r-project.org/web/packages/SuperExactTest/vignettes/set_html.html Access the help documentation for the summary function specific to msets objects. This provides detailed information on the function's arguments and return values. ```r ?summary.msets ``` -------------------------------- ### Load SuperExactTest Package Source: https://cran.r-project.org/web/packages/SuperExactTest/vignettes/set_html.html Load the SuperExactTest package into the R session. This is a prerequisite for using any of its functions. ```r library("SuperExactTest") ``` -------------------------------- ### Tabulate Summary Results to CSV Source: https://cran.r-project.org/web/packages/SuperExactTest/vignettes/set_html.html Write the 'Table' component of the summary result to a CSV file. Ensure row names are not included in the output file. ```r write.csv(summary(res)$Table, file="summary.table.csv", row.names=FALSE) ``` -------------------------------- ### Summarize msets Object Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Generate summary statistics for a 'msets' object. This is useful for inspecting the observed and expected intersection sizes, p-values, and overlap elements. ```R ## Not run: #set up fake data x=list(S1=letters[1:20], S2=letters[10:26], S3=sample(letters,10), S4=sample(letters,10)) obj=supertest(x,n=26) summary(obj) ## End(Not run) ``` -------------------------------- ### Inspect Data Structure Source: https://cran.r-project.org/web/packages/SuperExactTest/vignettes/set_html.html Check the structure of the loaded 'cis.eqtls' object. This helps in understanding the format and content of the gene sets. ```r str(cis.eqtls) ``` -------------------------------- ### Visualize Intersection Analysis Results (Circular Layout) Source: https://cran.r-project.org/web/packages/SuperExactTest/vignettes/set_html.html Plot the results of the `supertest` analysis in a circular layout. Intersections can be sorted by size, and color scales and legend positions can be customized. ```R plot(res, sort.by="size", margin=c(2,2,2,2), color.scale.pos=c(0.85,1), legend.pos=c(0.9,0.15)) ``` -------------------------------- ### Calculate Probability Density of Set Intersections Source: https://cran.r-project.org/web/packages/SuperExactTest/vignettes/set_html.html Use `dpsets` to calculate the probability density for a given intersection size. Requires intersection size, a vector of set sizes, and the total population size. ```R dpsets(num.observed.overlap, length.gene.sets, n=total) ``` -------------------------------- ### Visualize Intersection Analysis Results (Landscape Layout) Source: https://cran.r-project.org/web/packages/SuperExactTest/vignettes/set_html.html Plot the results in a landscape (matrix) layout, optionally filtering for intersections among a specific range of set degrees. This layout is useful for visualizing presence/absence of sets and intersection sizes. ```R plot(res, Layout="landscape", degree=2:4, sort.by="size", margin=c(0.5,5,1,2)) ``` -------------------------------- ### Summarize an msets Object Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Outputs summary statistics of a msets object, including observed and expected intersection sizes, p-values, and overlap elements. ```APIDOC ## summary(object, ...) ### Description This function outputs summary statistics of a msets object. ### Usage ```R ## S3 method for class 'msets' summary(object, degree=NULL, ...) ``` ### Arguments `object` | a `msets` object. `degree` | a vector of intersection degrees to pull out. `...` | additional arguments (not implemented). ### Value A list: `Barcode` | a vector of 0/1 character strings, representing the set composition of each intersection. `otab` | a vector of observed intersection size between any combination of sets. `etab` | a vector of expected intersection size between any combination of sets if background population size is specified. `set.names` | set names. `set.sizes` | set sizes. `n` | background population size. `P.value` | upper tail p value for each intersection if background population size n is specified. `Table` | a data.frame containing degree, otab, etab, fold change, p value and the overlap elements. ### Author(s) Minghui Wang , Bin Zhang ### References Minghui Wang, Yongzhong Zhao, and Bin Zhang (2015). Efficient Test and Visualization of Multi-Set Intersections. _Scientific Reports_ 5: 16923. ### See Also `msets` ### Examples ```R #set up fake data x=list(S1=letters[1:20], S2=letters[10:26], S3=sample(letters,10), S4=sample(letters,10)) obj=supertest(x,n=26) summary(obj) ``` ``` -------------------------------- ### Perform Intersection and Statistical Test Simultaneously Source: https://cran.r-project.org/web/packages/SuperExactTest/vignettes/set_html.html Use the `MSET` function to perform intersection operations and probability calculations in a single step. It returns a list containing fold enrichment and p-value. ```R fit=MSET(cis.eqtls, n=total, lower.tail=FALSE) ``` ```R fit$FE ``` ```R fit$p.value ``` -------------------------------- ### Multi-Set Intersection Probability Functions Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Provides density and distribution functions for multi-set intersection tests. `dpsets` calculates the density, and `cpsets` calculates the distribution function, with options for simulation-based p-values. ```APIDOC ## Density and distribution function of multi-set intersection test. ### Usage ```R dpsets(x,L,n,log.p =FALSE) cpsets(x,L,n,lower.tail=TRUE,log.p=FALSE, simulation.p.value=FALSE,number.simulations=1000000) ``` ### Arguments `x` | integer, number of elements overlap among all sets. `L` | vector, set sizes. `n` | integer, background population size. `lower.tail` | logical; if TRUE, probability is `P[overlap <= x]`, otherwise, `P[overlap > x]`. `log.p` | logical; if TRUE, probability p is given as `log(p)`. `simulation.p.value` | logical; if TRUE, probability p is computed from simulation. `number.simulations` | integer; number of simulations. ### Value `dpsets` gives the density and `cpsets` gives the distribution function. ### Author(s) Minghui Wang ### References Minghui Wang, Yongzhong Zhao, and Bin Zhang (2015). Efficient Test and Visualization of Multi-Set Intersections. _Scientific Reports_ 5: 16923. ### See Also `supertest`, `MSET` ``` -------------------------------- ### Set Operations (Union and Intersection) Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Extends the base R `union` and `intersect` functions to handle more than two input vectors, performing set union and intersection on multiple input vectors. ```APIDOC ## Set Operations ### Description Performs set union and intersection on multiple input vectors. ### Usage ```R union(x, y, ...) intersect(x, y, ...) ``` ### Arguments `x`, `y`, `...` | vectors (of the same mode) containing a sequence of items (conceptually) with no duplicated values. ### Details These functions extend the the same functions in the `base` package to handle more than two input vectors. ### Value A vector of the same mode as x or y for intersect, and of a common mode for union. ### Author(s) Minghui Wang , Bin Zhang ### References Minghui Wang, Yongzhong Zhao, and Bin Zhang (2015). Efficient Test and Visualization of Multi-Set Intersections. _Scientific Reports_ 5: 16923. ### Examples ```R ##not run## ``` ``` -------------------------------- ### Load Cancer Census Dataset in R Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Loads the Cancer Census dataset, which contains seven cancer predisposition gene sets. This dataset is useful for demonstrating multi-set intersection analysis. ```r data(Cancer) ``` -------------------------------- ### Plotting SuperExactTest Results Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Visualizes the results of the SuperExactTest, showing intersections between sets. Allows for customization of various plot elements like labels, colors, and layout. ```APIDOC ## plot(x, ...) ### Description Visualizes the results of the SuperExactTest. ### Usage ```R plot(x, ...) ``` ### Details The plot canvas has coordinates 0~1 for both x and y axes. Additional optional plot parameters include: * `ylab`, a character string of y axis label. * `circle.radii`, radii size of the circles in `landscape` Layout. Default 0.5. * `heatmapColor`, a vector of customized heat colors. * `show.expected.overlap`, whether to show expected overlap in `landscape` Layout. Default 'FALSE'. * `expected.overlap.style`, one of c("hatchedBox","horizBar","box"). Default 'hatchedBox'. * `expected.overlap.lwd`, line width for expected.overlap "horizBar" and "box". Default 2. * `color.expected.overlap`, color for showing expected overlap in hatched lines. Default 'grey'. * `alpha.expected.overlap`, alpha channel for transparency for showing expected overlap hatched lines. Default 1 (normalized to the range 0 to 1). * `cex`, scale of text font size. * `cex.lab`, scale of axis label text font size. * `show.track.id`, logic, whether to show the track id in the `circular` layout. Default `TRUE`. * `phantom.tracks`, number of phantom tracks in the middle in the `circular` layout. Default 2. * `gap.within.track`, ratio of gap width over block width on the same track. Default 0.1. * `gap.between.track`, ratio of gap width over track width. Default 0.1. * `bar.split`, a vector of two values specifying a continuous range that will be cropped in the y axis with the `landscape` layout. * `elements.list`, a data.frame or matrix such as the one generated by the `summary` function from a `msets` object, with row names matching the barcodes of intersection combinations and at least one column named "Elements" listing the elements to be displayed (the elements should be concatenated by separator ", "). * `elements.cex`, numeric; specifying the amount by which intersection element text should be magnified. Default 0.9. * `elements.rot`, numeric; the angle to rotate the text of intersection elements. Default 45. * `elements.col`, colour for intersection element text. Default black. * `elements.maximum`, maximum number of elements to show. * `intersection.size.rotate`, logic, whether to rotate the text of intersection size. * `flip.vertical`, logic, whether to flip the bars to downwards in `landscape` Layout. Default 'FALSE'. * `title`, figure title. Default NULL. * `cex.title`, scale of title text font size. Default 1. ### Value No return. ### Author(s) Minghui Wang , Bin Zhang ### References Minghui Wang, Yongzhong Zhao, and Bin Zhang (2015). Efficient Test and Visualization of Multi-Set Intersections. _Scientific Reports_ 5: 16923. ### See Also `msets` ### Examples ```R #set up fake data x=list(S1=letters[1:20], S2=letters[10:26], S3=sample(letters,10), S4=sample(letters,10)) obj=supertest(x,n=26) plot(obj) ``` ``` -------------------------------- ### Find Intersections and Assign Elements Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Identifies intersection combinations within a list of sets and assigns each element to its corresponding combination. Can enforce mutual exclusivity. ```r intersectElements(sets,mutual.exclusive=TRUE) ``` ```r intersectElements(sets,mutual.exclusive=FALSE) ``` -------------------------------- ### Calculate Intersections Among Multiple Sets and Perform Statistical Tests Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Calculates intersection sizes among multiple sets and performs statistical tests of the intersections. ```APIDOC ## supertest(x, n = NULL, ...) ### Description This function calculates intersection sizes among multiple sets and performs statistical tests of the intersections. ### Usage ```R supertest(x, n=NULL, degree=NULL, ...) ``` ### Arguments `x` | a list of sets. `n` | background population size. If NULL, only observed sizes are calculated. `degree` | a vector of intersection degrees to pull out. If NULL, all intersections are calculated. `...` | additional arguments passed to other methods. ### Value A `msets` object containing information about the intersections and statistical tests. ### Author(s) Minghui Wang , Bin Zhang ### References Minghui Wang, Yongzhong Zhao, and Bin Zhang (2015). Efficient Test and Visualization of Multi-Set Intersections. _Scientific Reports_ 5: 16923. ### See Also `msets` ``` -------------------------------- ### Load GAWS Catalog Dataset in R Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Loads the GAWS Catalog dataset, which contains gene sets associated with six types of clinical traits. This dataset can be used for similar multi-set intersection analyses. ```r data(GWAS) ``` -------------------------------- ### Summarize Intersection Analysis Results Source: https://cran.r-project.org/web/packages/SuperExactTest/vignettes/set_html.html Use the generic `summary` function to obtain detailed statistics for the intersection analysis, including observed and expected overlaps, fold enrichment (FE), and P-values for each intersection. ```R summary(res) ``` -------------------------------- ### Calculate Gene Set Lengths Source: https://cran.r-project.org/web/packages/SuperExactTest/vignettes/set_html.html Calculate and display the number of genes in each of the cis-eQTL gene sets. This is useful for understanding the scale of the input data. ```r (length.gene.sets=sapply(cis.eqtls,length)) ``` -------------------------------- ### Compute Probability Density of Intersection Sizes Source: https://cran.r-project.org/web/packages/SuperExactTest/vignettes/set_html.html Calculate the probability density distribution for all possible intersection sizes (from 0 to 101) among the four gene sets using the `dpsets` function. This function implements the exact probability calculation for multi-set intersections. ```r (p=sapply(0:101,function(i) dpsets(i, length.gene.sets, n=total))) ``` -------------------------------- ### MSET Function Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Calculate FE and significance of intersection among multiple sets. ```APIDOC ## Exact Test of Multi-Set Intersection ### Description Calculate FE and significance of intersection among multiple sets. ### Usage ```R MSET(x,n,lower.tail=TRUE,log.p=FALSE) ``` ### Arguments `x` | list; a collection of sets. `n` | integer; background population size. `lower.tail` | logical; if TRUE, probability is `P[overlap < m]`, otherwise, `P[overlap >= m]`, where `m` is the number of elements overlap between all sets. `log.p` | logical; if TRUE, probability p is given as log(p). ### Details This function implements an efficient statistical test for multi-set intersections. The algorithm behind this function was described in Wang et al 2015. ### Value A list with the following elements: `intersects` | a vector of intersect items. `FE` | fold enrichment of the intersection. `p.value` | one-tail probability of observing equal to or larger than the number of intersect items. ### Author(s) Minghui Wang , Bin Zhang ### References Minghui Wang, Yongzhong Zhao, and Bin Zhang (2015). Efficient Test and Visualization of Multi-Set Intersections. _Scientific Reports_ 5: 16923. ### See Also `supertest`, `cpsets`, `dpsets` ### Examples ```R ## Not run: #set up fake data x=list(S1=letters[1:20], S2=letters[10:26], S3=sample(letters,10), S4=sample(letters,10)) MSET(x, 26, FALSE) ## End(Not run) ``` ``` -------------------------------- ### Calculate Intersections and Perform Statistical Tests Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Calculate intersection sizes among multiple sets and perform statistical tests. This function is the core of the package for analyzing set overlaps. ```R supertest(x, n=NULL, degree=NULL, ...) ``` -------------------------------- ### supertest Function Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html The `supertest` function calculates intersection sizes between multiple sets and performs statistical tests if a background population size is provided. It returns an object of class `msets`. ```APIDOC ## supertest Function ### Description Calculates intersection sizes between multiple sets and performs statistical tests of the intersections if a background population size `n` is specified. ### Arguments - `x` (list): A collection of sets. - `n` (integer): Background population size. Required for computing the statistical significance of intersections. - `degree` (vector): A vector of intersection degrees for overlap analysis. If `NULL`, all possible intersections are computed. - `...` (additional arguments): Not implemented. ### Value An object of class `msets`. ### Examples ```R # Analyze the cancer gene sets data(Cancer) Result <- supertest(Cancer, n = 20687) summary(Result) plot(Result, degree = 2:7, sort.by = 'size') ``` ``` -------------------------------- ### Plot Multi-Set Intersections Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Draws multi-set intersections. Various layout and display options are available. Customize parameters like 'sort.by' and 'min.intersection.size' for tailored visualizations. ```R plot(x, Layout=c('circular','landscape'), degree=NULL, keep.empty.intersections=TRUE, sort.by=c('set','size','degree','p-value'), min.intersection.size=0, max.intersection.size=Inf, ylim=NULL, log.scale=FALSE, yfrac=0.8, margin=NULL, color.scale.pos=c(0.85, 0.9), legend.pos=c(0.85,0.25), legend.col=2, legend.text.cex=1, color.scale.cex=1, color.scale.title=expression(paste(-Log[10],'(',italic(P),')')), color.on='#2EFE64', color.off='#EEEEEE', show.overlap.size=TRUE, show.fold.enrichment=FALSE, show.set.size=TRUE, overlap.size.cex=0.9, track.area.range=0.3, bar.area.range=0.2, new.gridPage=TRUE, minMinusLog10PValue=0, maxMinusLog10PValue=NULL, show.elements=FALSE, ...) ``` -------------------------------- ### Plot SuperExactTest Results Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Visualize the results of a supertest object. This function generates a plot based on the calculated intersections and their statistical significance. ```R ## Not run: #set up fake data x=list(S1=letters[1:20], S2=letters[10:26], S3=sample(letters,10), S4=sample(letters,10)) obj=supertest(x,n=26) plot(obj) ## End(Not run) ``` -------------------------------- ### Find Intersection of Multiple Gene Sets Source: https://cran.r-project.org/web/packages/SuperExactTest/vignettes/set_html.html Use the base R `intersect` function to find the common elements among multiple vectors. Note: The package provides a re-implementation for handling more than two input vectors. ```R common.genes=intersect(cis.eqtls[[1]], cis.eqtls[[2]], cis.eqtls[[3]], cis.eqtls[[4]]) ``` -------------------------------- ### Calculate Fold Enrichment Source: https://cran.r-project.org/web/packages/SuperExactTest/vignettes/set_html.html Calculate the fold enrichment (FE) by dividing the number of observed overlaps by the number of expected overlaps. ```R (FE=num.observed.overlap/num.expcted.overlap) ``` -------------------------------- ### Calculate Jaccard Index Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Calculates Jaccard indices between pairs of sets provided as a list. ```APIDOC ## Calculate Jaccard Index ### Description This function calculates Jaccard indices between pairs of sets. ### Usage ```R jaccard(x) ``` ### Arguments `x` | list, a collect of sets. ``` -------------------------------- ### Perform Intersection Analysis with supertest Source: https://cran.r-project.org/web/packages/SuperExactTest/vignettes/set_html.html Use `supertest` to enumerate all possible intersections for a given list of input vectors (gene sets) and perform statistical tests. The function returns an object of class `msets`. ```R res=supertest(cis.eqtls, n=total) ``` -------------------------------- ### Calculate Multi-Set Intersection Density Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Computes the density of the multi-set intersection test. Requires specifying the number of overlapping elements, set sizes, and background population size. ```r (d=dpsets(x,c(A,B,C,D),n)) ``` -------------------------------- ### Calculate Jaccard Indices Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Calculates pairwise Jaccard indices for a list of sets. Ensure data is set up correctly before calling the function. ```R #set up fake data x=list(S1=letters[1:20], S2=letters[10:26], S3=sample(letters,10), S4=sample(letters,10)) jaccard(x) ``` -------------------------------- ### Calculate Expected Overlap Size Source: https://cran.r-project.org/web/packages/SuperExactTest/vignettes/set_html.html Compute the expected number of overlapping genes among the four cis-eQTL gene sets, assuming they were independently and randomly sampled from a larger population of genes. ```r total=18196 (num.expcted.overlap=total*do.call(prod,as.list(length.gene.sets/total))) ``` -------------------------------- ### msets Class Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Represents data regarding the intersections between multiple sets, typically created by the supertest function. ```APIDOC ## Class to Contain Multi-Set Intersections ### Description This object contains data regarding the intersections between multiple sets. This object is usually created by the `supertest` function. ### Details Intersection combination is denoted by a `barcode` string of '0' and '1', where a value of '1' in the `i`th position of the string indicates that the intersection is involved with the `i`th set, 0 otherwise. E.g., string '000101' indicates that the intersection is an overlap between the 4th and 6th sets. Function `deBarcode` can be used to decrypt the barcode. Generic `summary` and `plot` functions can be applied to extract and visualize the results. ### Value `x` | a list of sets from input. ---|--- `set.names` | names of the sets. If the input sets do not have names, they will be automatically named as SetX where X is an integer from 1 to the total number of sets. `set.sizes` | a vector of set sizes. `n` | background population size. `overlap.sizes` | a named vector of intersection sizes. Each intersection component is named by a barcoded character string of '0' and '1'. See `Details` for barcode. `overlap.expected` | a named vector of expected intersection sizes when item `n` is available. `P.value` | a vector of p values for the intersections when item `n` is available. ### Author(s) Minghui Wang , Bin Zhang ### References Minghui Wang, Yongzhong Zhao, and Bin Zhang (2015). Efficient Test and Visualization of Multi-Set Intersections. _Scientific Reports_ 5: 16923. ### See Also `supertest`, `summary.msets`, `plot.msets`, `deBarcode` ``` -------------------------------- ### plot.msets function Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Draws intersections among multiple sets. This is an S3 method for the 'msets' class. ```APIDOC ## Draw Multi-Set Intersections ### Description This function draws intersections among multiple sets. ### Usage ```R ## S3 method for class 'msets' plot(x, Layout=c('circular','landscape'), degree=NULL, keep.empty.intersections=TRUE, sort.by=c('set','size','degree','p-value'), min.intersection.size=0, max.intersection.size=Inf, ylim=NULL, log.scale=FALSE, yfrac=0.8, margin=NULL, color.scale.pos=c(0.85, 0.9), legend.pos=c(0.85,0.25), legend.col=2, legend.text.cex=1, color.scale.cex=1, color.scale.title=expression(paste(-Log[10],'(',italic(P),')')) color.on='#2EFE64', color.off='#EEEEEE', show.overlap.size=TRUE, show.fold.enrichment=FALSE, show.set.size=TRUE, overlap.size.cex=0.9, track.area.range=0.3, bar.area.range=0.2, new.gridPage=TRUE, minMinusLog10PValue=0, maxMinusLog10PValue=NULL, show.elements=FALSE, ...) ``` ``` -------------------------------- ### Decrypt Barcode Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Decrypts barcode information, which are character strings of '0' and '1' indicating the presence or absence of sets in an intersection combination. ```APIDOC ## Decrypt Barcode ### Description Decrypt barcode information. ### Usage ```R deBarcode(barcode, setnames, collapse=' & ') ``` ### Arguments `barcode` | a vector of character strings, encoding the intersection combination. `setnames` | set names. `collapse` | an optional character string to separate the results. See `paste`. ### Details `barcode` are character strings of '0' and '1', indicating absence or presence of each set in a intersection combination. ### Value A vector. ### Author(s) Minghui Wang ### Examples ```R deBarcode(c('01011','10100'), c('S1','S2','S3','S4','S5')) ``` ``` -------------------------------- ### Calculate Cumulative Probability of Set Intersections Source: https://cran.r-project.org/web/packages/SuperExactTest/vignettes/set_html.html Use `cpsets` to calculate the cumulative probability of observing a certain number of intersection genes or more. Requires the observed intersection size minus one, a vector of set sizes, the total population size, and a `lower.tail` argument. ```R cpsets(num.observed.overlap-1, length.gene.sets, n=total, lower.tail=FALSE) ``` -------------------------------- ### Calculate Multi-Set Intersection Cumulative Probability Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Computes the cumulative distribution function for the multi-set intersection test. Can optionally use simulations for p-value calculation. ```r (p=cpsets(x,c(A,B,C,D),n,lower.tail=FALSE)) ``` -------------------------------- ### Calculate Jaccard Index for Sets Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Computes the Jaccard indices between pairs of sets provided in a list. ```r jaccard(x) ``` -------------------------------- ### Decrypt Barcode Information Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Decodes barcode strings representing set intersections into human-readable labels. Allows customization of the separator. ```r deBarcode(c('01011','10100'), c('S1','S2','S3','S4','S5')) ``` -------------------------------- ### jaccard function Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Calculates pairwise Jaccard indices for a list of sets. ```APIDOC ## Value A matrix of pairwise Jaccard indices. ### Author(s) Minghui Wang ### Examples ```R ## Not run: #set up fake data x=list(S1=letters[1:20], S2=letters[10:26], S3=sample(letters,10), S4=sample(letters,10)) jaccard(x) ## End(Not run) ``` ``` -------------------------------- ### Find Intersection Membership Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Finds intersections and assigns elements to their respective intersection combinations. The `mutual.exclusive` argument controls how elements are assigned when they belong to multiple intersections. ```APIDOC ## Find Intersection Membership ### Description Find intersections and assign element to intersection combinations. ### Usage ```R intersectElements(x, mutual.exclusive=TRUE) ``` ### Arguments `x` | list; a collection of sets. `mutual.exclusive` | logical; see `Details`. ### Details See example below for the use of `mutual.exclusive`. ### Value A data.frame with two columns: `Entry` | set elements. `barcode` | intersection combination that each entry belongs to. ### Author(s) Minghui Wang ### Examples ```R set.seed(123) sets=list(S1=sample(letters,10), S2=sample(letters,5), S3=sample(letters,7)) intersectElements(sets,mutual.exclusive=TRUE) intersectElements(sets,mutual.exclusive=FALSE) ``` ``` -------------------------------- ### Calculate Exact Test for Multi-Set Intersection in R Source: https://cran.r-project.org/web/packages/SuperExactTest/refman/SuperExactTest.html Calculates the fold enrichment (FE) and significance of intersections among multiple sets. Use this function to assess the statistical significance of overlapping elements across several sets. ```r MSET(x, n, lower.tail = FALSE) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.