diff --git a/.Rbuildignore b/.Rbuildignore index 0e5321c..2e3efa5 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,3 +8,4 @@ ^_pkgdown\.yml$ ^docs$ ^pkgdown$ +^\.github$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index cea5906..bfc9f4d 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -2,7 +2,7 @@ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - branches: main + branches: [main, master] pull_request: release: types: [published] diff --git a/DESCRIPTION b/DESCRIPTION index 4a6edcd..551fec2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: leapR Title: Layered enrichment analysis of pathways R -Version: 0.99.7 +Version: 0.99.9 Authors@R: c( person("Sara", "Gosline", email = "sara.gosline@pnnl.gov", role = c('aut',"cre"), comment = c(ORCID = "0000-0002-6534-4774")), person("Jason", "McDermott", email = "jason.mcdermott@pnnl.gov", role = "aut"), @@ -17,7 +17,8 @@ biocViews: Proteomics, Pathways, GeneExpression, - Transcriptomics + Transcriptomics, + Software Imports: stats, gplots, @@ -30,7 +31,8 @@ Imports: stringr, tidyr, SummarizedExperiment, - BiocStyle + BiocStyle, + BiocFileCache Suggests: knitr, rmarkdown, @@ -38,3 +40,4 @@ Suggests: VignetteBuilder: knitr License: MIT + file LICENSE Config/testthat/edition: 3 +URL: https://pnnl.github.io/leapR/ diff --git a/R/calcTTest.R b/R/calcTTest.R index 095c35c..ca0df02 100644 --- a/R/calcTTest.R +++ b/R/calcTTest.R @@ -18,11 +18,15 @@ #' @examples #' #' library(leapR) +#' library(BiocFileCache) +#' +#' path <- tools::R_user_dir("leapR", which = "cache") +#' bfc <- BiocFileCache(path, ask = FALSE) +#' #' url <- "https://api.figshare.com/v2/file/download/56536214" -#' tdata <- download.file(url,method='libcurl',destfile='transData.rda') -#' load('transData.rda') -#' p <- file.remove("transData.rda") -#' +#' tc <- bfcadd(bfc, "tdat", fpath = url) +#' load(tc) +#' #' # read in the pathways #' data("ncipid") #' diff --git a/R/cluster_enrichment.R b/R/cluster_enrichment.R index d1f3120..7e76adf 100644 --- a/R/cluster_enrichment.R +++ b/R/cluster_enrichment.R @@ -19,12 +19,14 @@ #' @export #' @examples #' library(leapR) -#' -#' # read in the example transcriptomic data +#' library(BiocFileCache) +#' +#' path <- tools::R_user_dir("leapR", which = "cache") +#' bfc <- BiocFileCache(path, ask = FALSE) +#' #' url <- "https://api.figshare.com/v2/file/download/56536214" -#' tdata <- download.file(url,method='libcurl',destfile='transData.rda') -#' load('transData.rda') -#' p <- file.remove("transData.rda") +#' tc <- bfcadd(bfc, "tdat", fpath = url) +#' load(tc) #' #' # read in the pathways #' data("ncipid") diff --git a/R/combine_omics.R b/R/combine_omics.R index 101d595..78dbbcc 100644 --- a/R/combine_omics.R +++ b/R/combine_omics.R @@ -18,23 +18,21 @@ #' #' @examples #' library(leapR) -#' url <- 'https://api.figshare.com/v2/file/download/56536217' -#' -#' pdata <- download.file(url,method='libcurl',destfile='protData.rda') -#' load('protData.rda') -#' p <- file.remove("protData.rda") -#' +#' library(BiocFileCache) +#' path <- tools::R_user_dir("leapR", which = "cache") +#' bfc <- BiocFileCache(path, ask = FALSE) +#' +#' url <- "https://api.figshare.com/v2/file/download/56536217" +#' pc <- bfcadd(bfc, "pdat", fpath = url) +#' load(pc) +#' #' url <- "https://api.figshare.com/v2/file/download/56536214" -#' tdata <- download.file(url,method='libcurl',destfile='transData.rda') -#' load('transData.rda') -#' p <- file.remove("transData.rda") -#' -#' url <- 'https://api.figshare.com/v2/file/download/56536211' -#' phdata<-download.file(url,method='libcurl',destfile = 'phosData.rda') -#' #phosphodata<-read.csv("phdata",check.names=FALSE,row.names=1) -#' load('phosData.rda') -#' p <- file.remove('phosData.rda')# read in the example protein data -#' +#' tc <- bfcadd(bfc, "tdat", fpath = url) +#' load(tc) +#' +#' url <- "https://api.figshare.com/v2/file/download/56536211" +#' phc <- bfcadd(bfc, "phdat", fpath = url) +#' load(phc) #' #' # merge the three datasets by rows and add prefix tags for #' # different omics types diff --git a/R/enrichment_in_groups.R b/R/enrichment_in_groups.R index b82cc45..4d92940 100644 --- a/R/enrichment_in_groups.R +++ b/R/enrichment_in_groups.R @@ -18,6 +18,7 @@ #' to log your data before calling. NOTE: if you do not call `suppressWarnings` then #' the KS test will warn you about ties. #' @param minsize minimum size of set +#' @param log_transformed Set to TRUE if data is already log-transformed #' @param mapping_column column name of mapping identifiers #' @param abundance_column columns mapping abundance, either in the `assay` #' matrix or `rowData` @@ -114,7 +115,7 @@ enrichment_in_groups <- function(geneset, names(backvals) <- backlist#[-group_ind] in_back <- length(backvals) - outgroup_mean = mean(backvals[-group_ind], na.rm = T) + outgroup_mean = mean(backvals[-group_ind], na.rm = TRUE) in_path <- length(in_group) #how many left after na.rm if ((in_path > minsize) & (any(!is.na(in_path))) & diff --git a/R/leapR-package.R b/R/leapR-package.R index ad09996..f82de0d 100644 --- a/R/leapR-package.R +++ b/R/leapR-package.R @@ -143,14 +143,14 @@ #' \cr #' @examples #' library(leapR) -#' -#' # read in the example abundance data -#' # read in the example transcriptomic data -#' tdata <- download.file("https://api.figshare.com/v2/file/download/56536214", -#' method='libcurl',destfile='transData.rda') -#' load('transData.rda') -#' p <- file.remove("transData.rda") -#' +#' library(BiocFileCache) +#' +#' path <- tools::R_user_dir("leapR", which = "cache") +#' bfc <- BiocFileCache(path, ask = FALSE) +#' +#' url <- "https://api.figshare.com/v2/file/download/56536214" +#' tc <- bfcadd(bfc, "tdat", fpath = url) +#' load(tc) #' # read in the pathways #' data("ncipid") #' diff --git a/R/leapR.R b/R/leapR.R index 05318c4..4b53700 100644 --- a/R/leapR.R +++ b/R/leapR.R @@ -140,13 +140,14 @@ #' \cr #' @examples #' library(leapR) -#' -#' # read in the example abundance data -#' # read in the example transcriptomic data -#' tdata <- download.file("https://api.figshare.com/v2/file/download/56536214", -#' method='libcurl',destfile='transData.rda') -#' load('transData.rda') -#' p <- file.remove("transData.rda") +#' library(BiocFileCache) +#' +#' path <- tools::R_user_dir("leapR", which = "cache") +#' bfc <- BiocFileCache(path, ask = FALSE) +#' +#' url <- "https://api.figshare.com/v2/file/download/56536214" +#' tc <- bfcadd(bfc, "tdat", fpath = url) +#' load(tc) #' #' # read in the pathways #' data("ncipid") diff --git a/_pkgdown.yml b/_pkgdown.yml index 69b0979..2ecd09d 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,4 +1,4 @@ -url: https://pnnl-github.io/leapR +url: https://pnnl.github.io/leapR/ template: bootstrap: 5 diff --git a/docs/404.html b/docs/404.html deleted file mode 100644 index a4be44e..0000000 --- a/docs/404.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - -Page not found (404) • leapR - - - - - - - - Skip to contents - - -
-
-
- -Content not found. Please use links in the navbar. - -
-
- - - -
- - - - - - - diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html deleted file mode 100644 index b910367..0000000 --- a/docs/LICENSE-text.html +++ /dev/null @@ -1,89 +0,0 @@ - -License • leapR - Skip to contents - - -
-
-
- -
Copyright 2025 Battelle Memorial Institute
-
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-
-1. Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-
-2. Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
- -
- - -
- - - - - - - diff --git a/docs/articles/examples.html b/docs/articles/examples.html deleted file mode 100644 index 0efac56..0000000 --- a/docs/articles/examples.html +++ /dev/null @@ -1,491 +0,0 @@ - - - - - - - -leapR Paper Examples • leapR - - - - - - - - Skip to contents - - -
- - - - -
-
- - - -
-

Load libraries needed -

-
-# load the core libraries
-library(leapR)
-library(gplots)
-library(rmarkdown)
-# plotting helpers used in this vignette
-library(ggplot2)
-library(dplyr)
-library(tibble)
-library(stringr)
-
-
-

Example data -

-

A sample data set is included that is from the CPTAC study of 169 -ovarian tumors. We include the dataset as a object, containing three -assays (transcriptomics, global proteomics, and phosphoproteomics) to -enable interoperability with other tools, and store example file as -rda on Figshare -as example.

-

This data can be loaded as follows:

-
-url <- "https://api.figshare.com/v2/file/download/56536217"
-pdata <- download.file(url, method = "libcurl", destfile = "protData.rda")
-#  as.matrix()
-load("protData.rda")
-
-p <- file.remove("protData.rda")
-
-url <- "https://api.figshare.com/v2/file/download/56536214"
-tdata <- download.file(url, method = "libcurl", destfile = "transData.rda")
-load("transData.rda")
-p <- file.remove("transData.rda")
-
-url <- "https://api.figshare.com/v2/file/download/56536211"
-phdata <- download.file(url, method = "libcurl", destfile = "phosData.rda")
-load("phosData.rda")
-p <- file.remove("phosData.rda")
-

We also have local data we can load

-
-
-data(shortlist)
-data(longlist)
-data(ncipid)
-data(kinasesubstrates)
-## columns that we want to use for results
-
-cols_to_display <- c("ingroup_n", "outgroup_n", "background_n", 
-                     "pvalue", "BH_pvalue")
-
-
-

Figure 2 -

-

We will compare the ability of transcriptomics, proteomics, and -phosphoproteomics to inform about differences between short and long -surviving patient groups. In addition to other methods, we also employ a -calcTTest function that takes two sets of samples from the -SummarizedExperiment object and computes the t-test between -them. The results are then stored in the rowData of the -same object, so that they can be used for enrichment later on.

-

This spans the multiple enrichment methods in leapR and also includes -multi-omics.

-

The resulting heatmap is presented as Figure 2 in the paper.

-
-# load the single omic and multi-omic pathway databases
-data("krbpaths")
-data("mo_krbpaths")
-
-# comparison enrichment in transcriptional data
-transdata.comp.enrichment.svl <- leapR::leapR(
-  geneset = krbpaths,
-  enrichment_method = "enrichment_comparison",
-  eset = tset,
-  assay_name = "transcriptomics",
-  primary_columns = shortlist,
-  secondary_columns = longlist
-)
-
-# comparison enrichment in proteomics data
-# this is the same code used above, just repeated here for clarity
-protdata.comp.enrichment.svl <- leapR::leapR(
-  geneset = krbpaths,
-  enrichment_method = "enrichment_comparison",
-  eset = pset,
-  assay_name = "proteomics",
-  primary_columns = shortlist,
-  secondary_columns = longlist
-)
-
-# comparison enrichment in phosphoproteomics data
-phosphodata.comp.enrichment.svl <- leapR::leapR(
-  geneset = krbpaths,
-  enrichment_method = "enrichment_comparison",
-  eset = phset,
-  assay_name = "phosphoproteomics",
-  primary_columns = shortlist,
-  secondary_columns = longlist, id_column = "hgnc_id"
-)
-
-
-# set enrichment in transcriptomics data
-# perform the comparison t-test
-tset <- leapR::calcTTest(tset, assay_name = "transcriptomics", 
-                         shortlist, longlist)
-
-
-## now we need to run enrichment in sets with target list, not eset
-transdata.set.enrichment.svl <- leapR::leapR(
-  geneset = krbpaths,
-  eset = tset,
-  assay_name = "transcriptomics",
-  enrichment_method = "enrichment_in_sets",
-  primary_columns = "pvalue",
-  greaterthan = FALSE, threshold = 0.05
-)
-
-
-pset <- leapR::calcTTest(pset, assay_name = "proteomics",
-                         shortlist, longlist)
-
-protdata.set.enrichment.svl <- leapR::leapR(
-  geneset = krbpaths,
-  eset = pset,
-  assay_name = "proteomics",
-  enrichment_method = "enrichment_in_sets",
-  primary_columns = "pvalue",
-  greaterthan = FALSE, threshold = 0.05
-)
-
-
-phset <- leapR::calcTTest(phset, assay_name = "phosphoproteomics", 
-                          shortlist, longlist)
-
-phosphodata.set.enrichment.svl <- leapR::leapR(
-  geneset = krbpaths,
-  enrichment_method = "enrichment_in_sets",
-  id_column = "hgnc_id",
-  assay_name = "phosphoproteomics",
-  eset = phset, primary_columns = "pvalue",
-  greaterthan = FALSE, threshold = 0.05
-)
-
-# order enrichment in transcriptomics data
-transdata.order.enrichment.svl <- leapR::leapR(
-  geneset = krbpaths,
-  enrichment_method = "enrichment_in_order",
-  eset = tset,
-  assay_name = "transcriptomics",
-  primary_columns = "difference"
-)
-
-# order enrichment in proteomics data
-protdata.order.enrichment.svl <- leapR::leapR(
-  geneset = krbpaths,
-  enrichment_method = "enrichment_in_order",
-  eset = pset,
-  assay_name = "proteomics",
-  primary_columns = "difference"
-)
-
-# order enrichment in phosphoproteomics data
-
-
-phosphodata.order.enrichment.svl <- leapR::leapR(
-  geneset = krbpaths,
-  enrichment_method = "enrichment_in_order",
-  id_column = "hgnc_id",
-  method = 'ztest', 
-  eset = phset,
-  assay_name = "phosphoproteomics",
-  primary_columns = "difference"
-)
-
-# correlation difference in transcriptomics data
-transdata.corr.enrichment.svl <- leapR::leapR(
-  geneset = krbpaths,
-  enrichment_method = "correlation_comparison",
-  eset = tset,
-  assay_name = "transcriptomics",
-  primary_columns = shortlist,
-  secondary_columns = longlist
-)
-# correlation difference in proteomics data
-protdata.corr.enrichment.svl <- leapR::leapR(
-  geneset = krbpaths,
-  enrichment_method = "correlation_comparison",
-  eset = pset,
-  assay_name = "proteomics",
-  primary_columns = shortlist,
-  secondary_columns = longlist
-)
-# correlation difference in phosphoproteomics data
-phosphodata.corr.enrichment.svl <- leapR::leapR(
-  geneset = krbpaths,
-  enrichment_method = "correlation_comparison",
-  eset = phset,
-  assay_name = "phosphoproteomics",
-  primary_columns = shortlist,
-  secondary_columns = longlist, id_column = "hgnc_id"
-)
-
-# combine the omics data into one with prefix tags
-comboset <- leapR::combine_omics(list(pset, phset, tset), 
-                                 c(NA, "hgnc_id", NA))
-
-# comparison enrichment for combodata
-# when we use expression set, we do not need to use the mo_krbpaths 
-#since the  id mapping column is used
-combodata.enrichment.svl <- leapR::leapR(
-  geneset = krbpaths, # mo_krbpaths,
-  enrichment_method = "enrichment_comparison",
-  eset = comboset,
-  assay_name = "combined",
-  primary_columns = shortlist,
-  secondary_columns = longlist, id_column = "id"
-)
-
-
-# set enrichment in combo data
-# perform the comparison t test
-comboset <- leapR::calcTTest(comboset,
-                             assay_name = "combined", 
-                             shortlist, longlist)
-
-combodata.set.enrichment.svl <- leapR::leapR(
-  geneset = krbpaths,
-  enrichment_method = "enrichment_in_sets",
-  eset = comboset, primary_columns = "pvalue",
-  assay_name = "combined",
-  id_column = "id",
-  greaterthan = FALSE, threshold = 0.05
-)
-
-# order enrichment in combo data
-combodata.order.enrichment.svl <- leapR::leapR(
-  geneset = krbpaths,
-  enrichment_method = "enrichment_in_order",
-  assay_name = "combined",
-  eset = comboset, primary_columns = "difference",
-  id_column = "id"
-)
-
-# correlation difference in combo data
-combodata.corr.enrichment.svl <- leapR::leapR(
-  geneset = krbpaths,
-  enrichment_method = "correlation_comparison",
-  eset = comboset,
-  assay_name = "combined",
-  primary_columns = shortlist,
-  id_column = "id",
-  secondary_columns = longlist
-)
-
-
-# now take all these results and combine them into one figure
-all_results <- list(
-  transdata.comp.enrichment.svl,
-  protdata.comp.enrichment.svl,
-  phosphodata.comp.enrichment.svl,
-  combodata.enrichment.svl,
-  transdata.set.enrichment.svl,
-  protdata.set.enrichment.svl,
-  phosphodata.set.enrichment.svl,
-  combodata.set.enrichment.svl,
-  transdata.order.enrichment.svl,
-  protdata.order.enrichment.svl,
-  phosphodata.order.enrichment.svl,
-  combodata.order.enrichment.svl,
-  transdata.corr.enrichment.svl,
-  protdata.corr.enrichment.svl,
-  phosphodata.corr.enrichment.svl,
-  combodata.corr.enrichment.svl
-)
-
-pathways_of_interest <- c(
-  "KEGG_APOPTOSIS",
-  "KEGG_CELL_CYCLE",
-  "KEGG_ERBB_SIGNALING_PATHWAY",
-  "KEGG_FOCAL_ADHESION",
-  "KEGG_INSULIN_SIGNALING_PATHWAY",
-  "KEGG_MAPK_SIGNALING_PATHWAY",
-  "KEGG_MISMATCH_REPAIR",
-  "KEGG_MTOR_SIGNALING_PATHWAY",
-  "KEGG_OXIDATIVE_PHOSPHORYLATION",
-  "KEGG_P53_SIGNALING_PATHWAY",
-  "KEGG_PATHWAYS_IN_CANCER",
-  "KEGG_PROTEASOME",
-  "KEGG_RIBOSOME",
-  "KEGG_VEGF_SIGNALING_PATHWAY",
-  "KEGG_WNT_SIGNALING_PATHWAY"
-)
-
-
-results.frame <- data.frame(
-  pathway = pathways_of_interest,
-  td.comp = all_results[[1]][pathways_of_interest, "BH_pvalue"] < 0.05,
-  pd.comp = all_results[[2]][pathways_of_interest, "BH_pvalue"] < 0.05,
-  fd.comp = all_results[[3]][pathways_of_interest, "BH_pvalue"] < 0.05,
-  cd.comp = all_results[[4]][pathways_of_interest, "BH_pvalue"] < 0.05,
-  td.set = all_results[[5]][pathways_of_interest, "BH_pvalue"] < 0.05,
-  pd.set = all_results[[6]][pathways_of_interest, "BH_pvalue"] < 0.05,
-  fd.set = all_results[[7]][pathways_of_interest, "BH_pvalue"] < 0.05,
-  cd.set = all_results[[8]][pathways_of_interest, "BH_pvalue"] < 0.05,
-  td.order = all_results[[9]][pathways_of_interest, "BH_pvalue"] < 0.05,
-  pd.order = all_results[[10]][pathways_of_interest, "BH_pvalue"] < 0.05,
-  fd.order = all_results[[11]][pathways_of_interest, "BH_pvalue"] < 0.05,
-  cd.order = all_results[[12]][pathways_of_interest, "BH_pvalue"] < 0.05,
-  td.corr = all_results[[13]][pathways_of_interest, "BH_pvalue"] < 0.05,
-  pd.corr = all_results[[14]][pathways_of_interest, "BH_pvalue"] < 0.05,
-  fd.corr = all_results[[15]][pathways_of_interest, "BH_pvalue"] < 0.05,
-  cd.corr = all_results[[16]][pathways_of_interest, "BH_pvalue"] < 0.05
-)
-
-results.frame.or <- data.frame(
-  pathway = pathways_of_interest,
-  td.comp = all_results[[1]][pathways_of_interest, "oddsratio"],
-  pd.comp = all_results[[2]][pathways_of_interest, "oddsratio"],
-  fd.comp = all_results[[3]][pathways_of_interest, "oddsratio"],
-  cd.comp = all_results[[4]][pathways_of_interest, "oddsratio"],
-  td.set = log(all_results[[5]][pathways_of_interest, "oddsratio"], 2),
-  pd.set = log(all_results[[6]][pathways_of_interest, "oddsratio"], 2),
-  fd.set = log(all_results[[7]][pathways_of_interest, "oddsratio"], 2),
-  cd.set = log(all_results[[8]][pathways_of_interest, "oddsratio"], 2),
-  td.order = all_results[[9]][pathways_of_interest, "oddsratio"],
-  pd.order = all_results[[10]][pathways_of_interest, "oddsratio"],
-  fd.order = all_results[[11]][pathways_of_interest, "oddsratio"],
-  cd.order = all_results[[12]][pathways_of_interest, "oddsratio"],
-  td.corr = all_results[[13]][pathways_of_interest, "oddsratio"],
-  pd.corr = all_results[[14]][pathways_of_interest, "oddsratio"],
-  fd.corr = all_results[[15]][pathways_of_interest, "oddsratio"],
-  cd.corr = all_results[[16]][pathways_of_interest, "oddsratio"]
-)
-
-rownames(results.frame) <- results.frame[, 1]
-rownames(results.frame.or) <- results.frame.or[, 1]
-results.frame.sig <- results.frame[, 2:17] * results.frame.or[, 2:17]
-
-heatmap.2(as.matrix(results.frame.sig[, c(1:4, 9:16)]), Colv = NA, 
-          trace = "none", breaks = c(-1, -.1, -0.0001, 0, 0.1, 1), 
-          col = c("blue", "lightblue", "grey", "pink", "red"), 
-          dendrogram = "none")
-

-

Figure 3. An application of the KSEA-like approach in leapR as -applied to our example data. In this example we are looking for known -substrate sets of kinases (from Phosphosite Plus) that are enriched in -the short vs long comparison of phosphopeptides.

-
-# this comparison of abundance in substrates between case and control
-#     is lopsided in the sense that phosphorylation levels were previously
-#     reported to be overall higher in the short survivors. Thus the
-#     results are not terribly interesting (all kinases are in the same 
-# direction)
-phosphodata.ksea.comp.svl <- leapR::leapR(
-  geneset = kinasesubstrates,
-  enrichment_method = "enrichment_comparison",
-  eset = phset,
-  assay_name = "phosphoproteomics",
-  primary_columns = shortlist, secondary_columns = longlist
-)
-
-
-# thus for the example we'll look at correlation between known substrates 
-#   in the   case v control conditions
-phosphodata.ksea.corr.svl <- leapR::leapR(
-  geneset = kinasesubstrates,
-  enrichment_method = "correlation_comparison",
-  eset = phset,
-  assay_name = "phosphoproteomics",
-  primary_columns = shortlist,
-  secondary_columns = longlist
-)
-
-# for the example we are using an UNCORRECTED PVALUE
-#     which will allow us to plot more values, but
-#     for real applications it's necessary to use the
-#     CORRECTED PVALUE
-
-# here are all the kinases *significant (*uncorrected) from the analysis
-or <- order(phosphodata.ksea.corr.svl[, "pvalue"])
-ksea_result <- phosphodata.ksea.corr.svl[or, ][1:9, ]
-ksea_cols <- rep("grey", 9)
-ksea_cols[which(ksea_result[, "oddsratio"] > 0)] <- "black"
-
-# plot left panel: correlation significance of top most significant kinases
-barplot(ksea_result[, "oddsratio"],
-  horiz = TRUE, xlim = c(-1, 0.5),
-  names.arg = rownames(ksea_result), las = 1, col = ksea_cols
-)
-

-
-
-# plot right panel: abundance comparison results of the same kinases
-barplot(phosphodata.ksea.comp.svl[rownames(ksea_result), "oddsratio"],
-  horiz = TRUE, names.arg = rownames(ksea_result), las = 1, col = "black"
-)
-

-
-
-
- - - - -
- - - - - - - diff --git a/docs/articles/examples_files/figure-html/figure_2-1.png b/docs/articles/examples_files/figure-html/figure_2-1.png deleted file mode 100644 index 6b5f620..0000000 Binary files a/docs/articles/examples_files/figure-html/figure_2-1.png and /dev/null differ diff --git a/docs/articles/examples_files/figure-html/figure_3-1.png b/docs/articles/examples_files/figure-html/figure_3-1.png deleted file mode 100644 index 54a1c3f..0000000 Binary files a/docs/articles/examples_files/figure-html/figure_3-1.png and /dev/null differ diff --git a/docs/articles/examples_files/figure-html/figure_3-2.png b/docs/articles/examples_files/figure-html/figure_3-2.png deleted file mode 100644 index 44400ee..0000000 Binary files a/docs/articles/examples_files/figure-html/figure_3-2.png and /dev/null differ diff --git a/docs/articles/index.html b/docs/articles/index.html deleted file mode 100644 index b6a94b0..0000000 --- a/docs/articles/index.html +++ /dev/null @@ -1,68 +0,0 @@ - -Articles • leapR - Skip to contents - - -
-
-
- -
-

All vignettes

-
- -
leapR Paper Examples
-
-
leapR
-
-
leapR Order Enrichment Tests
-
-
-
- - -
- - - - - - - diff --git a/docs/articles/leapR.html b/docs/articles/leapR.html deleted file mode 100644 index 1ef5e6b..0000000 --- a/docs/articles/leapR.html +++ /dev/null @@ -1,841 +0,0 @@ - - - - - - - -leapR • leapR - - - - - - - - Skip to contents - - -
- - - - -
-
- - - -
-

Installation -

-

This is intended to be a short introduction to the leapR -package. First we need to load the required libraries:

-
-# install from bioconductor
-if (!require(BiocManager)) {
-  install.packages('BiocManager')
-  BiocManager::install('leapR')
-}
-
-
-

Load libraries needed -

-
-# load the core libraries
-library(leapR)
-library(gplots)
-library(rmarkdown)
-# plotting helpers used in this vignette
-library(ggplot2)
-library(dplyr)
-library(tibble)
-library(stringr)
-
-
-

Introduction -

-
-

Definitions -

-

Dataset - an expression dataset, contained in the -Bioconductor object, that at the bare minimum has a matrix of components -(rows) measured in the same system under multiple different conditions -(columns)

-

Component - the things being measured, genes, proteins, -methylation site, phosphosite, etc. For functional (currently) the -component must be associated with a gene name. That is, there’s not -currently a way to calculate pathway enrichment using lipids.

-

Pathway - a set of components that works together to -accomplish something or are related to each other in some other way. -This includes classic signaling and metabolic pathways, but also -molecular function and localization categories and other groups of -related components, like genome location, conservation, etc.

-

Condition - a sample where the treatment, environmental -conditions, patient, time point or some combination of those is -varied.

-

The overall idea for functional enrichment is to determine which -pathways are statistically over-represented in one group versus another, -display statistically differential abundance from one group to another, -or are statistically differentially distributed in a ranked list based -on the abundance of one sample. Each of these purposes has a different -underlying statistical test (or family of tests) and the results of each -can be interpreted in somewhat different ways. The purpose of this -vignette is to give the user a very brief introduction on how to use the -package, not to discuss the underlying statistical choices that need to -be made when analyzing such data.

-

There are a number of caveats (probably non-exhaustive) with doing -this kind of analysis.

-
-
-

Important points for consideration -

-
-

Data normalization -

-

One important point is to use data that’s been normalized in a -particular way to do these analyses. Data here has been normalized as a -Z score by row (gene/protein/etc.). So, for each row, calculate -the mean and standard deviation across all the conditions (columns) and -then express as a Z score.

-

Here’s why. All high-throughput technologies (microarray, RNAseq, -MS-assisted proteomics, metabolomics, lipidomics, etc.) suffer from the -same limitation. The detectability of each molecule being detected -(protein, RNA, etc.) is different and, in general, it’s impossible to -accurately determine how detectable each one is. The multi-omic -functional enrichment process lumps together measurements from different -components (proteins, genes, etc.) to summarize a pathway. If the -component measurements aren’t directly comparable (they aren’t) then -this can and will introduce significant systematic errors and won’t -produce the results you’re looking for. Careful consideration must be -given that the results of the analysis reflect the question being asked -and that the normalization method hasn’t obscured the desired -results.

-
-
-

Background -

-

The background of comparison for functional enrichment is always -important, but it mainly impacts the Fisher’s exact tests in the -examples below. The background answers the question: “My functional -group of interest is statistically enriched relative to what?” For -Fisher’s exact tests this is critical. Generally, it is best to compare -enrichment against the components observed in the data (the experiment’s -universe) rather than the universe of all possible components. For -example, a proteomics dataset from plasma may contain a limited set of -proteins compared with all possible human proteins; using the observed -proteins as the background usually yields more meaningful results. Using -all possible proteins will result in substantially different -findings.

-
-
-

Multiple hypothesis correction -

-

When testing the statistical significance of differences in a lot of -pathways it’s necessary to correct for multiple hypotheses. This -essentially accounts for the possibility you might see SOMETHING -significant by chance if you just test enough things- so it moves p -values in a less significant direction. The more things you test, the -greater this move will be. So pathway databases with lots of pathways -are affected more by this correction, making it harder to get a -significant result (which is a good thing actually).

-
-
-

Pathway databases -

-

Two ‘databases’ (organized text files) are included for pathways. The -example is taken from the NCI’s Pathway Interaction Database (PID) and -covers signaling pathways in human - but is no longer being actively -maintained. They can be loaded as follows:

-
-data(ncipid)
-
-
-

Identifiers -

-

The identifiers (gene names, e.g.) for the data input MUST match the -identifiers used in the pathway database. The two included human -databases use the HGNC-approved gene names. Which means your data has to -use the same identifiers.

-
-
-

Example data -

-

A sample data set is included that is from the CPTAC study of 169 -ovarian tumors. We include the dataset as a object, containing three -assays (transcriptomics, global proteomics, and phosphoproteomics) to -enable interoperability with other tools, and store example file as -rda on Figshare -as example.

-

This data can be loaded as follows:

-
-# Inspect the `pset` SummarizedExperiment.
-str(pset)
-#> Formal class 'SummarizedExperiment' [package "SummarizedExperiment"] with 5 slots
-#>   ..@ colData        :Formal class 'DFrame' [package "S4Vectors"] with 6 slots
-#>   .. .. ..@ rownames       : chr [1:174] "TCGA-09-1664" "TCGA-09-2056" "TCGA-13-1404" "TCGA-13-1409" ...
-#>   .. .. ..@ nrows          : int 174
-#>   .. .. ..@ elementType    : chr "ANY"
-#>   .. .. ..@ elementMetadata: NULL
-#>   .. .. ..@ metadata       : list()
-#>   .. .. ..@ listData       : Named list()
-#>   ..@ assays         :Formal class 'SimpleAssays' [package "SummarizedExperiment"] with 1 slot
-#>   .. .. ..@ data:Formal class 'SimpleList' [package "S4Vectors"] with 4 slots
-#>   .. .. .. .. ..@ listData       :List of 1
-#>   .. .. .. .. .. ..$ proteomics: num [1:18632, 1:174] -4.0649 -0.1398 -0.0366 0.768 0.2437 ...
-#>   .. .. .. .. .. .. ..- attr(*, "dimnames")=List of 2
-#>   .. .. .. .. .. .. .. ..$ : chr [1:18632] "C9orf152" "ELMO2" "RPS11" "CREB3L1" ...
-#>   .. .. .. .. .. .. .. ..$ : chr [1:174] "TCGA-09-1664" "TCGA-09-2056" "TCGA-13-1404" "TCGA-13-1409" ...
-#>   .. .. .. .. ..@ elementType    : chr "ANY"
-#>   .. .. .. .. ..@ elementMetadata: NULL
-#>   .. .. .. .. ..@ metadata       : list()
-#>   ..@ NAMES          : chr [1:18632] "C9orf152" "ELMO2" "RPS11" "CREB3L1" ...
-#>   ..@ elementMetadata:Formal class 'DFrame' [package "S4Vectors"] with 6 slots
-#>   .. .. ..@ rownames       : NULL
-#>   .. .. ..@ nrows          : int 18632
-#>   .. .. ..@ elementType    : chr "ANY"
-#>   .. .. ..@ elementMetadata: NULL
-#>   .. .. ..@ metadata       : list()
-#>   .. .. ..@ listData       : Named list()
-#>   ..@ metadata       : list()
-dim(SummarizedExperiment::assay(pset, "proteomics"))
-#> [1] 18632   174
-head(rownames(pset))
-#> [1] "C9orf152" "ELMO2"    "RPS11"    "CREB3L1"  "PNMA1"    "MMP2"
-head(colnames(pset))
-#> [1] "TCGA-09-1664" "TCGA-09-2056" "TCGA-13-1404" "TCGA-13-1409" "TCGA-13-1410"
-#> [6] "TCGA-13-1482"
-

We also include some groups of patients to compare stored as R data -objects:

-
-data(shortlist)
-data(longlist)
-
-## columns that we want to use for results
-
-cols_to_display <- c("ingroup_n", "outgroup_n", "background_n", 
-                     "pvalue", "BH_pvalue")
-

The data are now loaded and ready to go through some of the -examples.

-
-
-
-
-

Examples -

-

We include five examples of how to use this tool, depending on the -analysis at hand. ## Comparison of one condition/group versus another -condition/group.

-

There are a number of ways to do this. I generally use a simple -approach which assesses the statistical difference in distributions -between the abundance values from all the members of a pathway in all -the group members from one group with those from the other group using a -t test.

-
-

Caveat -

-

This is a ‘bag of values’ approach and it does not pay attention to -the relationships between values in different groups (i.e. that each -group has measurements for the same component). There are likely issues -that rise because of this and caveats associated with it. However, it -works fairly well.

-
-
-

Description -

-

In this example we are assessing the enrichment of pathways in a -group of short surviving patients versus in a group of long -surviving
-patients. We can also do a single patient-to-patient comparison or -compare a single patient to a group of patients.

-
-
-

Interpretation -

-

Better corrected p-values are more enriched. However, you can get -good p-values when the algorithm only considers a limited number of -components from a pathway. That is, the pathway may have 30 members and -the p-value is coming from values from just 3 members. You can look at -the ingroup_n column from the result matrix to see this -(and screen out if desired).

-

It is VERY important to also consider the effect size. That is, the -difference between the mean of one group and the mean of the other -group. If there are large numbers of components in the pathway being -compared it is relatively easy to get a significant p value with small -effect size. Though this may be a real difference it is often not as -interesting as a smaller group with worse p value and greater effect -size. You can look at the effect size by comparing the -ingroup_mean and outgroup_mean columns.

-
-# in this example we lump a bunch of patients together (the 'short survivors')
-# and compare them to another group (the 'long survivors')
-
-### using enrichment_wrapper function
-protdata.enrichment.svl <- leapR::leapR(
-  geneset = ncipid,
-  enrichment_method = "enrichment_comparison",
-  eset = pset,
-  assay_name = "proteomics",
-  primary_columns = shortlist,
-  secondary_columns = longlist
-)
-
-or <- order(unlist(protdata.enrichment.svl[, "pvalue"]))
-rmarkdown::paged_table(protdata.enrichment.svl[or, cols_to_display])
-
- -
-
-# another application is to compare just one patient against another
-# (this would be the  equivalent of comparing one time point to another)
-
-### using enrichment_wrapper function
-protdata.enrichment.svl.ovo <- leapR::leapR(
-  geneset = ncipid,
-  enrichment_method = "enrichment_comparison",
-  eset = pset,
-  assay_name = "proteomics",
-  primary_columns = shortlist[1],
-  secondary_columns = longlist[1]
-)
-or <- order(unlist(protdata.enrichment.svl.ovo[, "pvalue"]))
-rmarkdown::paged_table(protdata.enrichment.svl.ovo[or, cols_to_display])
-
- -
-

When we only compare one sample to another, we get no enriched -pathways.

-
-
-

Fisher’s exact test -

-

For this test I use Fisher’s exact which is a simple comparison of -the overlap of two sets (think of it like a statistical Venn diagram -with two groups). It’s also referred to as a hypergeometric test.

-
-

Caveats -

-

Caveat 1. Fisher’s exact does not consider abundance values -but only lists of components. Generally this requires some separation of -a group of interest using differential expression, module membership -(from a network for example), or some other method.

-

Caveat 2. The choice of background for comparison can make a -big difference on outcome. For example, in a proteomics experiment where -you’re looking at enrichment in a group of highly differentially -expressed proteins, you could choose to use all possible proteins as a -background, or you could use just those proteins that were observed by -proteomics (generally a much more limited set). The second option is -generally the best since the first options will result in (partly to -mostly) functions that are enriched in proteins that are seen in -proteomics. That is, the most abundant proteins, which is generally not -the desired outcome.

-
-
-

Description -

-

In the example below I construct a genelist of interest using a -simple abundance threshold on the data then use a background of all the -genes in the example dataset (which is a limited number). I then do a -simple hierarchical clustering on the data, extract modules, and step -through each module to calculate enrichment for them, outputting the -results into a separate text file.

-
-
-

Interpretation -

-

As with the t test comparison above it is important to look at the -number of pathway members included in the comparison (look at the -in_path column). There is no ‘effect size’ problem with Fisher’s exact -since it’s just a set comparison, but it’s important to note that -significant p values can arise from a pathway being -underrepresented in the genelist, which often times is not the -desired result. The foldx column gives a ratio of in versus not in the -genelist, values > 1 being enriched and <1 being depleted.

-
-# for this example we will construct a list of genes from the expression data
-#     to emulate what you might be inputting
-genelist <- rownames(pset)[which(SummarizedExperiment::assay(pset, 
-                                                    "proteomics")[, 1] > 0.5)]
-
-protdata.enrichment.sets.test <- leapR::leapR(
-  geneset = ncipid,
-  enrichment_method = "enrichment_in_sets",
-  eset = pset,
-  assay_name = "proteomics",
-  targets = genelist
-)
-or <- order(protdata.enrichment.sets.test[, "pvalue"])
-rmarkdown::paged_table(protdata.enrichment.sets.test[or, cols_to_display])
-
- -
-
-
-
-
-# in this example we construct some modules from the hierarchical clustering
-#   of the   data
-protdata_naf <- SummarizedExperiment::assay(pset, "proteomics")
-
-# hierarchical clustering is not too happy with lots of missing values
-#    so we'll do a zero fill on this to get the modules
-protdata_naf[which(is.na(protdata_naf))] <- 0
-
-# construct the hierarchical clustering using the 'wardD' method, which
-#    seems to give more even sized modules
-protdata_hc <- hclust(dist(protdata_naf), method = "ward.D2")
-
-# arbitrarily we'll chop the clusters into 5 modules
-modules <- cutree(protdata_hc, k = 5)
-
-## sara: created list
-clusters <- lapply(unique(modules), function(x) names(which(modules == x)))
-
-# modules is a named list of values where each value is a module
-#         number and the name is the gene name
-
-# To do enrichment for one module (module 1 in this case) do this
-protdata.enrichment.sets.module_1 <- leapR::leapR(
-  geneset = ncipid,
-  enrichment_method = "enrichment_in_sets",
-  eset = pset,
-  assay_name = "proteomics",
-  targets = names(modules[which(modules == 1)])
-)
-
-# To do enrichment on all modules and return the list of enrichment results
-protdata.enrichment.sets.modules <- do.call(rbind, 
-                                            leapR::cluster_enrichment(
-                                                eset = pset,
-                                                assay_name= 'proteomics',
-                                                geneset = ncipid,
-                                                clusters = clusters, 
-                                                sigfilter = 0.25))
-## nothing is enriched
-rmarkdown::paged_table(protdata.enrichment.sets.modules[, cols_to_display])
-
- -
-
-
Visualizing Fisher’s exact results -
-
-# Plot the top enriched gene sets from Fisher's exact test
-# Stars indicate significance (None seen here)
-plot_leapr_bar(
-  protdata.enrichment.sets.test,
-  title = "Fisher's Exact Test: Top Enriched Pathways",
-  top_n = 10,
-  star_thresholds = c(0.05, 0.01, 0.001),
-  wrap = 40
-)
-

-
-
-
-
-

The Kolmogorov–Smirnov test (KS) -

-

Similar to the popular GSEA, KS tests whether a group of components -(the pathway) is distributed in a statistically significant manner in a -ranked list of components. That is, if all the members of the pathway -are clustered together at the top of the list (highly abundant, e.g.) or -at the bottom of the list (low abundance, e.g.) this will return good p -values. I should note that GSEA uses a more sophisticated approach than -this and their application has a lot of bells and whistles.

-
-

Description -

-

In the example below I’m simply calculating enrichment for one of the -patients in the list (arbitrarily selected). The ranking value is -relative protein abundance in this case, but can be any continuous -measure or derived value. For example, you could calculate the topology -of all proteins in a network and use the topology measure (degree) as -the measure.

-
-
-

Interpretation -

-

Similar to the other examples be cautious of pathways with good p -values that consider a small number of pathway numbers (in_path column). -The MeanPath column gives a measure that shows how far above or below -the median the mean rank of the pathway is (normalized to -1,1). The -Zscore column is a Zscore calculated on the basis of the mean percentage -rank of the pathway relative to the mean of the entire list divided by -the standard deviation of the pathway rank. The foldx column expresses -the mean percentage rank of the pathway relative to the entire list - -closer to 0 is higher in the list and closer to 1 is closer to the -bottom of the list. Each of these should give consistent results, but -will be somewhat different.

-
-# This is how you calculate enrichment in a ranked list 
-# (for example from topology)
-### using enrichment_wrapper function
-protdata.enrichment.order <- leapR::leapR(
-  geneset = ncipid, "enrichment_in_order",
-  eset = pset,
-  method = 'ks',
-  assay_name = "proteomics",
-  primary_columns = shortlist[1]
-)
-
-
-or <- order(protdata.enrichment.order[, "pvalue"])
-rmarkdown::paged_table(protdata.enrichment.order[or, cols_to_display])
-
- -
-
-
Visualizing KS test results -
-
-# Plot the ranked enrichment results
-plot_leapr_bar(
-  protdata.enrichment.order,
-  title = "Kolmogorov-Smirnov Test: Ranked Enrichment",
-  top_n = 12,
-  fill_sig = "#2166AC",
-  fill_ns = "#B2DFDB",
-  wrap = 38
-)
-

-
-
-
-

KS alternative: the one-sample Z test -

-

Given that the KS test has not always been the best for -gene set enrichment we also implement the one-sample z test.

-
-# This is how you calculate enrichment in a ranked list 
-# (for example from topology)
-### using enrichment_wrapper function
-protdata.enrichment.order <- leapR::leapR(
-  geneset = ncipid, "enrichment_in_order",
-  eset = pset,
-  method = 'ztest',
-  assay_name = "proteomics",
-  primary_columns = shortlist[1]
-)
-
-
-or <- order(protdata.enrichment.order[, "pvalue"])
-rmarkdown::paged_table(protdata.enrichment.order[or, cols_to_display])
-
- -
-
-
-plot_leapr_bar(
-  protdata.enrichment.order,
-  title = "Z Test: Ranked Enrichment",
-  top_n = 12,
-  fill_sig = "#2166AC",
-  fill_ns = "#B2DFDB",
-  wrap = 38
-)
-

-
-
-
-

Enrichment in Correlation -

-

The idea here is to use the correlation of pathway members to each -other versus to non-pathway members as a way to assess functional -enrichment. This idea seems sound- pathways that are varying in a -correlated way across a bunch of conditions (say time points or -patients) may be more active and more important than others. However, -more testing and validation is needed to show that this is the case.

-
-

Interpretation -

-

The ingroup_mean gives the mean correlation of the -pathway members to each other and outgroup_mean gives the correlation of -the pathway members to non-pathway members. Background_mean gives the -mean correlation of all non-pathway members. The pvalue and -BH_pvalue are for the pathway members to each other versus -those pathway members to non-pathway components. The -pvalue_background and BH_pvalue_background are -for the pathway member correlation relative to non-pathway member -correlation (which is similar but slightly different than the other -p-values).

-
-### using enrichment_wrapper function
-protdata.enrichment.correlation <- leapR::leapR(
-  geneset = ncipid,
-  enrichment_method = "correlation_enrichment",
-  assay_name = "proteomics",
-  eset = pset
-)
-
-or <- order(protdata.enrichment.correlation[, "pvalue"])
-rmarkdown::paged_table(head(protdata.enrichment.correlation[or, 
-                                                      cols_to_display]))
-
- -
-
-
-protdata.enrichment.correlation.short <- leapR::leapR(
-  geneset = ncipid,
-  enrichment_method = "correlation_enrichment",
-  assay_name = "proteomics",
-  eset = pset[, shortlist]
-)
-or <- order(protdata.enrichment.correlation.short[, "pvalue"])
-rmarkdown::paged_table(head(protdata.enrichment.correlation.short[or, 
-                                                        cols_to_display]))
-
- -
-
-
-protdata.enrichment.correlation.long <- leapR::leapR(
-  geneset = ncipid,
-  enrichment_method = "correlation_enrichment",
-  assay_name = "proteomics",
-  eset = pset[, longlist]
-)
-or <- order(protdata.enrichment.correlation.long[, "pvalue"])
-rmarkdown::paged_table(head(protdata.enrichment.correlation.long[or, 
-                                                            cols_to_display]))
-
- -
-
-
Visualizing correlation enrichment results -
-
-# Compare correlation patterns across conditions
-plot_leapr_bar(
-  protdata.enrichment.correlation.short,
-  title = "Correlation Enrichment: Short Survivors",
-  top_n = 10,
-  fill_sig = "#1B9E77",
-  fill_ns = "#D8F0E8",
-  wrap = 36
-)
-

-
-
-
-
-

Phosphoproteomics data analysis -

-

In this example we will use phosphoproteomics data to assess the -enrichment in known kinase substrates (a proxy for kinase activity)

-
-data("kinasesubstrates")
-
-# for an individual tumor calculate the Kinase-Substrate 
-# Enrichment (similar to KSEA)
-#     This uses the site-specific phosphorylation data to determine 
-# which kinases
-#     might be active by assessing the enrichment of the 
-# phosphorylation of their known substrates
-
-phosphodata.ksea.order <- leapR::leapR(
-  geneset = kinasesubstrates,
-  enrichment_method = "enrichment_in_order",
-  assay_name = "phosphoproteomics",
-  eset = phset,
-  method = 'ztest', 
-  primary_columns = "TCGA-13-1484")
-
-or <- order(phosphodata.ksea.order[, "pvalue"])
-rmarkdown::paged_table(phosphodata.ksea.order[or, cols_to_display])
-
- -
-
-
-
-# now do the same thing but use a threshold
-phosphodata.sets.order <- leapR::leapR(
-  geneset = kinasesubstrates,
-  enrichment_method = "enrichment_in_sets",
-  eset = phset,
-  assay_name = "phosphoproteomics",
-  threshold = 0.5,
-  primary_columns = "TCGA-13-1484"
-)
-or <- order(phosphodata.sets.order[, "pvalue"])
-rmarkdown::paged_table(phosphodata.sets.order[or, cols_to_display])
-
- -
-
-
Visualizing kinase substrate enrichment -
-
-plot <- plot_leapr_bar(
-  phosphodata.sets.order,
-  title            = "Kinase Substrate Enrichment (Phosphoproteomics)",
-  top_n            = 15,
-  star_thresholds  = c(0.05, 0.01, 1e-3),
-  wrap             = 36,
-  fill_sig         = "#0F766E",  # dark teal for significant
-  fill_ns          = "#99F6E4",  # light teal for non-significant
-  outline          = "grey30",
-  axis_text_y_size = 7,
-  axis_text_x_size = 8
-)
-
-plot
-

-
-
-# You can also modify the plot further using standard ggplot2 arguments
-plot + ggplot2::labs(
-  y = expression(-log[10]("adjusted p-value")),
-  caption = "* p<0.05, ** p<0.01, *** p<0.001"
-)
-

-

Lastly we print out the session info!

-
-sessionInfo()
-#> R version 4.5.2 (2025-10-31)
-#> Platform: aarch64-apple-darwin20
-#> Running under: macOS Tahoe 26.2
-#> 
-#> Matrix products: default
-#> BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
-#> LAPACK: /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.1
-#> 
-#> locale:
-#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-#> 
-#> time zone: America/Los_Angeles
-#> tzcode source: internal
-#> 
-#> attached base packages:
-#> [1] stats     graphics  grDevices utils     datasets  methods   base     
-#> 
-#> other attached packages:
-#> [1] stringr_1.6.0    tibble_3.3.1     dplyr_1.1.4      ggplot2_4.0.1   
-#> [5] rmarkdown_2.30   gplots_3.3.0     leapR_0.99.7     BiocStyle_2.38.0
-#> 
-#> loaded via a namespace (and not attached):
-#>  [1] SummarizedExperiment_1.40.0 gtable_0.3.6               
-#>  [3] xfun_0.56                   bslib_0.10.0               
-#>  [5] htmlwidgets_1.6.4           caTools_1.18.3             
-#>  [7] Biobase_2.70.0              lattice_0.22-7             
-#>  [9] tzdb_0.5.0                  vctrs_0.7.1                
-#> [11] tools_4.5.2                 bitops_1.0-9               
-#> [13] generics_0.1.4              stats4_4.5.2               
-#> [15] pkgconfig_2.0.3             Matrix_1.7-4               
-#> [17] KernSmooth_2.23-26          RColorBrewer_1.1-3         
-#> [19] S7_0.2.1                    desc_1.4.3                 
-#> [21] S4Vectors_0.48.0            lifecycle_1.0.5            
-#> [23] compiler_4.5.2              farver_2.1.2               
-#> [25] textshaping_1.0.4           Seqinfo_1.0.0              
-#> [27] htmltools_0.5.9             sass_0.4.10                
-#> [29] yaml_2.3.12                 pkgdown_2.2.0              
-#> [31] pillar_1.11.1               jquerylib_0.1.4            
-#> [33] DelayedArray_0.36.0         cachem_1.1.0               
-#> [35] abind_1.4-8                 gtools_3.9.5               
-#> [37] tidyselect_1.2.1            digest_0.6.39              
-#> [39] stringi_1.8.7               bookdown_0.46              
-#> [41] labeling_0.4.3              fastmap_1.2.0              
-#> [43] grid_4.5.2                  cli_3.6.5                  
-#> [45] SparseArray_1.10.8          magrittr_2.0.4             
-#> [47] S4Arrays_1.10.1             readr_2.1.6                
-#> [49] withr_3.0.2                 scales_1.4.0               
-#> [51] XVector_0.50.0              matrixStats_1.5.0          
-#> [53] otel_0.2.0                  ragg_1.5.0                 
-#> [55] hms_1.1.4                   evaluate_1.0.5             
-#> [57] knitr_1.51                  GenomicRanges_1.62.1       
-#> [59] IRanges_2.44.0              rlang_1.1.7                
-#> [61] glue_1.8.0                  BiocManager_1.30.27        
-#> [63] BiocGenerics_0.56.0         rstudioapi_0.18.0          
-#> [65] jsonlite_2.0.0              R6_2.6.1                   
-#> [67] MatrixGenerics_1.22.0       systemfonts_1.3.1          
-#> [69] fs_1.6.6
-
-
-
-
-
- - - - -
- - - - - - - diff --git a/docs/articles/leapR_files/figure-html/corr_plot-1.png b/docs/articles/leapR_files/figure-html/corr_plot-1.png deleted file mode 100644 index a885056..0000000 Binary files a/docs/articles/leapR_files/figure-html/corr_plot-1.png and /dev/null differ diff --git a/docs/articles/leapR_files/figure-html/fishers_plot-1.png b/docs/articles/leapR_files/figure-html/fishers_plot-1.png deleted file mode 100644 index b1cc060..0000000 Binary files a/docs/articles/leapR_files/figure-html/fishers_plot-1.png and /dev/null differ diff --git a/docs/articles/leapR_files/figure-html/ks_plot-1.png b/docs/articles/leapR_files/figure-html/ks_plot-1.png deleted file mode 100644 index c1a2be9..0000000 Binary files a/docs/articles/leapR_files/figure-html/ks_plot-1.png and /dev/null differ diff --git a/docs/articles/leapR_files/figure-html/phos_plot-1.png b/docs/articles/leapR_files/figure-html/phos_plot-1.png deleted file mode 100644 index 6b60cf4..0000000 Binary files a/docs/articles/leapR_files/figure-html/phos_plot-1.png and /dev/null differ diff --git a/docs/articles/leapR_files/figure-html/phos_plot-2.png b/docs/articles/leapR_files/figure-html/phos_plot-2.png deleted file mode 100644 index ad270bd..0000000 Binary files a/docs/articles/leapR_files/figure-html/phos_plot-2.png and /dev/null differ diff --git a/docs/articles/leapR_files/figure-html/zt-1.png b/docs/articles/leapR_files/figure-html/zt-1.png deleted file mode 100644 index ac25009..0000000 Binary files a/docs/articles/leapR_files/figure-html/zt-1.png and /dev/null differ diff --git a/docs/articles/leapR_files/pagedtable-1.1/css/pagedtable.css b/docs/articles/leapR_files/pagedtable-1.1/css/pagedtable.css deleted file mode 100644 index 8764d88..0000000 --- a/docs/articles/leapR_files/pagedtable-1.1/css/pagedtable.css +++ /dev/null @@ -1,142 +0,0 @@ -.pagedtable { - overflow: auto; - padding-left: 8px; - padding-right: 8px; -} - -.pagedtable-wrapper { - border: 1px solid #ccc; - border-radius: 4px; - margin-bottom: 10px; -} - -.pagedtable table { - width: 100%; - max-width: 100%; - margin: 0; -} - -.pagedtable th { - padding: 0 5px 0 5px; - border: none; - border-bottom: 2px solid #dddddd; - - min-width: 45px; -} - -.pagedtable-empty th { - display: none; -} - -.pagedtable td { - padding: 0 4px 0 4px; -} - -.pagedtable .even { - background-color: rgba(140, 140, 140, 0.1); -} - -.pagedtable-padding-col { - display: none; -} - -.pagedtable a { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.pagedtable-index-nav { - cursor: pointer; - padding: 0 5px 0 5px; - float: right; - border: 0; -} - -.pagedtable-index-nav-disabled { - cursor: default; - text-decoration: none; - color: #999; -} - -a.pagedtable-index-nav-disabled:hover { - text-decoration: none; - color: #999; -} - -.pagedtable-indexes { - cursor: pointer; - float: right; - border: 0; -} - -.pagedtable-index-current { - cursor: default; - text-decoration: none; - font-weight: bold; - color: #333; - border: 0; -} - -a.pagedtable-index-current:hover { - text-decoration: none; - font-weight: bold; - color: #333; -} - -.pagedtable-index { - width: 30px; - display: inline-block; - text-align: center; - border: 0; -} - -.pagedtable-index-separator-left { - display: inline-block; - color: #333; - font-size: 9px; - padding: 0 0 0 0; - cursor: default; -} - -.pagedtable-index-separator-right { - display: inline-block; - color: #333; - font-size: 9px; - padding: 0 4px 0 0; - cursor: default; -} - -.pagedtable-footer { - padding-top: 4px; - padding-bottom: 5px; -} - -.pagedtable-not-empty .pagedtable-footer { - border-top: 2px solid #dddddd; -} - -.pagedtable-info { - overflow: hidden; - color: #999; - white-space: nowrap; - text-overflow: ellipsis; -} - -.pagedtable-header-name { - overflow: hidden; - text-overflow: ellipsis; -} - -.pagedtable-header-type { - color: #999; - font-weight: 400; -} - -.pagedtable-na-cell { - font-style: italic; - opacity: 0.3; -} diff --git a/docs/articles/leapR_files/pagedtable-1.1/js/pagedtable.js b/docs/articles/leapR_files/pagedtable-1.1/js/pagedtable.js deleted file mode 100644 index 52ada2b..0000000 --- a/docs/articles/leapR_files/pagedtable-1.1/js/pagedtable.js +++ /dev/null @@ -1,1151 +0,0 @@ -// Production steps of ECMA-262, Edition 5, 15.4.4.18 -// Reference: http://es5.github.io/#x15.4.4.18 -if (!Array.prototype.forEach) { - - Array.prototype.forEach = function(callback, thisArg) { - - var T, k; - - if (this === null) { - throw new TypeError(' this is null or not defined'); - } - - // 1. Let O be the result of calling toObject() passing the - // |this| value as the argument. - var O = Object(this); - - // 2. Let lenValue be the result of calling the Get() internal - // method of O with the argument "length". - // 3. Let len be toUint32(lenValue). - var len = O.length >>> 0; - - // 4. If isCallable(callback) is false, throw a TypeError exception. - // See: http://es5.github.com/#x9.11 - if (typeof callback !== "function") { - throw new TypeError(callback + ' is not a function'); - } - - // 5. If thisArg was supplied, let T be thisArg; else let - // T be undefined. - if (arguments.length > 1) { - T = thisArg; - } - - // 6. Let k be 0 - k = 0; - - // 7. Repeat, while k < len - while (k < len) { - - var kValue; - - // a. Let Pk be ToString(k). - // This is implicit for LHS operands of the in operator - // b. Let kPresent be the result of calling the HasProperty - // internal method of O with argument Pk. - // This step can be combined with c - // c. If kPresent is true, then - if (k in O) { - - // i. Let kValue be the result of calling the Get internal - // method of O with argument Pk. - kValue = O[k]; - - // ii. Call the Call internal method of callback with T as - // the this value and argument list containing kValue, k, and O. - callback.call(T, kValue, k, O); - } - // d. Increase k by 1. - k++; - } - // 8. return undefined - }; -} - -// Production steps of ECMA-262, Edition 5, 15.4.4.19 -// Reference: http://es5.github.io/#x15.4.4.19 -if (!Array.prototype.map) { - - Array.prototype.map = function(callback, thisArg) { - - var T, A, k; - - if (this == null) { - throw new TypeError(' this is null or not defined'); - } - - // 1. Let O be the result of calling ToObject passing the |this| - // value as the argument. - var O = Object(this); - - // 2. Let lenValue be the result of calling the Get internal - // method of O with the argument "length". - // 3. Let len be ToUint32(lenValue). - var len = O.length >>> 0; - - // 4. If IsCallable(callback) is false, throw a TypeError exception. - // See: http://es5.github.com/#x9.11 - if (typeof callback !== 'function') { - throw new TypeError(callback + ' is not a function'); - } - - // 5. If thisArg was supplied, let T be thisArg; else let T be undefined. - if (arguments.length > 1) { - T = thisArg; - } - - // 6. Let A be a new array created as if by the expression new Array(len) - // where Array is the standard built-in constructor with that name and - // len is the value of len. - A = new Array(len); - - // 7. Let k be 0 - k = 0; - - // 8. Repeat, while k < len - while (k < len) { - - var kValue, mappedValue; - - // a. Let Pk be ToString(k). - // This is implicit for LHS operands of the in operator - // b. Let kPresent be the result of calling the HasProperty internal - // method of O with argument Pk. - // This step can be combined with c - // c. If kPresent is true, then - if (k in O) { - - // i. Let kValue be the result of calling the Get internal - // method of O with argument Pk. - kValue = O[k]; - - // ii. Let mappedValue be the result of calling the Call internal - // method of callback with T as the this value and argument - // list containing kValue, k, and O. - mappedValue = callback.call(T, kValue, k, O); - - // iii. Call the DefineOwnProperty internal method of A with arguments - // Pk, Property Descriptor - // { Value: mappedValue, - // Writable: true, - // Enumerable: true, - // Configurable: true }, - // and false. - - // In browsers that support Object.defineProperty, use the following: - // Object.defineProperty(A, k, { - // value: mappedValue, - // writable: true, - // enumerable: true, - // configurable: true - // }); - - // For best browser support, use the following: - A[k] = mappedValue; - } - // d. Increase k by 1. - k++; - } - - // 9. return A - return A; - }; -} - -var PagedTable = function (pagedTable) { - var me = this; - - var source = function(pagedTable) { - var sourceElems = [].slice.call(pagedTable.children).filter(function(e) { - return e.hasAttribute("data-pagedtable-source"); - }); - - if (sourceElems === null || sourceElems.length !== 1) { - throw("A single data-pagedtable-source was not found"); - } - - return JSON.parse(sourceElems[0].innerHTML); - }(pagedTable); - - var options = function(source) { - var options = typeof(source.options) !== "undefined" && - source.options !== null ? source.options : {}; - - var columns = typeof(options.columns) !== "undefined" ? options.columns : {}; - var rows = typeof(options.rows) !== "undefined" ? options.rows : {}; - - var positiveIntOrNull = function(value) { - return parseInt(value) >= 0 ? parseInt(value) : null; - }; - - return { - pages: positiveIntOrNull(options.pages), - rows: { - min: positiveIntOrNull(rows.min), - max: positiveIntOrNull(rows.max), - total: positiveIntOrNull(rows.total) - }, - columns: { - min: positiveIntOrNull(columns.min), - max: positiveIntOrNull(columns.max), - total: positiveIntOrNull(columns.total) - } - }; - }(source); - - var Measurer = function() { - - // set some default initial values that will get adjusted in runtime - me.measures = { - padding: 12, - character: 8, - height: 15, - defaults: true - }; - - me.calculate = function(measuresCell) { - if (!me.measures.defaults) - return; - - var measuresCellStyle = window.getComputedStyle(measuresCell, null); - - var newPadding = parsePadding(measuresCellStyle.paddingLeft) + - parsePadding(measuresCellStyle.paddingRight); - - var sampleString = "ABCDEFGHIJ0123456789"; - var newCharacter = Math.ceil(measuresCell.clientWidth / sampleString.length); - - if (newPadding <= 0 || newCharacter <= 0) - return; - - me.measures.padding = newPadding; - me.measures.character = newCharacter; - me.measures.height = measuresCell.clientHeight; - me.measures.defaults = false; - }; - - return me; - }; - - var Page = function(data, options) { - var me = this; - - var defaults = { - max: 7, - rows: 10 - }; - - var totalPages = function() { - return Math.ceil(data.length / me.rows); - }; - - me.number = 0; - me.max = options.pages !== null ? options.pages : defaults.max; - me.visible = me.max; - me.rows = options.rows.min !== null ? options.rows.min : defaults.rows; - me.total = totalPages(); - - me.setRows = function(newRows) { - me.rows = newRows; - me.total = totalPages(); - }; - - me.setPageNumber = function(newPageNumber) { - if (newPageNumber < 0) newPageNumber = 0; - if (newPageNumber >= me.total) newPageNumber = me.total - 1; - - me.number = newPageNumber; - }; - - me.setVisiblePages = function(visiblePages) { - me.visible = Math.min(me.max, visiblePages); - me.setPageNumber(me.number); - }; - - me.getVisiblePageRange = function() { - var start = me.number - Math.max(Math.floor((me.visible - 1) / 2), 0); - var end = me.number + Math.floor(me.visible / 2) + 1; - var pageCount = me.total; - - if (start < 0) { - var diffToStart = 0 - start; - start += diffToStart; - end += diffToStart; - } - - if (end > pageCount) { - var diffToEnd = end - pageCount; - start -= diffToEnd; - end -= diffToEnd; - } - - start = start < 0 ? 0 : start; - end = end >= pageCount ? pageCount : end; - - var first = false; - var last = false; - - if (start > 0 && me.visible > 1) { - start = start + 1; - first = true; - } - - if (end < pageCount && me.visible > 2) { - end = end - 1; - last = true; - } - - return { - first: first, - start: start, - end: end, - last: last - }; - }; - - me.getRowStart = function() { - var rowStart = page.number * page.rows; - if (rowStart < 0) - rowStart = 0; - - return rowStart; - }; - - me.getRowEnd = function() { - var rowStart = me.getRowStart(); - return Math.min(rowStart + me.rows, data.length); - }; - - me.getPaddingRows = function() { - var rowStart = me.getRowStart(); - var rowEnd = me.getRowEnd(); - return data.length > me.rows ? me.rows - (rowEnd - rowStart) : 0; - }; - }; - - var Columns = function(data, columns, options) { - var me = this; - - me.defaults = { - min: 5 - }; - - me.number = 0; - me.visible = 0; - me.total = columns.length; - me.subset = []; - me.padding = 0; - me.min = options.columns.min !== null ? options.columns.min : me.defaults.min; - me.max = options.columns.max !== null ? options.columns.max : null; - me.widths = {}; - - var widthsLookAhead = Math.max(100, options.rows.min); - var paddingColChars = 10; - - me.emptyNames = function() { - columns.forEach(function(column) { - if (columns.label !== null && columns.label !== "") - return false; - }); - - return true; - }; - - var parsePadding = function(value) { - return parseInt(value) >= 0 ? parseInt(value) : 0; - }; - - me.calculateWidths = function(measures) { - columns.forEach(function(column) { - var maxChars = Math.max( - column.label.toString().length, - column.type.toString().length - ); - - for (var idxRow = 0; idxRow < Math.min(widthsLookAhead, data.length); idxRow++) { - maxChars = Math.max(maxChars, data[idxRow][column.name.toString()].length); - } - - me.widths[column.name] = { - // width in characters - chars: maxChars, - // width for the inner html columns - inner: maxChars * measures.character, - // width adding outer styles like padding - outer: maxChars * measures.character + measures.padding - }; - }); - }; - - me.getWidth = function() { - var widthOuter = 0; - for (var idxCol = 0; idxCol < me.subset.length; idxCol++) { - var columnName = me.subset[idxCol].name; - widthOuter = widthOuter + me.widths[columnName].outer; - } - - widthOuter = widthOuter + me.padding * paddingColChars * measurer.measures.character; - - if (me.hasMoreLeftColumns()) { - widthOuter = widthOuter + columnNavigationWidthPX + measurer.measures.padding; - } - - if (me.hasMoreRightColumns()) { - widthOuter = widthOuter + columnNavigationWidthPX + measurer.measures.padding; - } - - return widthOuter; - }; - - me.updateSlice = function() { - if (me.number + me.visible >= me.total) - me.number = me.total - me.visible; - - if (me.number < 0) me.number = 0; - - me.subset = columns.slice(me.number, Math.min(me.number + me.visible, me.total)); - - me.subset = me.subset.map(function(column) { - Object.keys(column).forEach(function(colKey) { - column[colKey] = column[colKey] === null ? "" : column[colKey].toString(); - }); - - column.width = null; - return column; - }); - }; - - me.setVisibleColumns = function(columnNumber, newVisibleColumns, paddingCount) { - me.number = columnNumber; - me.visible = newVisibleColumns; - me.padding = paddingCount; - - me.updateSlice(); - }; - - me.incColumnNumber = function(increment) { - me.number = me.number + increment; - }; - - me.setColumnNumber = function(newNumber) { - me.number = newNumber; - }; - - me.setPaddingCount = function(newPadding) { - me.padding = newPadding; - }; - - me.getPaddingCount = function() { - return me.padding; - }; - - me.hasMoreLeftColumns = function() { - return me.number > 0; - }; - - me.hasMoreRightColumns = function() { - return me.number + me.visible < me.total; - }; - - me.updateSlice(0); - return me; - }; - - var data = source.data; - var page = new Page(data, options); - var measurer = new Measurer(data, options); - var columns = new Columns(data, source.columns, options); - - var table = null; - var tableDiv = null; - var header = null; - var footer = null; - var tbody = null; - - // Caches pagedTable.clientWidth, specially for webkit - var cachedPagedTableClientWidth = null; - - var onChangeCallbacks = []; - - var clearSelection = function() { - if(document.selection && document.selection.empty) { - document.selection.empty(); - } else if(window.getSelection) { - var sel = window.getSelection(); - sel.removeAllRanges(); - } - }; - - var columnNavigationWidthPX = 5; - - var renderColumnNavigation = function(increment, backwards) { - var arrow = document.createElement("div"); - arrow.setAttribute("style", - "border-top: " + columnNavigationWidthPX + "px solid transparent;" + - "border-bottom: " + columnNavigationWidthPX + "px solid transparent;" + - "border-" + (backwards ? "right" : "left") + ": " + columnNavigationWidthPX + "px solid;"); - - var header = document.createElement("th"); - header.appendChild(arrow); - header.setAttribute("style", - "cursor: pointer;" + - "vertical-align: middle;" + - "min-width: " + columnNavigationWidthPX + "px;" + - "width: " + columnNavigationWidthPX + "px;"); - - header.onclick = function() { - columns.incColumnNumber(backwards ? -1 : increment); - - me.animateColumns(backwards); - renderFooter(); - - clearSelection(); - triggerOnChange(); - }; - - return header; - }; - - var maxColumnWidth = function(width) { - var padding = 80; - var columnMax = Math.max(cachedPagedTableClientWidth - padding, 0); - - return parseInt(width) > 0 ? - Math.min(columnMax, parseInt(width)) + "px" : - columnMax + "px"; - }; - - var clearHeader = function() { - var thead = pagedTable.querySelectorAll("thead")[0]; - thead.innerHTML = ""; - }; - - var renderHeader = function(clear) { - cachedPagedTableClientWidth = pagedTable.clientWidth; - - var fragment = document.createDocumentFragment(); - - header = document.createElement("tr"); - fragment.appendChild(header); - - if (columns.number > 0) - header.appendChild(renderColumnNavigation(-columns.visible, true)); - - columns.subset = columns.subset.map(function(columnData) { - var column = document.createElement("th"); - column.setAttribute("align", columnData.align); - column.style.textAlign = columnData.align; - - column.style.maxWidth = maxColumnWidth(null); - if (columnData.width) { - column.style.minWidth = - column.style.maxWidth = maxColumnWidth(columnData.width); - } - - var columnName = document.createElement("div"); - columnName.setAttribute("class", "pagedtable-header-name"); - if (columnData.label === "") { - columnName.innerHTML = " "; - } - else { - columnName.appendChild(document.createTextNode(columnData.label)); - } - column.appendChild(columnName); - - var columnType = document.createElement("div"); - columnType.setAttribute("class", "pagedtable-header-type"); - if (columnData.type === "") { - columnType.innerHTML = " "; - } - else { - columnType.appendChild(document.createTextNode("<" + columnData.type + ">")); - } - column.appendChild(columnType); - - header.appendChild(column); - - columnData.element = column; - - return columnData; - }); - - for (var idx = 0; idx < columns.getPaddingCount(); idx++) { - var paddingCol = document.createElement("th"); - paddingCol.setAttribute("class", "pagedtable-padding-col"); - header.appendChild(paddingCol); - } - - if (columns.number + columns.visible < columns.total) - header.appendChild(renderColumnNavigation(columns.visible, false)); - - if (typeof(clear) == "undefined" || clear) clearHeader(); - var thead = pagedTable.querySelectorAll("thead")[0]; - thead.appendChild(fragment); - }; - - me.animateColumns = function(backwards) { - var thead = pagedTable.querySelectorAll("thead")[0]; - - var headerOld = thead.querySelectorAll("tr")[0]; - var tbodyOld = table.querySelectorAll("tbody")[0]; - - me.fitColumns(backwards); - - renderHeader(false); - - header.style.opacity = "0"; - header.style.transform = backwards ? "translateX(-30px)" : "translateX(30px)"; - header.style.transition = "transform 200ms linear, opacity 200ms"; - header.style.transitionDelay = "0"; - - renderBody(false); - - if (headerOld) { - headerOld.style.position = "absolute"; - headerOld.style.transform = "translateX(0px)"; - headerOld.style.opacity = "1"; - headerOld.style.transition = "transform 100ms linear, opacity 100ms"; - headerOld.setAttribute("class", "pagedtable-remove-head"); - if (headerOld.style.transitionEnd) { - headerOld.addEventListener("transitionend", function() { - var headerOldByClass = thead.querySelector(".pagedtable-remove-head"); - if (headerOldByClass) thead.removeChild(headerOldByClass); - }); - } - else { - thead.removeChild(headerOld); - } - } - - if (tbodyOld) table.removeChild(tbodyOld); - - tbody.style.opacity = "0"; - tbody.style.transition = "transform 200ms linear, opacity 200ms"; - tbody.style.transitionDelay = "0ms"; - - // force relayout - window.getComputedStyle(header).opacity; - window.getComputedStyle(tbody).opacity; - - if (headerOld) { - headerOld.style.transform = backwards ? "translateX(20px)" : "translateX(-30px)"; - headerOld.style.opacity = "0"; - } - - header.style.transform = "translateX(0px)"; - header.style.opacity = "1"; - - tbody.style.opacity = "1"; - } - - me.onChange = function(callback) { - onChangeCallbacks.push(callback); - }; - - var triggerOnChange = function() { - onChangeCallbacks.forEach(function(onChange) { - onChange(); - }); - }; - - var clearBody = function() { - if (tbody) { - table.removeChild(tbody); - tbody = null; - } - }; - - var renderBody = function(clear) { - cachedPagedTableClientWidth = pagedTable.clientWidth - - var fragment = document.createDocumentFragment(); - - var pageData = data.slice(page.getRowStart(), page.getRowEnd()); - - pageData.forEach(function(dataRow, idxRow) { - var htmlRow = document.createElement("tr"); - htmlRow.setAttribute("class", (idxRow % 2 !==0) ? "even" : "odd"); - - if (columns.hasMoreLeftColumns()) - htmlRow.appendChild(document.createElement("td")); - - columns.subset.forEach(function(columnData) { - var cellName = columnData.name; - var dataCell = dataRow[cellName]; - var htmlCell = document.createElement("td"); - - if (dataCell === "NA") htmlCell.setAttribute("class", "pagedtable-na-cell"); - if (dataCell === "__NA__") dataCell = "NA"; - - var cellText = document.createTextNode(dataCell); - htmlCell.appendChild(cellText); - if (dataCell.length > 50) { - htmlCell.setAttribute("title", dataCell); - } - htmlCell.setAttribute("align", columnData.align); - htmlCell.style.textAlign = columnData.align; - htmlCell.style.maxWidth = maxColumnWidth(null); - if (columnData.width) { - htmlCell.style.minWidth = htmlCell.style.maxWidth = maxColumnWidth(columnData.width); - } - htmlRow.appendChild(htmlCell); - }); - - for (var idx = 0; idx < columns.getPaddingCount(); idx++) { - var paddingCol = document.createElement("td"); - paddingCol.setAttribute("class", "pagedtable-padding-col"); - htmlRow.appendChild(paddingCol); - } - - if (columns.hasMoreRightColumns()) - htmlRow.appendChild(document.createElement("td")); - - fragment.appendChild(htmlRow); - }); - - for (var idxPadding = 0; idxPadding < page.getPaddingRows(); idxPadding++) { - var paddingRow = document.createElement("tr"); - - var paddingCellRow = document.createElement("td"); - paddingCellRow.innerHTML = " "; - paddingCellRow.setAttribute("colspan", "100%"); - paddingRow.appendChild(paddingCellRow); - - fragment.appendChild(paddingRow); - } - - if (typeof(clear) == "undefined" || clear) clearBody(); - tbody = document.createElement("tbody"); - tbody.appendChild(fragment); - - table.appendChild(tbody); - }; - - var getLabelInfo = function() { - var pageStart = page.getRowStart(); - var pageEnd = page.getRowEnd(); - var totalRows = data.length; - - var totalRowsLabel = options.rows.total ? options.rows.total : totalRows; - var totalRowsLabelFormat = totalRowsLabel.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,'); - - var infoText = (pageStart + 1) + "-" + pageEnd + " of " + totalRowsLabelFormat + " rows"; - if (totalRows < page.rows) { - infoText = totalRowsLabel + " row" + (totalRows != 1 ? "s" : ""); - } - if (columns.total > columns.visible) { - var totalColumnsLabel = options.columns.total ? options.columns.total : columns.total; - - infoText = infoText + " | " + (columns.number + 1) + "-" + - (Math.min(columns.number + columns.visible, columns.total)) + - " of " + totalColumnsLabel + " columns"; - } - - return infoText; - }; - - var clearFooter = function() { - footer = pagedTable.querySelectorAll("div.pagedtable-footer")[0]; - footer.innerHTML = ""; - - return footer; - }; - - var createPageLink = function(idxPage) { - var pageLink = document.createElement("a"); - pageLinkClass = idxPage === page.number ? "pagedtable-index pagedtable-index-current" : "pagedtable-index"; - pageLink.setAttribute("class", pageLinkClass); - pageLink.setAttribute("data-page-index", idxPage); - pageLink.onclick = function() { - page.setPageNumber(parseInt(this.getAttribute("data-page-index"))); - renderBody(); - renderFooter(); - - triggerOnChange(); - }; - - pageLink.appendChild(document.createTextNode(idxPage + 1)); - - return pageLink; - } - - var renderFooter = function() { - footer = clearFooter(); - - var next = document.createElement("a"); - next.appendChild(document.createTextNode("Next")); - next.onclick = function() { - page.setPageNumber(page.number + 1); - renderBody(); - renderFooter(); - - triggerOnChange(); - }; - if (data.length > page.rows) footer.appendChild(next); - - var pageNumbers = document.createElement("div"); - pageNumbers.setAttribute("class", "pagedtable-indexes"); - - var pageRange = page.getVisiblePageRange(); - - if (pageRange.first) { - var pageLink = createPageLink(0); - pageNumbers.appendChild(pageLink); - - var pageSeparator = document.createElement("div"); - pageSeparator.setAttribute("class", "pagedtable-index-separator-left"); - pageSeparator.appendChild(document.createTextNode("...")) - pageNumbers.appendChild(pageSeparator); - } - - for (var idxPage = pageRange.start; idxPage < pageRange.end; idxPage++) { - var pageLink = createPageLink(idxPage); - - pageNumbers.appendChild(pageLink); - } - - if (pageRange.last) { - var pageSeparator = document.createElement("div"); - pageSeparator.setAttribute("class", "pagedtable-index-separator-right"); - pageSeparator.appendChild(document.createTextNode("...")) - pageNumbers.appendChild(pageSeparator); - - var pageLink = createPageLink(page.total - 1); - pageNumbers.appendChild(pageLink); - } - - if (data.length > page.rows) footer.appendChild(pageNumbers); - - var previous = document.createElement("a"); - previous.appendChild(document.createTextNode("Previous")); - previous.onclick = function() { - page.setPageNumber(page.number - 1); - renderBody(); - renderFooter(); - - triggerOnChange(); - }; - if (data.length > page.rows) footer.appendChild(previous); - - var infoLabel = document.createElement("div"); - infoLabel.setAttribute("class", "pagedtable-info"); - infoLabel.setAttribute("title", getLabelInfo()); - infoLabel.appendChild(document.createTextNode(getLabelInfo())); - footer.appendChild(infoLabel); - - var enabledClass = "pagedtable-index-nav"; - var disabledClass = "pagedtable-index-nav pagedtable-index-nav-disabled"; - previous.setAttribute("class", page.number <= 0 ? disabledClass : enabledClass); - next.setAttribute("class", (page.number + 1) * page.rows >= data.length ? disabledClass : enabledClass); - }; - - var measuresCell = null; - - var renderMeasures = function() { - var measuresTable = document.createElement("table"); - measuresTable.style.visibility = "hidden"; - measuresTable.style.position = "absolute"; - measuresTable.style.whiteSpace = "nowrap"; - measuresTable.style.height = "auto"; - measuresTable.style.width = "auto"; - - var measuresRow = document.createElement("tr"); - measuresTable.appendChild(measuresRow); - - measuresCell = document.createElement("td"); - var sampleString = "ABCDEFGHIJ0123456789"; - measuresCell.appendChild(document.createTextNode(sampleString)); - - measuresRow.appendChild(measuresCell); - - tableDiv.appendChild(measuresTable); - } - - me.init = function() { - tableDiv = document.createElement("div"); - pagedTable.appendChild(tableDiv); - var pagedTableClass = data.length > 0 ? - "pagedtable pagedtable-not-empty" : - "pagedtable pagedtable-empty"; - - if (columns.total == 0 || (columns.emptyNames() && data.length == 0)) { - pagedTableClass = pagedTableClass + " pagedtable-empty-columns"; - } - - tableDiv.setAttribute("class", pagedTableClass); - - renderMeasures(); - measurer.calculate(measuresCell); - columns.calculateWidths(measurer.measures); - - table = document.createElement("table"); - table.setAttribute("cellspacing", "0"); - table.setAttribute("class", "table table-condensed"); - tableDiv.appendChild(table); - - table.appendChild(document.createElement("thead")); - - var footerDiv = document.createElement("div"); - footerDiv.setAttribute("class", "pagedtable-footer"); - tableDiv.appendChild(footerDiv); - - // if the host has not yet provided horizontal space, render hidden - if (tableDiv.clientWidth <= 0) { - tableDiv.style.opacity = "0"; - } - - me.render(); - - // retry seizing columns later if the host has not provided space - function retryFit() { - if (tableDiv.clientWidth <= 0) { - setTimeout(retryFit, 100); - } else { - me.render(); - triggerOnChange(); - } - } - if (tableDiv.clientWidth <= 0) { - retryFit(); - } - }; - - var registerWidths = function() { - columns.subset = columns.subset.map(function(column) { - column.width = columns.widths[column.name].inner; - return column; - }); - }; - - var parsePadding = function(value) { - return parseInt(value) >= 0 ? parseInt(value) : 0; - }; - - me.fixedHeight = function() { - return options.rows.max != null; - } - - me.fitRows = function() { - if (me.fixedHeight()) - return; - - measurer.calculate(measuresCell); - - var rows = options.rows.min !== null ? options.rows.min : 0; - var headerHeight = header !== null && header.offsetHeight > 0 ? header.offsetHeight : 0; - var footerHeight = footer !== null && footer.offsetHeight > 0 ? footer.offsetHeight : 0; - - if (pagedTable.offsetHeight > 0) { - var availableHeight = pagedTable.offsetHeight - headerHeight - footerHeight; - rows = Math.floor((availableHeight) / measurer.measures.height); - } - - rows = options.rows.min !== null ? Math.max(options.rows.min, rows) : rows; - - page.setRows(rows); - } - - // The goal of this function is to add as many columns as possible - // starting from left-to-right, when the right most limit is reached - // it tries to add columns from the left as well. - // - // When startBackwards is true columns are added from right-to-left - me.fitColumns = function(startBackwards) { - measurer.calculate(measuresCell); - columns.calculateWidths(measurer.measures); - - if (tableDiv.clientWidth > 0) { - tableDiv.style.opacity = 1; - } - - var visibleColumns = tableDiv.clientWidth <= 0 ? Math.max(columns.min, 1) : 1; - var columnNumber = columns.number; - var paddingCount = 0; - - // track a list of added columns as we build the visible ones to allow us - // to remove columns when they don't fit anymore. - var columnHistory = []; - - var lastTableHeight = 0; - var backwards = startBackwards; - - var tableDivStyle = window.getComputedStyle(tableDiv, null); - var tableDivPadding = parsePadding(tableDivStyle.paddingLeft) + - parsePadding(tableDivStyle.paddingRight); - - var addPaddingCol = false; - var currentWidth = 0; - - while (true) { - columns.setVisibleColumns(columnNumber, visibleColumns, paddingCount); - currentWidth = columns.getWidth(); - - if (tableDiv.clientWidth - tableDivPadding < currentWidth) { - break; - } - - columnHistory.push({ - columnNumber: columnNumber, - visibleColumns: visibleColumns, - paddingCount: paddingCount - }); - - if (columnHistory.length > 100) { - console.error("More than 100 tries to fit columns, aborting"); - break; - } - - if (columns.max !== null && - columns.visible + columns.getPaddingCount() >= columns.max) { - break; - } - - // if we run out of right-columns - if (!backwards && columnNumber + columns.visible >= columns.total) { - // if we started adding right-columns, try adding left-columns - if (!startBackwards && columnNumber > 0) { - backwards = true; - } - else if (columns.min === null || visibleColumns + columns.getPaddingCount() >= columns.min) { - break; - } - else { - paddingCount = paddingCount + 1; - } - } - - // if we run out of left-columns - if (backwards && columnNumber == 0) { - // if we started adding left-columns, try adding right-columns - if (startBackwards && columnNumber + columns.visible < columns.total) { - backwards = false; - } - else if (columns.min === null || visibleColumns + columns.getPaddingCount() >= columns.min) { - break; - } - else { - paddingCount = paddingCount + 1; - } - } - - // when moving backwards try fitting left columns first - if (backwards && columnNumber > 0) { - columnNumber = columnNumber - 1; - } - - if (columnNumber + visibleColumns < columns.total) { - visibleColumns = visibleColumns + 1; - } - } - - var lastRenderableColumn = { - columnNumber: columnNumber, - visibleColumns: visibleColumns, - paddingCount: paddingCount - }; - - if (columnHistory.length > 0) { - lastRenderableColumn = columnHistory[columnHistory.length - 1]; - } - - columns.setVisibleColumns( - lastRenderableColumn.columnNumber, - lastRenderableColumn.visibleColumns, - lastRenderableColumn.paddingCount); - - if (pagedTable.offsetWidth > 0) { - page.setVisiblePages(Math.max(Math.ceil(1.0 * (pagedTable.offsetWidth - 250) / 40), 2)); - } - - registerWidths(); - }; - - me.fit = function(startBackwards) { - me.fitRows(); - me.fitColumns(startBackwards); - } - - me.render = function() { - me.fitColumns(false); - - // render header/footer to measure height accurately - renderHeader(); - renderFooter(); - - me.fitRows(); - renderBody(); - - // re-render footer to match new rows - renderFooter(); - } - - var resizeLastWidth = -1; - var resizeLastHeight = -1; - var resizeNewWidth = -1; - var resizeNewHeight = -1; - var resizePending = false; - - me.resize = function(newWidth, newHeight) { - - function resizeDelayed() { - resizePending = false; - - if ( - (resizeNewWidth !== resizeLastWidth) || - (!me.fixedHeight() && resizeNewHeight !== resizeLastHeight) - ) { - resizeLastWidth = resizeNewWidth; - resizeLastHeight = resizeNewHeight; - - setTimeout(resizeDelayed, 200); - resizePending = true; - } else { - me.render(); - triggerOnChange(); - - resizeLastWidth = -1; - resizeLastHeight = -1; - } - } - - resizeNewWidth = newWidth; - resizeNewHeight = newHeight; - - if (!resizePending) resizeDelayed(); - }; -}; - -var PagedTableDoc; -(function (PagedTableDoc) { - var allPagedTables = []; - - PagedTableDoc.initAll = function() { - allPagedTables = []; - - var pagedTables = [].slice.call(document.querySelectorAll('[data-pagedtable="false"],[data-pagedtable=""]')); - pagedTables.forEach(function(pagedTable, idx) { - pagedTable.setAttribute("data-pagedtable", "true"); - pagedTable.setAttribute("pagedtable-page", 0); - pagedTable.setAttribute("class", "pagedtable-wrapper"); - - var pagedTableInstance = new PagedTable(pagedTable); - pagedTableInstance.init(); - - allPagedTables.push(pagedTableInstance); - }); - }; - - PagedTableDoc.resizeAll = function() { - allPagedTables.forEach(function(pagedTable) { - pagedTable.render(); - }); - }; - - window.addEventListener("resize", PagedTableDoc.resizeAll); - - return PagedTableDoc; -})(PagedTableDoc || (PagedTableDoc = {})); - -window.onload = function() { - PagedTableDoc.initAll(); -}; diff --git a/docs/authors.html b/docs/authors.html deleted file mode 100644 index 6eead4c..0000000 --- a/docs/authors.html +++ /dev/null @@ -1,99 +0,0 @@ - -Authors and Citation • leapR - Skip to contents - - -
-
-
- -
-

Authors

- -
  • -

    Sara Gosline. Author, maintainer. -

    -
  • -
  • -

    Jason McDermott. Author. -

    -
  • -
  • -

    Jeremy Jacobson. Author. -

    -
  • -
  • -

    Vincent Danna. Contributor. -

    -
  • -
  • -

    National Institutes of Health. Funder. -

    -
  • -
- -
-

Citation

-

- -

Gosline S, McDermott J, Jacobson J (2026). -leapR: Layered enrichment analysis of pathways R. -R package version 0.99.7. -

-
@Manual{,
-  title = {leapR: Layered enrichment analysis of pathways R},
-  author = {Sara Gosline and Jason McDermott and Jeremy Jacobson},
-  year = {2026},
-  note = {R package version 0.99.7},
-}
-
- -
- - -
- - - - - - - diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 72b8497..0000000 --- a/docs/index.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - -Layered enrichment analysis of pathways R • leapR - - - - - - - - - - Skip to contents - - -
-
-
- -

Layered Enrichment Analysis of Pathways in R (leapR) a tool that carries out statistical enrichment analysis on single- or multi-omics data.

-
-

Install -

-

leapR is available through Bioconductor repository here

-
if (!require("BiocManager", quietly = TRUE))
-    install.packages("BiocManager")
-BiocManager::install(version = "3.21")
-BiocManager::install('BiocStyle')
-BiocManager::install('leapR')
-

Once you have successfully installed the package you can load the vignette to read examples using the vignette('leapR') command.

-
-
-

Basic Usage -

-

The primary function of the leapR package is the leapR function itself. This function serves a wrapper to run different styles of enrichment functions on the data. The package contains other functions to support pathway information and multi-omics datasets.

-
-

Enrichment calls -

-

Here is a list of enrichment arguments that can be called with the leapR command.

- ---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ArgumentDescription
enrichment_in_setsCalculates enrichment in pathway membership in a list (e.g. highly differential proteins) relative to background using Fisher’s exact test.
enrichment_in_orderCalculates enrichment of pathways based on a ranked list using the Kolmogorov-Smirnov test
enrichment_comparisonCompares the distribution of abundances between two sets of conditions for each pathway using a t test
enrichment_in_pathwaysCompares the distribution of abundances in a pathway with the background distribution of abundances using a t test
correlation_enrichmentCalculates the enrichment of a pathway based on correlation between pathway members across conditions versus correlation between members not in the pathway
enrichment_in_relationshipsCalculates the enrichment of a pathway in specified interactions relative to non-pathway members
-
-
-

Data examples -

-

We included examples of including proteomics data and transcriptomics data from 169 high-grade serous ovarian cancer (HGSOC) tumors previously studied and lists of the short- and long- surviving patients from that cohort.

-
-
-

Gene pathway examples -

-

We included two different gene pathways. An NCI pathway database (Pathway Information Database; PID) of signaling pathways and the MSIGDB set of gene collections from various sources.

-
-
-
-
-
- - - -
- - - - - - - diff --git a/docs/link.svg b/docs/link.svg deleted file mode 100644 index 88ad827..0000000 --- a/docs/link.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/docs/pkgdown.js b/docs/pkgdown.js deleted file mode 100644 index 0a5573a..0000000 --- a/docs/pkgdown.js +++ /dev/null @@ -1,162 +0,0 @@ -/* http://gregfranko.com/blog/jquery-best-practices/ */ -(function ($) { - $(function () { - - $('nav.navbar').headroom(); - - Toc.init({ - $nav: $("#toc"), - $scope: $("main h2, main h3, main h4, main h5, main h6") - }); - - if ($('#toc').length) { - $('body').scrollspy({ - target: '#toc', - offset: $("nav.navbar").outerHeight() + 1 - }); - } - - // Activate popovers - $('[data-bs-toggle="popover"]').popover({ - container: 'body', - html: true, - trigger: 'focus', - placement: "top", - sanitize: false, - }); - - $('[data-bs-toggle="tooltip"]').tooltip(); - - /* Clipboard --------------------------*/ - - function changeTooltipMessage(element, msg) { - var tooltipOriginalTitle = element.getAttribute('data-bs-original-title'); - element.setAttribute('data-bs-original-title', msg); - $(element).tooltip('show'); - element.setAttribute('data-bs-original-title', tooltipOriginalTitle); - } - - if (ClipboardJS.isSupported()) { - $(document).ready(function () { - var copyButton = ""; - - $("div.sourceCode").addClass("hasCopyButton"); - - // Insert copy buttons: - $(copyButton).prependTo(".hasCopyButton"); - - // Initialize tooltips: - $('.btn-copy-ex').tooltip({ container: 'body' }); - - // Initialize clipboard: - var clipboard = new ClipboardJS('[data-clipboard-copy]', { - text: function (trigger) { - return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); - } - }); - - clipboard.on('success', function (e) { - changeTooltipMessage(e.trigger, 'Copied!'); - e.clearSelection(); - }); - - clipboard.on('error', function (e) { - changeTooltipMessage(e.trigger, 'Press Ctrl+C or Command+C to copy'); - }); - - }); - } - - /* Search marking --------------------------*/ - var url = new URL(window.location.href); - var toMark = url.searchParams.get("q"); - var mark = new Mark("main#main"); - if (toMark) { - mark.mark(toMark, { - accuracy: { - value: "complementary", - limiters: [",", ".", ":", "/"], - } - }); - } - - /* Search --------------------------*/ - /* Adapted from https://github.com/rstudio/bookdown/blob/2d692ba4b61f1e466c92e78fd712b0ab08c11d31/inst/resources/bs4_book/bs4_book.js#L25 */ - // Initialise search index on focus - var fuse; - $("#search-input").focus(async function (e) { - if (fuse) { - return; - } - - $(e.target).addClass("loading"); - var response = await fetch($("#search-input").data("search-index")); - var data = await response.json(); - - var options = { - keys: ["what", "text", "code"], - ignoreLocation: true, - threshold: 0.1, - includeMatches: true, - includeScore: true, - }; - fuse = new Fuse(data, options); - - $(e.target).removeClass("loading"); - }); - - // Use algolia autocomplete - var options = { - autoselect: true, - debug: true, - hint: false, - minLength: 2, - }; - var q; - async function searchFuse(query, callback) { - await fuse; - - var items; - if (!fuse) { - items = []; - } else { - q = query; - var results = fuse.search(query, { limit: 20 }); - items = results - .filter((x) => x.score <= 0.75) - .map((x) => x.item); - if (items.length === 0) { - items = [{ dir: "Sorry 😿", previous_headings: "", title: "No results found.", what: "No results found.", path: window.location.href }]; - } - } - callback(items); - } - $("#search-input").autocomplete(options, [ - { - name: "content", - source: searchFuse, - templates: { - suggestion: (s) => { - if (s.title == s.what) { - return `${s.dir} >
${s.title}
`; - } else if (s.previous_headings == "") { - return `${s.dir} >
${s.title}
> ${s.what}`; - } else { - return `${s.dir} >
${s.title}
> ${s.previous_headings} > ${s.what}`; - } - }, - }, - }, - ]).on('autocomplete:selected', function (event, s) { - window.location.href = s.path + "?q=" + q + "#" + s.id; - }); - }); -})(window.jQuery || window.$) - -document.addEventListener('keydown', function (event) { - // Check if the pressed key is '/' - if (event.key === '/') { - event.preventDefault(); // Prevent any default action associated with the '/' key - document.getElementById('search-input').focus(); // Set focus to the search input - } -}); diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml deleted file mode 100644 index 78646a0..0000000 --- a/docs/pkgdown.yml +++ /dev/null @@ -1,11 +0,0 @@ -pandoc: 3.7.0.2 -pkgdown: 2.2.0 -pkgdown_sha: ~ -articles: - examples: examples.html - leapR: leapR.html - order-enrichment: order-enrichment.html -last_built: 2026-02-11T18:27Z -urls: - reference: https://pnnl-github.io/leapR/reference - article: https://pnnl-github.io/leapR/articles diff --git a/docs/reference/calcTTest.html b/docs/reference/calcTTest.html deleted file mode 100644 index 6028732..0000000 --- a/docs/reference/calcTTest.html +++ /dev/null @@ -1,127 +0,0 @@ - -calcTTest — calcTTest • leapR - Skip to contents - - -
-
-
- -
-

calculates a t-test for two distributions of data on a per-gene basis -append results to ExpressionSet with two extra columns: `pvalue` and -`difference` for each feature

-
- -
-

Usage

-
calcTTest(eset, assay_name, group1, group2)
-
- -
-

Arguments

- - -
eset
-

SummarizedExperiment

- - -
assay_name
-

name of assay

- - -
group1
-

List of samples comprising group 1

- - -
group2
-

List of samples comprising group 2

- -
-
-

Value

-

An Expression set with two columns added to the featureData -slot: pvalue, and estimate

-
- -
-

Examples

-

-        library(leapR)
-        url <- "https://api.figshare.com/v2/file/download/56536214"
-        tdata <- download.file(url,method='libcurl',destfile='transData.rda')
-        load('transData.rda')
-        p <- file.remove("transData.rda")
-
-        # read in the pathways
-        data("ncipid")
-
-        # read in the patient groups
-        data("shortlist")
-        data("longlist")
-        calcTTest(tset, 'transcriptomics', shortlist, longlist)
-#> class: SummarizedExperiment 
-#> dim: 1999 174 
-#> metadata(0):
-#> assays(1): transcriptomics
-#> rownames(1999): NOC2L ISG15 ... ARL6 MINA
-#> rowData names(2): pvalue difference
-#> colnames(174): TCGA-13-1484 TCGA-13-1495 ... TCGA-61-1995 TCGA-61-2008
-#> colData names(0):
-
-
-
- - -
- - - - - - - diff --git a/docs/reference/cluster_enrichment.html b/docs/reference/cluster_enrichment.html deleted file mode 100644 index 2df9b6d..0000000 --- a/docs/reference/cluster_enrichment.html +++ /dev/null @@ -1,144 +0,0 @@ - -cluster_enrichment — cluster_enrichment • leapR - Skip to contents - - -
-
-
- -
-

Cluster enrichment Run enrichment (Fisher's exact) on clusters (lists of -identifier groups)

-
- -
-

Usage

-
cluster_enrichment(eset, assay_name, geneset, clusters, sigfilter = 0.05)
-
- -
-

Arguments

- - -
eset
-

is an SummarizedExperiment containing data that is clustered

- - -
assay_name
-

is the name of the assay

- - -
geneset
-

is a GeneSet object for pathway annotation

- - -
clusters
-

is a list of clusters (gene lists) to calculate enrichment -on, generally the result of the `cutree` function

- - -
sigfilter
-

minimum significance threshold default is .05

- -
-
-

Value

-

data frame with enrichment results

-
-
-

Details

-

This function will calculate enrichment (Fisher's exact test for - membership overlap) on

-

a series of lists of genes, such as from a set of clusters. The -results are returned as

-

a list of results matrices in the order of the input clusters.

-
- -
-

Examples

-
        library(leapR)
-
-        # read in the example transcriptomic data
-        url <- "https://api.figshare.com/v2/file/download/56536214"
-        tdata <- download.file(url,method='libcurl',destfile='transData.rda')
-        load('transData.rda')
-        p <- file.remove("transData.rda")
-
-        # read in the pathways
-        data("ncipid")
-
-        # for the example we will limit the number of transcripts considered
-        #- arbitrarily in this case
-        transdata <- SummarizedExperiment::assay(tset,'transcriptomics')
-        transdata[which(is.na(transdata),arr.ind=TRUE)]<-0.0
-        # perform heirarchical clustering on the  data
-        transdata.hc <- hclust(dist(transdata), method="ward.D2")
-
-        transdata.hc.clusters <- cutree(transdata.hc, k=5)
-        clust.list <- lapply(seq_len(5), function(x) {
-           return(names(which(transdata.hc.clusters==x)))})
-        #calculates enrichment for each of the clusters individually a
-        #and returns a list of enrichment results
-        transdata.hc.enrichment <- leapR::cluster_enrichment(eset=tset,
-                assay_name='transcriptomics',
-                geneset=ncipid,
-                clusters=clust.list)
-
-
-
-
-
-
- - -
- - - - - - - diff --git a/docs/reference/combine_omics.html b/docs/reference/combine_omics.html deleted file mode 100644 index dd852c2..0000000 --- a/docs/reference/combine_omics.html +++ /dev/null @@ -1,130 +0,0 @@ - -combine_omics Combine two or more omics matrices into one multi-omics matrix with 'tagged' ids. — combine_omics • leapR - Skip to contents - - -
-
-
- -
-

combine_omics -Combine two or more omics matrices into one multi-omics matrix with -'tagged' ids.

-
- -
-

Usage

-
combine_omics(omics_list, id_list = rep(NA, length(omics_list)))
-
- -
-

Arguments

- - -
omics_list
-

Is a list of SummarizedExperiment each with -one assay

- - -
id_list
-

List of identifiers to use, in the same order as the -omics_list elements. If an element -is `NA`, then rownames are used.

- -
-
-

Value

-

SummarizedExperiment with an additional assay called - `combined`

-
-
-

Details

-

This combines matrices of different omics types together and -adds prefix tags to the ids.

-
- -
-

Examples

-
        library(leapR)
-        url <- 'https://api.figshare.com/v2/file/download/56536217'
-
-        pdata <- download.file(url,method='libcurl',destfile='protData.rda')
-        load('protData.rda')
-        p <- file.remove("protData.rda")
-
-        url <- "https://api.figshare.com/v2/file/download/56536214"
-        tdata <- download.file(url,method='libcurl',destfile='transData.rda')
-        load('transData.rda')
-        p <- file.remove("transData.rda")
-
-        url <- 'https://api.figshare.com/v2/file/download/56536211'
-        phdata<-download.file(url,method='libcurl',destfile = 'phosData.rda')
-        #phosphodata<-read.csv("phdata",check.names=FALSE,row.names=1)
-        load('phosData.rda')
-        p <- file.remove('phosData.rda')# read in the example protein data
-
-
-        # merge the three datasets by rows and add prefix tags for
-        # different omics types
-        multi_omics <- combine_omics(list(pset, tset, phset),
-                    list(NA,NA,'hgnc_id'))
-
-
-
-
-
- - -
- - - - - - - diff --git a/docs/reference/correlation_comparison_enrichment.html b/docs/reference/correlation_comparison_enrichment.html deleted file mode 100644 index a873852..0000000 --- a/docs/reference/correlation_comparison_enrichment.html +++ /dev/null @@ -1,115 +0,0 @@ - -correlation_comparison_enrichment — correlation_comparison_enrichment • leapR - Skip to contents - - -
-
-
- -
-

# internal function to calculate enrichment in differences in correlation -# between two groups -# access through the leapr wrapper

-
- -
-

Usage

-
correlation_comparison_enrichment(
-  geneset,
-  eset,
-  assay_name,
-  set1,
-  set2,
-  mapping_column = NA
-)
-
- -
-

Arguments

- - -
geneset
-

pathway to use for enrichment

- - -
eset
-

SummarizedExperiment with abundance matrix

- - -
assay_name
-

name of assay

- - -
set1
-

first set to use

- - -
set2
-

second set to use

- - -
mapping_column
-

Column to use for id mapping within rowData

- -
-
-

Value

-

data frame with enrichment results

-
- -
- - -
- - - - - - - diff --git a/docs/reference/correlation_enrichment.html b/docs/reference/correlation_enrichment.html deleted file mode 100644 index 7d70347..0000000 --- a/docs/reference/correlation_enrichment.html +++ /dev/null @@ -1,97 +0,0 @@ - -correlation_enrichment — correlation_enrichment • leapR - Skip to contents - - -
-
-
- -
-

# calculate enrichment in correlation between pathway members -# access through leapr wrapper

-
- -
-

Usage

-
correlation_enrichment(geneset, eset, assay_name, mapping_column = NA)
-
- -
-

Arguments

- - -
geneset
-

Geneset list

- - -
eset
-

a SummarizedExperiment object

- - -
assay_name
-

name of assay

- - -
mapping_column
-

Column to use to map identifiers, if not rownames

- -
-
-

Value

-

list of enrichment statistic table and correlation matrix

-
- -
- - -
- - - - - - - diff --git a/docs/reference/enrichment_in_abundance.html b/docs/reference/enrichment_in_abundance.html deleted file mode 100644 index f77a424..0000000 --- a/docs/reference/enrichment_in_abundance.html +++ /dev/null @@ -1,138 +0,0 @@ - -enrichment_in_abundance — enrichment_in_abundance • leapR - Skip to contents - - -
-
-
- -
-

Enrichment in abundance calculates enrichment in pathways by the difference -in abundance of the pathway members.

-
- -
-

Usage

-
enrichment_in_abundance(
-  geneset,
-  eset,
-  assay_name,
-  mapping_column = NULL,
-  abundance_column = NULL,
-  fdr = 0,
-  matchset = NULL,
-  sample_comparison = NULL,
-  min_p_threshold = NULL,
-  sample_n = NULL,
-  silence_try_errors = TRUE
-)
-
- -
-

Arguments

- - -
geneset
-

Gene set to calculate enrichment

- - -
eset
-

Molecular abundance data in `SummarizedExperiment` format

- - -
assay_name
-

Name of assay to compare

- - -
mapping_column
-

Column to use to map identifiers

- - -
abundance_column
-

Columns to use to quantify abundance

- - -
fdr
-

number of times to sample for FDR value

- - -
matchset
-

Name of a set to use for enrichment

- - -
sample_comparison
-

list of samples to use as comparison. if missing -background (eset) is used

- - -
min_p_threshold
-

Only include p-values lower than this

- - -
sample_n
-

size of sample to use

- - -
silence_try_errors
-

set to true to silence try errors

- -
-
-

Value

-

data frame of enrichment result

-
- -
- - -
- - - - - - - diff --git a/docs/reference/enrichment_in_groups.html b/docs/reference/enrichment_in_groups.html deleted file mode 100644 index 1d7ccff..0000000 --- a/docs/reference/enrichment_in_groups.html +++ /dev/null @@ -1,139 +0,0 @@ - -enrichment_in_groups — enrichment_in_groups • leapR - Skip to contents - - -
-
-
- -
-

Calculate the enrichment in pathways using Fisher's exact or -Kolmogorov-Smirnov test, using either the abundance column to identify -feature or the targets list. access through leapr wrapper

-
- -
-

Usage

-
enrichment_in_groups(
-  geneset,
-  targets = c(),
-  background = NULL,
-  assay_name = NULL,
-  method = "fishers",
-  minsize = 5,
-  mapping_column = NULL,
-  abundance_column = NULL,
-  randomize = FALSE,
-  silence_try_errors = TRUE
-)
-
- -
-

Arguments

- - -
geneset
-

geneset to use for enrichment

- - -
targets
-

targets to use for enrichment

- - -
background
-

`SummarizedExperiment` describing background to use

- - -
assay_name
-

is the name of the assay to use from the background

- - -
method
-

method to use for statistical test, options are -'fishers', 'ks', 'ztest', or 'chisq'. Remember that KS test assumes normality, so it would be good -to log your data before calling. NOTE: if you do not call `suppressWarnings` then -the KS test will warn you about ties.

- - -
minsize
-

minimum size of set

- - -
mapping_column
-

column name of mapping identifiers

- - -
abundance_column
-

columns mapping abundance, either in the `assay` -matrix or `rowData`

- - -
randomize
-

true/false whether to randomize

- - -
silence_try_errors
-

true/false to silence errors

- -
-
-

Value

-

data frame with enrichment results

-
- -
- - -
- - - - - - - diff --git a/docs/reference/enrichment_in_relationships.html b/docs/reference/enrichment_in_relationships.html deleted file mode 100644 index 72d95d7..0000000 --- a/docs/reference/enrichment_in_relationships.html +++ /dev/null @@ -1,109 +0,0 @@ - -enrichment_in_relationships — enrichment_in_relationships • leapR - Skip to contents - - -
-
-
- -
-

enrichment_in_relationships function description is a general way to -determine if a pathway -is enriched in relationships (interactions, correlation) between its members -# access through leapr wrapper

-
- -
-

Usage

-
enrichment_in_relationships(
-  geneset,
-  relationships,
-  idmap = NA,
-  silence_try_errors = TRUE
-)
-
- -
-

Arguments

- - -
geneset
-

List of pathways in gmt format

- - -
relationships
-

table of relationship information, e.g. correlation

- - -
idmap
-

list of identifiers to use for mapping, the names of the items -should agree with names of features in matrix

- - -
silence_try_errors
-

boolean to silence errors

- -
-
-

Value

-

table of enrichment statistics

-
- -
- - -
- - - - - - - diff --git a/docs/reference/get_pathway_information.html b/docs/reference/get_pathway_information.html deleted file mode 100644 index 23fa80f..0000000 --- a/docs/reference/get_pathway_information.html +++ /dev/null @@ -1,106 +0,0 @@ - -get_pathway_information — get_pathway_information • leapR - Skip to contents - - -
-
-
- -
-

get_pathway_information extracts information about a pathway from a -GeneSet object

-
- -
-

Usage

-
get_pathway_information(geneset, path, remove.tags = FALSE)
-
- -
-

Arguments

- - -
geneset
-

is a GeneSet object for pathway annotation

- - -
path
-

is the name of the gene set pathway to be return

- - -
remove.tags
-

boolean indicating whether to remove tags

- -
-
-

Value

-

list of pathway information

-
- -
-

Examples

-

-     library(leapR)
-
-     # load example gene set
-     data("ncipid")
-
-     tnfpathway = get_pathway_information(ncipid, "tnfpathway")
-
-
-
-
-
- - -
- - - - - - - diff --git a/docs/reference/index.html b/docs/reference/index.html deleted file mode 100644 index 1578a2b..0000000 --- a/docs/reference/index.html +++ /dev/null @@ -1,186 +0,0 @@ - -Package index • leapR - Skip to contents - - -
-
-
- -
-

All functions

- - - -
- - - - -
- - calcTTest() - -
-
calcTTest
- -
- - cluster_enrichment() - -
-
cluster_enrichment
- -
- - combine_omics() - -
-
combine_omics Combine two or more omics matrices into one multi-omics matrix with 'tagged' ids.
- -
- - correlation_comparison_enrichment() - -
-
correlation_comparison_enrichment
- -
- - correlation_enrichment() - -
-
correlation_enrichment
- -
- - enrichment_in_abundance() - -
-
enrichment_in_abundance
- -
- - enrichment_in_groups() - -
-
enrichment_in_groups
- -
- - enrichment_in_relationships() - -
-
enrichment_in_relationships
- -
- - get_pathway_information() - -
-
get_pathway_information
- -
- - kinasesubstrates - -
-
Kinase substrate lists
- -
- - krbpaths - -
-
KEGG, Reactome, BioCarta Pathways
- -
- - leapR() - -
-
leapR
- -
- - longlist - -
-
Long list of patient samples
- -
- - ncipid - -
-
NCI Gene lists
- -
- - plot_leapr_bar() - -
-
Plot leapR pathway bars (single panel)
- -
- - read_gene_sets() - -
-
read_gene_sets
- -
- - shortlist - -
-
A list of pathways and genes that comprise these pathways from msigdb
-
-
- - -
- - - - - - - diff --git a/docs/reference/kinasesubstrates.html b/docs/reference/kinasesubstrates.html deleted file mode 100644 index e88b2c8..0000000 --- a/docs/reference/kinasesubstrates.html +++ /dev/null @@ -1,90 +0,0 @@ - -Kinase substrate lists — kinasesubstrates • leapR - Skip to contents - - -
-
-
- -
-

Kinase substrate lists

-
- -
-

Usage

-
kinasesubstrates
-
- -
-

Format

-

A list with 4 items

names
-

The names of the kinases

- -
desc
-

Short description of the kinase

- -
sizes
-

Length of the substrate list

- -
matrix
-

Substrate list for the kinase

- - -
-
-

Source

-

PhosphositePlus

-
- -
- - -
- - - - - - - diff --git a/docs/reference/krbpaths.html b/docs/reference/krbpaths.html deleted file mode 100644 index dab0ecd..0000000 --- a/docs/reference/krbpaths.html +++ /dev/null @@ -1,90 +0,0 @@ - -KEGG, Reactome, BioCarta Pathways — krbpaths • leapR - Skip to contents - - -
-
-
- -
-

KEGG, Reactome, BioCarta Pathways

-
- -
-

Usage

-
krbpaths
-
- -
-

Format

-

A list with 4 items

names
-

The names of the pathways

- -
desc
-

Short description of the pathways

- -
sizes
-

Number of genes in the signaling pathways

- -
matrix
-

Matrix containing the genes in the pathways

- - -
-
-

Source

-

https://www.gsea-msigdb.org/gsea/msigdb_license_terms.jsp

-
- -
- - -
- - - - - - - diff --git a/docs/reference/leapR-package.html b/docs/reference/leapR-package.html deleted file mode 100644 index 46b684b..0000000 --- a/docs/reference/leapR-package.html +++ /dev/null @@ -1,72 +0,0 @@ - -leapR: Layered enrichment analysis of pathways R — leapR-package • leapR - Skip to contents - - -
-
-
- -
-

leapR is a package that identifies pathways that are enriched across diverse 'omics experiments. It leverages any tabular expression data (proteomics, transcriptomics) using the `SummarizedExperiment` object. It works with any pathway in the .gct file format.

-
- - -
-

Author

-

Maintainer: Sara Gosline sara.gosline@pnnl.gov (ORCID)

-

Authors:

Other contributors:

- -
- - -
- - - - - - - diff --git a/docs/reference/leapR.html b/docs/reference/leapR.html deleted file mode 100644 index 250cc59..0000000 --- a/docs/reference/leapR.html +++ /dev/null @@ -1,317 +0,0 @@ - -leapR — leapR • leapR - Skip to contents - - -
-
-
- -
-

leapR is a wrapper function that consolidates multiple enrichment methods.

-
- -
-

Usage

-
leapR(geneset, enrichment_method, eset, assay_name, ...)
-
- -
-

Arguments

- - -
geneset
-

is a list of four vectors, gene names, gene descriptions, gene -sizes and a matrix of genes. It represents .gmt format pathway files.

- - -
enrichment_method
-

is a character string specifying the method of -enrichment to be performed, one of: "enrichment_comparison", -"enrichment_in_order", "enrichment_in_sets", "enrichment_in_pathway", -"correlation_enrichment".

- - -
eset
-

is a `SummarizedExperiment` object containing expression data, -with features as rows and n sample/conditions as columns.

- - -
assay_name
-

is the assay to be analyzed within the `eset`. -Recommended to describe the data type (e.g. transcriptomics, proteomics) -so that it can be integrated in `combine_omics`

- - -
...
-

further arguments

- -
-
-

Value

-

data frame with results

-
-
-

Details

-

Further arguments and enrichment method optional argument information:

id_columnIs a character string, present in the rowData slot, -that is used to specify a column for identifiers to map to enrichment -libraries. -If missing, the rownames of the SummarizedExperiment assay will be used.
primary_columnsIs a character vector composed of column names from -eset (either in the `assay` or in the `rowData`), -that specifies a set of primary columns to calculate enrichment on. -The meaning of this varies according to the enrichment method used - see -the descriptions for each method below. -This is an optional argument used with 'enrichment_in_order', -'enrichment_in_sets', and 'enrichment_comparison' methods.
secondary_columns
Is a character vector of column names for comparison, -pulled from the `assay` of the SummarizedExperiment. This is an -optional argument used with 'enrichment_comparison' methods.
thresholdIs a numeric value, an optional argument used with -'enrichment_in sets' method which filters out abundance values or p-values -(depending on what `primary_columns` is used) -either above or below it.
greaterthan
Is a logical value that defaults to TRUE, it's used with -'enrichment_in_sets' method. -When set to TRUE, genes with `primary_columns` value above the -threshold argument are kept. -When set to FALSE genes with `primary_columns` value below the -threshold argument are kept. -This is an optional argument used with 'enrichment_in_sets' method.
minsizeIs a numeric value, an optional argument used with -'enrichment_in_sets' and 'enrichment_in_order".
fdr
A numerical value which specifies how many times to randomly -sample genes to calculate an empirical false discovery rate, is an optional -argument used with 'enrichment_comparison' method.
min_p_thresholdIs a numeric value, a lower p-value threshold and is an -optional argument used with 'enrichment_comparison' method.
sample_n
Is a way to subsample the number of components considered for -each calculation randomly. This is an optional argument used with -'enrichment_comparison' method.

Enrichment Methods: -

-enrichment_comparison -
-Compares the distribution of abundances between two sets of -conditions for each pathway using a t test. For each pathway in -geneset uses a t test to compare the distribution of abundance -values/numbers in eset primary_columns with those in -eset secondary_columns. Lower p-values for pathways indicate -that the expression of the pathway is significantly different between the -set of conditions in primary_columns and the set of conditions in -secondary_columns. -Optionally, users can specify fdr which will calculate an empirical -p-value by randomizing abundances fdr number of times. If the -min_p_threshold is specified the method will only return pathways -with an adjusted p-value lower than the specified threshold. If -sample_n is specified the method will subsample the -pathway members to the specified number of components. -

-enrichment_in_order -
-Calculates enrichment of pathways based on a ranked list using the -Kolmogorov-Smirnov test. For each pathway in geneset uses a -Kolmogorov-Smirnov test for rank order to test if the distribution of ranked -abundance values in the eset primary_columns is significant -relative to a random distribution. Note that currently -primary_columns only accepts a single column for this method. -

-enrichment_in_sets -
-Calculates enrichment in pathway membership in a list (e.g. highly -differential proteins) relative to background using Fisher's exact test. For -each pathway in geneset uses a Fisher's exact test over- or under- -representation of a list of components specified. If targets are -specified this must be a vector of identifiers to serve as the target list -for comparison. If eset and primary_columns are specified then -threshold specifies a threshold value for determining the target list -of components to test. Specifying greaterthan to be False -will result in components with values lower than the specified -threshold. If eset is a data frame or matrix, the background -used for calculation will be taken as the rownames of eset -

-enrichment_in_pathway -
-Compares the distribution of abundances in a pathway with the background -distribution of abundances using a t test. For each pathway in -geneset calculates the significance of the difference between the -abundances from pathway members versus abundance of non-pathway members in -the set of conditions specified by primary_columns. Optionally, users -can specify fdr which will calculate an empirical p-value by -randomizing abundances fdr number of times. If the -min_p_threshold is specified the method will only return pathways -with an adjusted p-value lower than the specified threshold. If -sample_n is specified the method will subsample the -pathway members to the specified number of components. -

-correlation_enrichment -
-Calculates the enrichment of a pathway based on correlation between pathway -members across conditions versus correlation between members not in the -pathway. For each pathway in geneset calculates the pairwise -correlation between all pathway members and non-pathway members -across the specified primary_columns conditions in eset. Note -that for large matrices this can take a long time. A p-value is calculated -based on comparing the correlation within the members of a pathway with the -correlation values between members of the pathway and non-members of the -pathway. -

-
- -
-

Examples

-
        library(leapR)
-
- # read in the example abundance data
- # read in the example transcriptomic data
- tdata <- download.file("https://api.figshare.com/v2/file/download/56536214",
-      method='libcurl',destfile='transData.rda')
- load('transData.rda')
- p <- file.remove("transData.rda")
-
- # read in the pathways
- data("ncipid")
-
- # read in the patient groups
- data("shortlist")
- data("longlist")
-
- # use enrichment_comparison to calculate enrichment in one set of
- # conditions (shortlist) and another (longlist)
- short_v_long = leapR(geneset=ncipid, assay_name='transcriptomics',
-              enrichment_method='enrichment_comparison',
-              eset=tset, primary_columns=shortlist,
-               secondary_columns=longlist)
-
- # use enrichment_in_sets to calculate the most enriched pathways
- # from the highest abundance proteins
- #     from one condition
- onept_sets = leapR(geneset=ncipid, assay_name='transcriptomics',
-               enrichment_method='enrichment_in_sets',
-               eset=tset, primary_columns="TCGA-13-1484", threshold=1.5)
-
- # use enrichment_in_order to calculate the most enriched pathways from the
- # same condition
- # Note: that this uses the entire set of abundance values and their order -
- # whereas the previous example uses a hard threshold to get a short list of
- # most abundant proteins and calculates enrichment based on set overlap.
- # The results are likely to be similar - but with some notable differences.
- onept_order = leapR(geneset=ncipid, assay_name='transcriptomics',
-               enrichment_method='enrichment_in_order',
-               eset=tset, primary_columns="TCGA-13-1484")
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-#> Warning: p-value will be approximate in the presence of ties
-
- # use enrichment_in_pathway to calculate the most enriched pathways in a
- # set of conditions based on abundance in the pathway members versus
- # abundance in non-pathway members
- short_pathways = leapR(geneset=ncipid, assay_name='transcriptomics',
-               enrichment_method='enrichment_in_pathway',
-               eset=tset, primary_columns=shortlist)
-
- # use correlation_enrichment to calculate the most enriched pathways in
- # correlation across the shortlist conditions
- short_correlation_pathways = leapR(geneset=ncipid,
-                assay_name='transcriptomics',
-                enrichment_method='correlation_enrichment',
-                eset=tset, primary_columns=shortlist)
-
-
-
-
-
- - -
- - - - - - - diff --git a/docs/reference/longlist.html b/docs/reference/longlist.html deleted file mode 100644 index a6ec82d..0000000 --- a/docs/reference/longlist.html +++ /dev/null @@ -1,74 +0,0 @@ - -Long list of patient samples — longlist • leapR - Skip to contents - - -
-
-
- -
-

Long list of patient samples

-
- -
-

Usage

-
longlist
-
- -
-

Format

-

An object of class character of length 37.

-
- -
- - -
- - - - - - - diff --git a/docs/reference/ncipid.html b/docs/reference/ncipid.html deleted file mode 100644 index fceb6c8..0000000 --- a/docs/reference/ncipid.html +++ /dev/null @@ -1,90 +0,0 @@ - -NCI Gene lists — ncipid • leapR - Skip to contents - - -
-
-
- -
-

A list of pathways and the genes that comprise these pathways

-
- -
-

Usage

-
ncipid
-
- -
-

Format

-

A list with 4 items

names
-

The names of the signaling pathways

- -
desc
-

Short description of the pathways

- -
sizes
-

Number of genes in the signaling pathways

- -
matrix
-

Matrix containing the genes in the pathways

- - -
-
-

Source

-

NCIPID

-
- -
- - -
- - - - - - - diff --git a/docs/reference/plot_leapr_bar.html b/docs/reference/plot_leapr_bar.html deleted file mode 100644 index e1688a5..0000000 --- a/docs/reference/plot_leapr_bar.html +++ /dev/null @@ -1,137 +0,0 @@ - -Plot leapR pathway bars (single panel) — plot_leapr_bar • leapR - Skip to contents - - -
-
-
- -
-

This plotting helper expects leapR generated results to plot. -It will use BH_pvalue if present, otherwise pvalue.

-
- -
-

Usage

-
plot_leapr_bar(
-  res_df,
-  title = NULL,
-  top_n = 15,
-  star_thresholds = c(0.05, 0.01, 0.001),
-  wrap = 42,
-  max_stars = 5L,
-  fill_sig = "#2C7BB6",
-  fill_ns = "#BFD7FF",
-  outline = NA,
-  axis_text_y_size = 8,
-  axis_text_x_size = 9
-)
-
- -
-

Arguments

- - -
res_df
-

A leapR df containing BH_pvalue (or pvalue) and a pathway/term label column.

- - -
title
-

Plot title.

- - -
top_n
-

Number of top pathways/genes to display.

- - -
star_thresholds
-

list of numeric significance thresholds for star annotations.

- - -
wrap
-

Wrap width for pathway labels (helps formatting).

- - -
max_stars
-

Maximum number of stars to draw per bar (default 5).

- - -
fill_sig
-

Fill color for significant bars

- - -
fill_ns
-

Fill color for non-significant bars.

- - -
outline
-

Bar border color.

- - -
axis_text_y_size
-

Font size for y-axis (category) labels.

- - -
axis_text_x_size
-

Font size for x-axis (numeric) labels.

- -
-
-

Value

-

A ggplot2 object (or NULL if nothing to plot).

-
- -
- - -
- - - - - - - diff --git a/docs/reference/read_gene_sets.html b/docs/reference/read_gene_sets.html deleted file mode 100644 index b15d70c..0000000 --- a/docs/reference/read_gene_sets.html +++ /dev/null @@ -1,112 +0,0 @@ - -read_gene_sets — read_gene_sets • leapR - Skip to contents - - -
-
-
- -
-

read_gene_sets is a function to import external pathway -database files in .gmt format

-
- -
-

Usage

-
read_gene_sets(
-  gsfile,
-  gene.labels = NA,
-  gs.size.threshold.min = 5,
-  gs.size.threshold.max = 15000
-)
-
- -
-

Arguments

- - -
gsfile
-

is a gene set file, for example a .gmt file -(gene matrix transposed file format)

- - -
gene.labels
-

defaults to NA

- - -
gs.size.threshold.min
-

defaults to 5

- - -
gs.size.threshold.max
-

defaults to 15000

- -
-
-

Value

-

gene set object

-

geneset list

-
- -
-

Examples

-
gfile <- system.file('extdata','h.all.v2024.1.Hs.symbols.gmt',
-          package='leapR')
-glist <- read_gene_sets(gfile)
-
-
-
-
- - -
- - - - - - - diff --git a/docs/reference/shortlist.html b/docs/reference/shortlist.html deleted file mode 100644 index aa77ef6..0000000 --- a/docs/reference/shortlist.html +++ /dev/null @@ -1,75 +0,0 @@ - -A list of pathways and genes that comprise these pathways from msigdb — shortlist • leapR - Skip to contents - - -
-
-
- -
-

A list of pathways and genes that comprise these pathways from msigdb

-
- -
-

Usage

-
shortlist
-
- -
-

Format

-

a list with 4 items

-

Short list of patient samples

-
- -
- - -
- - - - - - - diff --git a/leapR.Rproj b/leapR.Rproj new file mode 100644 index 0000000..eaa6b81 --- /dev/null +++ b/leapR.Rproj @@ -0,0 +1,18 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX + +BuildType: Package +PackageUseDevtools: Yes +PackageInstallArgs: --no-multiarch --with-keep.source +PackageRoxygenize: rd,collate,namespace diff --git a/man/calcTTest.Rd b/man/calcTTest.Rd index 94a5a27..64a0eb5 100644 --- a/man/calcTTest.Rd +++ b/man/calcTTest.Rd @@ -27,11 +27,15 @@ append results to ExpressionSet with two extra columns: `pvalue` and \examples{ library(leapR) + library(BiocFileCache) + + path <- tools::R_user_dir("leapR", which = "cache") + bfc <- BiocFileCache(path, ask = FALSE) + url <- "https://api.figshare.com/v2/file/download/56536214" - tdata <- download.file(url,method='libcurl',destfile='transData.rda') - load('transData.rda') - p <- file.remove("transData.rda") - + tc <- bfcadd(bfc, "tdat", fpath = url) + load(tc) + # read in the pathways data("ncipid") diff --git a/man/cluster_enrichment.Rd b/man/cluster_enrichment.Rd index c9428ef..1d4b487 100644 --- a/man/cluster_enrichment.Rd +++ b/man/cluster_enrichment.Rd @@ -36,12 +36,14 @@ a list of results matrices in the order of the input clusters. } \examples{ library(leapR) - - # read in the example transcriptomic data + library(BiocFileCache) + + path <- tools::R_user_dir("leapR", which = "cache") + bfc <- BiocFileCache(path, ask = FALSE) + url <- "https://api.figshare.com/v2/file/download/56536214" - tdata <- download.file(url,method='libcurl',destfile='transData.rda') - load('transData.rda') - p <- file.remove("transData.rda") + tc <- bfcadd(bfc, "tdat", fpath = url) + load(tc) # read in the pathways data("ncipid") diff --git a/man/combine_omics.Rd b/man/combine_omics.Rd index 74f0e50..d359663 100644 --- a/man/combine_omics.Rd +++ b/man/combine_omics.Rd @@ -31,23 +31,21 @@ adds prefix tags to the ids. } \examples{ library(leapR) - url <- 'https://api.figshare.com/v2/file/download/56536217' - - pdata <- download.file(url,method='libcurl',destfile='protData.rda') - load('protData.rda') - p <- file.remove("protData.rda") - + library(BiocFileCache) + path <- tools::R_user_dir("leapR", which = "cache") + bfc <- BiocFileCache(path, ask = FALSE) + + url <- "https://api.figshare.com/v2/file/download/56536217" + pc <- bfcadd(bfc, "pdat", fpath = url) + load(pc) + url <- "https://api.figshare.com/v2/file/download/56536214" - tdata <- download.file(url,method='libcurl',destfile='transData.rda') - load('transData.rda') - p <- file.remove("transData.rda") - - url <- 'https://api.figshare.com/v2/file/download/56536211' - phdata<-download.file(url,method='libcurl',destfile = 'phosData.rda') - #phosphodata<-read.csv("phdata",check.names=FALSE,row.names=1) - load('phosData.rda') - p <- file.remove('phosData.rda')# read in the example protein data - + tc <- bfcadd(bfc, "tdat", fpath = url) + load(tc) + + url <- "https://api.figshare.com/v2/file/download/56536211" + phc <- bfcadd(bfc, "phdat", fpath = url) + load(phc) # merge the three datasets by rows and add prefix tags for # different omics types diff --git a/man/enrichment_in_groups.Rd b/man/enrichment_in_groups.Rd index 6392c4c..c839d02 100644 --- a/man/enrichment_in_groups.Rd +++ b/man/enrichment_in_groups.Rd @@ -12,6 +12,7 @@ enrichment_in_groups( method = "fishers", minsize = 5, mapping_column = NULL, + log_transformed = FALSE, abundance_column = NULL, randomize = FALSE, silence_try_errors = TRUE @@ -35,6 +36,8 @@ the KS test will warn you about ties.} \item{mapping_column}{column name of mapping identifiers} +\item{log_transformed}{Set to TRUE if data is already log-transformed} + \item{abundance_column}{columns mapping abundance, either in the `assay` matrix or `rowData`} diff --git a/man/leapR-package.Rd b/man/leapR-package.Rd index 41c7aa5..821a41b 100644 --- a/man/leapR-package.Rd +++ b/man/leapR-package.Rd @@ -6,6 +6,13 @@ \title{leapR: Layered enrichment analysis of pathways R} \description{ leapR is a package that identifies pathways that are enriched across diverse 'omics experiments. It leverages any tabular expression data (proteomics, transcriptomics) using the `SummarizedExperiment` object. It works with any pathway in the .gct file format. +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://pnnl.github.io/leapR/} +} + } \author{ \strong{Maintainer}: Sara Gosline \email{sara.gosline@pnnl.gov} (\href{https://orcid.org/0000-0002-6534-4774}{ORCID}) @@ -13,6 +20,7 @@ leapR is a package that identifies pathways that are enriched across diverse 'om Authors: \itemize{ \item Jason McDermott \email{jason.mcdermott@pnnl.gov} + \item Jeremy Jacobson \email{jeremy.jacobson@pnnl.gov} } Other contributors: diff --git a/man/leapR.Rd b/man/leapR.Rd index a448e22..3bd6fb2 100644 --- a/man/leapR.Rd +++ b/man/leapR.Rd @@ -151,13 +151,14 @@ pathway. } \examples{ library(leapR) - - # read in the example abundance data - # read in the example transcriptomic data - tdata <- download.file("https://api.figshare.com/v2/file/download/56536214", - method='libcurl',destfile='transData.rda') - load('transData.rda') - p <- file.remove("transData.rda") + library(BiocFileCache) + + path <- tools::R_user_dir("leapR", which = "cache") + bfc <- BiocFileCache(path, ask = FALSE) + + url <- "https://api.figshare.com/v2/file/download/56536214" + tc <- bfcadd(bfc, "tdat", fpath = url) + load(tc) # read in the pathways data("ncipid") diff --git a/vignettes/examples.Rmd b/vignettes/examples.Rmd index 1dbcd3a..4570d83 100644 --- a/vignettes/examples.Rmd +++ b/vignettes/examples.Rmd @@ -31,6 +31,7 @@ library(ggplot2) library(dplyr) library(tibble) library(stringr) +library(BiocFileCache) ``` # Example data @@ -44,22 +45,23 @@ as example. This data can be loaded as follows: ```{r omicsdata, message=FALSE, warning=FALSE} -url <- "https://api.figshare.com/v2/file/download/56536217" -pdata <- download.file(url, method = "libcurl", destfile = "protData.rda") -# as.matrix() -load("protData.rda") -p <- file.remove("protData.rda") +#currently using the BiocFileCache though i'm not sure it helps +path <- tools::R_user_dir("leapR", which = "cache") +bfc <- BiocFileCache(path, ask = FALSE) + +url <- "https://api.figshare.com/v2/file/download/56536217" +pc <- bfcadd(bfc, "pdat", fpath = url) +load(pc) url <- "https://api.figshare.com/v2/file/download/56536214" -tdata <- download.file(url, method = "libcurl", destfile = "transData.rda") -load("transData.rda") -p <- file.remove("transData.rda") +tc <- bfcadd(bfc, "tdat", fpath = url) +load(tc) url <- "https://api.figshare.com/v2/file/download/56536211" -phdata <- download.file(url, method = "libcurl", destfile = "phosData.rda") -load("phosData.rda") -p <- file.remove("phosData.rda") +phc <- bfcadd(bfc, "phdat", fpath = url) +load(phc) + ``` We also have local data we can load diff --git a/vignettes/leapR.Rmd b/vignettes/leapR.Rmd index 45d987c..35e0f6f 100644 --- a/vignettes/leapR.Rmd +++ b/vignettes/leapR.Rmd @@ -44,6 +44,7 @@ library(ggplot2) library(dplyr) library(tibble) library(stringr) +library(BiocFileCache) ``` # Introduction @@ -149,22 +150,21 @@ as example. This data can be loaded as follows: ```{r omicsdata, message=FALSE, warning=FALSE, echo = FALSE} -url <- "https://api.figshare.com/v2/file/download/56536217" -pdata <- download.file(url, method = "libcurl", destfile = "protData.rda") -# as.matrix() -load("protData.rda") +#currently using the BiocFileCache though i'm not sure it helps +path <-tools::R_user_dir("leapR", which = "cache") +bfc <- BiocFileCache(path, ask = FALSE) -p <- file.remove("protData.rda") +url <- "https://api.figshare.com/v2/file/download/56536217" +pc <- bfcadd(bfc, "pdat", fpath = url) +load(pc) url <- "https://api.figshare.com/v2/file/download/56536214" -tdata <- download.file(url, method = "libcurl", destfile = "transData.rda") -load("transData.rda") -p <- file.remove("transData.rda") +tc <- bfcadd(bfc, "tdat", fpath = url) +load(tc) url <- "https://api.figshare.com/v2/file/download/56536211" -phdata <- download.file(url, method = "libcurl", destfile = "phosData.rda") -load("phosData.rda") -p <- file.remove("phosData.rda") +phc <- bfcadd(bfc, 'phdat', fpath =url) +load(phc) ``` ```{r show_pset_example} diff --git a/vignettes/order-enrichment.Rmd b/vignettes/order-enrichment.Rmd index 336e161..a2e3bad 100644 --- a/vignettes/order-enrichment.Rmd +++ b/vignettes/order-enrichment.Rmd @@ -31,17 +31,26 @@ library(ggplot2) library(dplyr) library(tibble) library(stringr) +library(BiocFileCache) ``` # Load our test proteomics dataset ```{r load data} + + +#currently using the BiocFileCache though i'm not sure it helps +path <- tools::R_user_dir("leapR", which = "cache") +bfc <- BiocFileCache(path, ask = FALSE) + url <- "https://api.figshare.com/v2/file/download/56536217" -pdata <- download.file(url, method = "libcurl", destfile = "protData.rda") +pd <- bfcadd(bfc, 'protdat', url) +load(pd) +#pdata <- download.file(url, method = "libcurl", destfile = "protData.rda") # as.matrix() -load("protData.rda") +#load("protData.rda") -p <- file.remove("protData.rda") +#p <- file.remove("protData.rda") data(shortlist) data(longlist) @@ -69,7 +78,9 @@ cor.res <- do.call(rbind,lapply(1:length(shortlist), function (i) { primary_columns = shortlist[i] ) - colnames(protdata.enrichment.ks) <- paste('ks',colnames(protdata.enrichment.ks),sep='.') + colnames(protdata.enrichment.ks) <- paste('ks', + colnames(protdata.enrichment.ks), + sep = '.') protdata.enrichment.cs <- leapR::leapR( @@ -79,7 +90,9 @@ cor.res <- do.call(rbind,lapply(1:length(shortlist), function (i) { assay_name = "proteomics", primary_columns = shortlist[i] ) - colnames(protdata.enrichment.cs) <- paste('chisq',colnames(protdata.enrichment.cs),sep='.') + colnames(protdata.enrichment.cs) <- paste('chisq', + colnames(protdata.enrichment.cs), + sep = '.') protdata.enrichment.zt <- leapR::leapR( geneset = ncipid, "enrichment_in_order", @@ -89,7 +102,9 @@ cor.res <- do.call(rbind,lapply(1:length(shortlist), function (i) { primary_columns = shortlist[i] ) - colnames(protdata.enrichment.zt) <- paste('ztest',colnames(protdata.enrichment.zt),sep='.') + colnames(protdata.enrichment.zt) <- paste('ztest', + colnames(protdata.enrichment.zt), + sep = '.') paths <- rownames(protdata.enrichment.ks) allvals <- cbind(protdata.enrichment.cs[paths,],