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
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
^.*\.gitignore
^LICENSE\.md$
^.git*$
^_pkgdown\.yml$
^docs$
^pkgdown$
2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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, master]
branches: main
pull_request:
release:
types: [published]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
doc
Meta
inst/doc
docs
2 changes: 1 addition & 1 deletion 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.7
Version: 0.99.8
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 Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ Layered Enrichment Analysis of Pathways in R (leapR) a tool that carries out sta
## Install
leapR is available through Bioconductor repository here

```{r install}

```
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(version = "3.21")

BiocManager::install('BiocStyle')

BiocManager::install('leapR')
```

Expand Down
4 changes: 4 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
url: https://pnnl-github.io/leapR
template:
bootstrap: 5

28 changes: 28 additions & 0 deletions catalog-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: leap-r
title: Leap R
description: Layered Enrichment Analysis of Pathways in R (leapR) a tool that carries out statistical enrichment analysis on single- or multi-omics data.
annotations:
# Conditional host-specific annotations rendered to avoid empty-string values that fail catalog validation.
github.com/project-slug: pnnl/leapR
links:
- title: Leap R Repository
url: https://github.com/pnnl/leapR
- title: Leap R Publication
url: https://pubs.acs.org/doi/full/10.1021/acs.jproteome.0c00963
tags:
- R
spec:
type: api
owner: user:default/sara.gosline_pnnl.gov # Sara Gosline project lead
visibility: private # to expose this item in the catalog to others at PNNL, change the visibility to 'public'
# system:
lifecycle: production

# TODO: does leap-r depend on another resource or component?
# dependsOn:

# TODO: does another resource depend on leap-r?
# dependencyOf:
127 changes: 127 additions & 0 deletions vignettes/order-enrichment.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
---
title: "leapR Order Enrichment Tests"
output:
BiocStyle::html_document:
toc: true
toc_depth: 2
vignette: |
%\VignetteIndexEntry{leapR}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r knitr, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
cache = FALSE
)
```


# Load libraries needed

```{r libraries, message=FALSE, warning = FALSE}
# load the core libraries
library(leapR)
library(gplots)
library(rmarkdown)
# plotting helpers used in this vignette
library(ggplot2)
library(dplyr)
library(tibble)
library(stringr)
```


# Load our test proteomics dataset
```{r load data}
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")

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")
```

# Compare enrichment methods
We want to evaluate how various samples compare in enrichmnet

```{r compare}

i = 8
data("ncipid")

cor.res <- do.call(rbind,lapply(1:length(shortlist), function (i) {
protdata.enrichment.ks <- leapR::leapR(
geneset = ncipid, "enrichment_in_order",
eset = pset,
minsize = 5,
assay_name = "proteomics",
primary_columns = shortlist[i]
)

colnames(protdata.enrichment.ks) <- paste('ks',colnames(protdata.enrichment.ks),sep='.')


protdata.enrichment.cs <- leapR::leapR(
geneset = ncipid, "enrichment_in_order",
method = 'chisq',
eset = pset, minsize = 5,
assay_name = "proteomics",
primary_columns = shortlist[i]
)
colnames(protdata.enrichment.cs) <- paste('chisq',colnames(protdata.enrichment.cs),sep='.')

protdata.enrichment.zt <- leapR::leapR(
geneset = ncipid, "enrichment_in_order",
eset = pset, minsize = 5,
method = 'ztest',
assay_name = "proteomics",
primary_columns = shortlist[i]
)

colnames(protdata.enrichment.zt) <- paste('ztest',colnames(protdata.enrichment.zt),sep='.')

paths <- rownames(protdata.enrichment.ks)
allvals <- cbind(protdata.enrichment.cs[paths,],
protdata.enrichment.ks[paths,],
protdata.enrichment.zt[paths,])

kz <- cor(allvals$ks.BH_pvalue, allvals$ztest.BH_pvalue, use = 'p')

kc <- cor(allvals$ks.BH_pvalue, allvals$chisq.BH_pvalue, use = 'p')

cz <- cor(allvals$chisq.BH_pvalue, allvals$ztest.BH_pvalue, use = 'p')

kz <- cor(allvals$ks.pvalue, allvals$ztest.pvalue, use = 'p')

kc <- cor(allvals$ks.pvalue, allvals$chisq.pvalue, use = 'p')

cz <- cor(allvals$chisq.pvalue, allvals$ztest.pvalue, use = 'p')

return(c(kz = kc, kc=kc, cz = cz))
}))

```

We can compare the corrected p-values

```{r compare pvals}
library(ggplot2)

cor.res |> as.data.frame() |>
tidyr::pivot_longer(c(1:3),names_to='test_comparison',values_to='p cor') |>
ggplot(aes(x=test_comparison, y= `p cor`)) + geom_jitter()



```
Loading