Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: leapR
Title: Layered enrichment analysis of pathways R
Version: 0.99.8
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"),
Expand All @@ -17,7 +17,8 @@ biocViews:
Proteomics,
Pathways,
GeneExpression,
Transcriptomics
Transcriptomics,
Software
Imports:
stats,
gplots,
Expand All @@ -30,11 +31,13 @@ Imports:
stringr,
tidyr,
SummarizedExperiment,
BiocStyle
BiocStyle,
BiocFileCache
Suggests:
knitr,
rmarkdown,
testthat (>= 3.0.0)
VignetteBuilder: knitr
License: MIT + file LICENSE
Config/testthat/edition: 3
URL: https://pnnl.github.io/leapR/
12 changes: 8 additions & 4 deletions R/calcTTest.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
#'
Expand Down
12 changes: 7 additions & 5 deletions R/cluster_enrichment.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
30 changes: 14 additions & 16 deletions R/combine_omics.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion R/enrichment_in_groups.R
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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))) &
Expand Down
16 changes: 8 additions & 8 deletions R/leapR-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
#'
Expand Down
15 changes: 8 additions & 7 deletions R/leapR.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
18 changes: 18 additions & 0 deletions leapR.Rproj
Original file line number Diff line number Diff line change
@@ -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
12 changes: 8 additions & 4 deletions man/calcTTest.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions man/cluster_enrichment.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 14 additions & 16 deletions man/combine_omics.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/enrichment_in_groups.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions man/leapR-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions man/leapR.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 13 additions & 11 deletions vignettes/examples.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ library(ggplot2)
library(dplyr)
library(tibble)
library(stringr)
library(BiocFileCache)
```

# Example data
Expand All @@ -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
Expand Down
Loading
Loading