... | ... |
@@ -1,4 +1,4 @@ |
1 |
-Package: FEDUP |
|
1 |
+Package: fedup |
|
2 | 2 |
Title: Fisher's Test for Enrichment and Depletion of User-Defined Pathways |
3 | 3 |
Version: 0.99.0 |
4 | 4 |
Date: 2021-02-17 |
... | ... |
@@ -45,5 +45,5 @@ Encoding: UTF-8 |
45 | 45 |
Language: en-US |
46 | 46 |
License: MIT + file LICENSE |
47 | 47 |
VignetteBuilder: knitr |
48 |
-URL: https://github.com/rosscm/FEDUP |
|
48 |
+URL: https://github.com/rosscm/fedup |
|
49 | 49 |
RoxygenNote: 7.1.1 |
... | ... |
@@ -5,9 +5,9 @@ |
5 | 5 |
#' |
6 | 6 |
#' Raw data location |
7 | 7 |
#' system.file("extdata", "Human_Reactome_November_17_2020_symbol.gmt", |
8 |
-#' package="FEDUP") |
|
8 |
+#' package = "fedup") |
|
9 | 9 |
#' Script to prepare data |
10 |
-#' system.file("data-raw", "pathwaysGMT.R", package="FEDUP") |
|
10 |
+#' system.file("data-raw", "pathwaysGMT.R", package ="fedup") |
|
11 | 11 |
#' |
12 | 12 |
#' @format a named list of 1437 vectors |
13 | 13 |
"pathwaysGMT" |
... | ... |
@@ -15,10 +15,10 @@ |
15 | 15 |
#' Example list of yeast SAFE terms obtained from a XLSX file. |
16 | 16 |
#' |
17 | 17 |
#' Raw data location |
18 |
-#' system.file("extdata", "SAFE_terms.xlsx", package="FEDUP") |
|
18 |
+#' system.file("extdata", "SAFE_terms.xlsx", package = "fedup") |
|
19 | 19 |
#' |
20 | 20 |
#' Script to prepare data |
21 |
-#' system.file("data-raw", "pathwaysXLSX.R", package="FEDUP") |
|
21 |
+#' system.file("data-raw", "pathwaysXLSX.R", package = "fedup") |
|
22 | 22 |
#' |
23 | 23 |
#' @format a named list of 30 vectors |
24 | 24 |
"pathwaysXLSX" |
... | ... |
@@ -26,10 +26,10 @@ |
26 | 26 |
#' Example list of yeast SAFE terms obtained from a TXT file. |
27 | 27 |
#' |
28 | 28 |
#' Raw data location |
29 |
-#' system.file("extdata", "SAFE_terms.txt", package="FEDUP") |
|
29 |
+#' system.file("extdata", "SAFE_terms.txt", package = "fedup") |
|
30 | 30 |
#' |
31 | 31 |
#' Script to prepare data |
32 |
-#' system.file("data-raw", "pathwaysTXT.R", package="FEDUP") |
|
32 |
+#' system.file("data-raw", "pathwaysTXT.R", package = "fedup") |
|
33 | 33 |
#' |
34 | 34 |
#' @format a named list of 30 vectors |
35 | 35 |
"pathwaysTXT" |
... | ... |
@@ -37,7 +37,7 @@ |
37 | 37 |
#' Example vector of human genes to use as test set for enrichment. |
38 | 38 |
#' |
39 | 39 |
#' Script to prepare data |
40 |
-#' system.file("data-raw", "genes.R", package="FEDUP") |
|
40 |
+#' system.file("data-raw", "genes.R", package = "fedup") |
|
41 | 41 |
#' |
42 | 42 |
#' @format a character vector with 190 elements (gene IDs) |
43 | 43 |
"testGene" |
... | ... |
@@ -45,7 +45,7 @@ |
45 | 45 |
#' Example vector of human genes to use as background set for enrichment. |
46 | 46 |
#' |
47 | 47 |
#' Script to generate data |
48 |
-#' system.file("data-raw", "genes.R", package="FEDUP") |
|
48 |
+#' system.file("data-raw", "genes.R", package = "fedup") |
|
49 | 49 |
#' |
50 | 50 |
#' @format a character vector with 10208 elements (gene IDs) |
51 | 51 |
"backgroundGene" |
... | ... |
@@ -118,6 +118,6 @@ runFedup <- function(testGene, backgroundGene, pathways) { |
118 | 118 |
res <- res[order(res$pvalue), ] |
119 | 119 |
res$qvalue <- p.adjust(res$pvalue, method = "BH") |
120 | 120 |
|
121 |
- message("You did it! FEDUP ran successfully, feeling pretty good huh?") |
|
121 |
+ message("You did it! fedup ran successfully, feeling pretty good huh?") |
|
122 | 122 |
return(res) |
123 | 123 |
} |
... | ... |
@@ -1,6 +1,6 @@ |
1 | 1 |
#' Writes an enrichment dataset file for use in Cytoscape EnrichmentMap. |
2 | 2 |
#' |
3 |
-#' @param df (data.frame) table with FEDUP enrichment results. |
|
3 |
+#' @param df (data.frame) table with fedup enrichment results. |
|
4 | 4 |
#' (see runFedup() for column descriptions) |
5 | 5 |
#' @param resultsFile (char) name of output results file. |
6 | 6 |
#' @return table of gene enrichment and depletion results formatted as a |
... | ... |
@@ -32,14 +32,14 @@ writeFemap <- function(df, resultsFile) { |
32 | 32 |
select("pathway", "description", "pvalue", "qvalue", "status") |
33 | 33 |
|
34 | 34 |
fwrite(df_em, resultsFile, sep = "\t", col.names = TRUE, quote = FALSE) |
35 |
- message("Wrote out Cytoscape-formatted FEDUP results file to ", resultsFile) |
|
35 |
+ message("Wrote out Cytoscape-formatted fedup results file to ", resultsFile) |
|
36 | 36 |
} |
37 | 37 |
|
38 | 38 |
#' Draws a network representation of overlaps among enriched and depleted |
39 | 39 |
#' pathways using EnrichmentMap (EM) in Cytoscape. |
40 | 40 |
#' |
41 | 41 |
#' @param gmtFile (char) path to GMT file (must be an absolute path). |
42 |
-#' @param resultsFile (char) path to file with FEDUP results |
|
42 |
+#' @param resultsFile (char) path to file with fedup results |
|
43 | 43 |
#' (must be an absolute path). |
44 | 44 |
#' @param pvalue (numeric) pvalue cutoff. Pathways with a higher pvalue |
45 | 45 |
#' will not be included in the EM (value between 0 and 1; default 1). |
... | ... |
@@ -59,14 +59,14 @@ writeFemap <- function(df, resultsFile) { |
59 | 59 |
#' gmtFile <- tempfile("pathwaysGMT", fileext = ".gmt") |
60 | 60 |
#' fedupRes <- runFedup(testGene, backgroundGene, pathwaysGMT) |
61 | 61 |
#' resultsFile <- tempfile("fedupRes", fileext = ".txt") |
62 |
-#' netFile <- tempfile("FEDUP_EM", fileext = ".png") |
|
62 |
+#' netFile <- tempfile("fedup_EM", fileext = ".png") |
|
63 | 63 |
#' writePathways(pathwaysGMT, gmtFile) |
64 | 64 |
#' writeFemap(fedupRes, resultsFile) |
65 | 65 |
#' plotFemap( |
66 | 66 |
#' gmtFile = gmtFile, |
67 | 67 |
#' resultsFile = resultsFile, |
68 | 68 |
#' qvalue = 0.05, |
69 |
-#' netName = "FEDUP_EM", |
|
69 |
+#' netName = "fedup_EM", |
|
70 | 70 |
#' netFile = netFile |
71 | 71 |
#' ) |
72 | 72 |
#' } |
... | ... |
@@ -16,12 +16,12 @@ |
16 | 16 |
#' @examples |
17 | 17 |
#' pathways <- readPathways( |
18 | 18 |
#' system.file("extdata", "Human_Reactome_November_17_2020_symbol.gmt", |
19 |
-#' package = "FEDUP" |
|
19 |
+#' package = "fedup" |
|
20 | 20 |
#' ), |
21 | 21 |
#' minGene = 10, maxGene = 500 |
22 | 22 |
#' ) |
23 | 23 |
#' pathways <- readPathways( |
24 |
-#' system.file("extdata", "SAFE_terms.xlsx", package = "FEDUP"), |
|
24 |
+#' system.file("extdata", "SAFE_terms.xlsx", package = "fedup"), |
|
25 | 25 |
#' header = TRUE, pathCol = "Enriched.GO.names", geneCol = "Gene.ID" |
26 | 26 |
#' ) |
27 | 27 |
#' @importFrom openxlsx read.xlsx |
... | ... |
@@ -1,6 +1,6 @@ |
1 | 1 |
#' Visualizes pathway enrichment and depletion using ggplot. |
2 | 2 |
#' |
3 |
-#' @param df (data.frame) table with FEDUP enrichment results to plot. |
|
3 |
+#' @param df (data.frame) table with fedup enrichment results to plot. |
|
4 | 4 |
#' @param xVar (char) x-axis variable (must be a column value in \code{df}). |
5 | 5 |
#' @param yVar (char) y-axis variable (must be a column value in \code{df}). |
6 | 6 |
#' @param xLab (char) x-axis label (default \code{xVar} value). |
... | ... |
@@ -11,15 +11,15 @@ knitr::opts_chunk$set( |
11 | 11 |
) |
12 | 12 |
``` |
13 | 13 |
|
14 |
-# FEDUP |
|
14 |
+# fedup |
|
15 | 15 |
|
16 |
-[](https://travis-ci.com/rosscm/FEDUP) |
|
17 |
- |
|
18 |
- |
|
19 |
- |
|
20 |
-[](https://codecov.io/gh/rosscm/FEDUP) |
|
16 |
+[](https://travis-ci.com/rosscm/fedup) |
|
17 |
+ |
|
18 |
+ |
|
19 |
+ |
|
20 |
+[](https://codecov.io/gh/rosscm/fedup) |
|
21 | 21 |
|
22 |
-`FEDUP` is an R package that tests for enrichment and depletion of user-defined |
|
22 |
+`fedup` is an R package that tests for enrichment and depletion of user-defined |
|
23 | 23 |
pathways using a Fisher's exact test. The method is designed for versatile |
24 | 24 |
pathway annotation formats (eg. gmt, txt, xlsx) to allow the user to run |
25 | 25 |
pathway analysis on custom annotations. This package is also |
... | ... |
@@ -38,10 +38,17 @@ that enhances the interpretability of the results. |
38 | 38 |
|
39 | 39 |
## Installation |
40 | 40 |
|
41 |
-Install `FEDUP` via devtools: |
|
41 |
+Install `fedup` via devtools: |
|
42 | 42 |
|
43 | 43 |
```{r, message = FALSE} |
44 |
-devtools::install_github("rosscm/FEDUP", quiet = TRUE) |
|
44 |
+devtools::install_github("rosscm/fedup", quiet = TRUE) |
|
45 |
+``` |
|
46 |
+ |
|
47 |
+Load package: |
|
48 |
+ |
|
49 |
+```{r} |
|
50 |
+#library(fedup) |
|
51 |
+load_all() |
|
45 | 52 |
``` |
46 | 53 |
|
47 | 54 |
# Running the package |
... | ... |
@@ -56,7 +63,6 @@ to see strong **enrichment** for pathways related to muscle contraction and, |
56 | 63 |
**depletion** for pathways *not* associated with muscle contraction. Let's see! |
57 | 64 |
|
58 | 65 |
```{r} |
59 |
-library(FEDUP) |
|
60 | 66 |
data(testGene) |
61 | 67 |
data(backgroundGene) |
62 | 68 |
data(pathwaysGMT) |
... | ... |
@@ -94,7 +100,7 @@ muscle contraction, such as `OLFACTORY SIGNALING PATHWAY` and |
94 | 100 |
Plot enriched and depleted pathways (qvalue < 0.05) in the form of a dot plot |
95 | 101 |
via the `plotDotPlot` function: |
96 | 102 |
|
97 |
-```{r, FEDUP_dotplot, fig.width = 9, fig.height = 9.5} |
|
103 |
+```{r, fedup_dotplot, fig.width = 9, fig.height = 9.5} |
|
98 | 104 |
fedupPlot <- fedupRes[which(fedupRes$qvalue < 0.05),] |
99 | 105 |
fedupPlot$log10qvalue <- -log10(fedupPlot$qvalue + 1e-10) # -log10(qvalue) |
100 | 106 |
fedupPlot$pathway <- gsub("\\%.*", "", fedupPlot$pathway) # clean names |
... | ... |
@@ -146,21 +152,21 @@ writePathways(pathwaysGMT, gmtFile) |
146 | 152 |
Cytoscape is open right? If so, run these lines and let the `plotFemap` |
147 | 153 |
magic happen: |
148 | 154 |
|
149 |
-```{r, FEDUP_EM} |
|
150 |
-netFile <- tempfile("FEDUP_EM", fileext = ".png") |
|
155 |
+```{r, fedup_EM} |
|
156 |
+netFile <- tempfile("fedup_EM", fileext = ".png") |
|
151 | 157 |
plotFemap( |
152 | 158 |
gmtFile = gmtFile, |
153 | 159 |
resultsFile = resultsFile, |
154 | 160 |
qvalue = 0.05, |
155 |
- netName = "FEDUP_EM", |
|
161 |
+ netName = "fedup_EM", |
|
156 | 162 |
netFile = netFile |
157 | 163 |
) |
158 | 164 |
``` |
159 | 165 |
|
160 |
- |
|
166 |
+ |
|
161 | 167 |
|
162 | 168 |
After some manual rearrangement of the annotated pathway clusters, this is the |
163 |
-resulting EnrichmentMap we get from our `FEDUP` results. Much better! |
|
169 |
+resulting EnrichmentMap we get from our `fedup` results. Much better! |
|
164 | 170 |
|
165 | 171 |
This has effectively summarized the 76 pathways from our dot plot into 14 unique |
166 | 172 |
biological themes (including 4 unclustered pathways). We can now see clear |
... | ... |
@@ -173,7 +179,7 @@ Try this out yourself! Hopefully it’s the only fedup you achieve |
173 | 179 |
# Versioning |
174 | 180 |
|
175 | 181 |
For the versions available, see the [tags on this |
176 |
-repo](https://github.com/rosscm/FEDUP/tags). |
|
182 |
+repo](https://github.com/rosscm/fedup/tags). |
|
177 | 183 |
|
178 | 184 |
# Shoutouts |
179 | 185 |
|
... | ... |
@@ -1,22 +1,25 @@ |
1 |
+--- |
|
2 |
+output: github_document |
|
3 |
+--- |
|
1 | 4 |
|
2 |
-# FEDUP |
|
3 | 5 |
|
4 |
-[](https://travis-ci.com/rosscm/FEDUP) |
|
6 |
- |
|
7 |
- |
|
8 |
- |
|
9 |
-[](https://codecov.io/gh/rosscm/FEDUP) |
|
10 | 6 |
|
11 |
-`FEDUP` is an R package that tests for enrichment and depletion of |
|
12 |
-user-defined pathways using a Fisher’s exact test. The method is |
|
13 |
-designed for versatile pathway annotation formats (eg. gmt, txt, xlsx) |
|
14 |
-to allow the user to run pathway analysis on custom annotations. This |
|
15 |
-package is also integrated with Cytoscape to provide network-based |
|
16 |
-pathway visualization that enhances the interpretability of the results. |
|
7 |
+# fedup |
|
17 | 8 |
|
18 |
-# Getting started |
|
9 |
+[](https://travis-ci.com/rosscm/fedup) |
|
10 |
+ |
|
11 |
+ |
|
12 |
+ |
|
13 |
+[](https://codecov.io/gh/rosscm/fedup) |
|
14 |
+ |
|
15 |
+`fedup` is an R package that tests for enrichment and depletion of user-defined |
|
16 |
+pathways using a Fisher's exact test. The method is designed for versatile |
|
17 |
+pathway annotation formats (eg. gmt, txt, xlsx) to allow the user to run |
|
18 |
+pathway analysis on custom annotations. This package is also |
|
19 |
+integrated with Cytoscape to provide network-based pathway visualization |
|
20 |
+that enhances the interpretability of the results. |
|
19 | 21 |
|
22 |
+# Getting started |
|
20 | 23 |
## System prerequisites |
21 | 24 |
|
22 | 25 |
**R version** ≥ 4.1 |
... | ... |
@@ -28,27 +31,35 @@ pathway visualization that enhances the interpretability of the results. |
28 | 31 |
|
29 | 32 |
## Installation |
30 | 33 |
|
31 |
-Install `FEDUP` via devtools: |
|
34 |
+Install `fedup` via devtools: |
|
32 | 35 |
|
33 |
-``` r |
|
34 |
-devtools::install_github("rosscm/FEDUP", quiet = TRUE) |
|
36 |
+ |
|
37 |
+```r |
|
38 |
+devtools::install_github("rosscm/fedup", quiet = TRUE) |
|
35 | 39 |
``` |
36 | 40 |
|
37 |
-# Running the package |
|
41 |
+Load package: |
|
38 | 42 |
|
43 |
+ |
|
44 |
+```r |
|
45 |
+#library(fedup) |
|
46 |
+load_all() |
|
47 |
+#> Loading fedup |
|
48 |
+``` |
|
49 |
+ |
|
50 |
+# Running the package |
|
39 | 51 |
## Sample input |
40 | 52 |
|
41 | 53 |
Load test genes (`testGene`), background genes (`backgroudGene`), and |
42 | 54 |
pathways (`pathwaysGMT`): |
43 | 55 |
|
44 |
-Note, the sample `testGene` object only consists of genes from the |
|
45 |
-pathway `MUSCLE CONTRACTION%REACTOME DATABASE ID RELEASE 74%397014`. So |
|
46 |
-we would expect to see strong **enrichment** for pathways related to |
|
47 |
-muscle contraction and, **depletion** for pathways *not* associated with |
|
48 |
-muscle contraction. Let’s see! |
|
56 |
+Note, the sample `testGene` object only consists of genes from the pathway |
|
57 |
+`MUSCLE CONTRACTION%REACTOME DATABASE ID RELEASE 74%397014`. So we would expect |
|
58 |
+to see strong **enrichment** for pathways related to muscle contraction and, |
|
59 |
+**depletion** for pathways *not* associated with muscle contraction. Let's see! |
|
49 | 60 |
|
50 |
-``` r |
|
51 |
-library(FEDUP) |
|
61 |
+ |
|
62 |
+```r |
|
52 | 63 |
data(testGene) |
53 | 64 |
data(backgroundGene) |
54 | 65 |
data(pathwaysGMT) |
... | ... |
@@ -56,7 +67,8 @@ data(pathwaysGMT) |
56 | 67 |
|
57 | 68 |
Take a look at the data structure: |
58 | 69 |
|
59 |
-``` r |
|
70 |
+ |
|
71 |
+```r |
|
60 | 72 |
str(testGene) |
61 | 73 |
#> chr [1:190] "NKX2-5" "SCN4A" "ITGB5" "SCN4B" "PAK2" "GATA4" "AKAP9" ... |
62 | 74 |
str(backgroundGene) |
... | ... |
@@ -73,18 +85,20 @@ str(head(pathwaysGMT)) |
73 | 85 |
|
74 | 86 |
Now use `runFedup` on sample data: |
75 | 87 |
|
76 |
-``` r |
|
88 |
+ |
|
89 |
+```r |
|
77 | 90 |
fedupRes <- runFedup(testGene, backgroundGene, pathwaysGMT) |
78 | 91 |
#> Data input: |
79 | 92 |
#> => 190 test genes |
80 | 93 |
#> => 10208 background genes |
81 | 94 |
#> => 1437 pathawys |
82 |
-#> You did it! FEDUP ran successfully, feeling pretty good huh? |
|
95 |
+#> You did it! fedup ran successfully, feeling pretty good huh? |
|
83 | 96 |
``` |
84 | 97 |
|
85 | 98 |
View output results table sorted by pvalue: |
86 | 99 |
|
87 |
-``` r |
|
100 |
+ |
|
101 |
+```r |
|
88 | 102 |
print(head(fedupRes[which(fedupRes$status == "Enriched"),])) |
89 | 103 |
#> pathway size |
90 | 104 |
#> 1: MUSCLE CONTRACTION%REACTOME DATABASE ID RELEASE 74%397014 190 |
... | ... |
@@ -131,19 +145,19 @@ print(head(fedupRes[which(fedupRes$status == "Depleted"),])) |
131 | 145 |
#> 6: 0.17258203 |
132 | 146 |
``` |
133 | 147 |
|
134 |
-Here we see the strongest enrichment for the `MUSCLE CONTRACTION` |
|
135 |
-pathway. Since our test set of genes are exclusively from this pathway, |
|
136 |
-this is totally expected. We also see significant enrichment for other |
|
137 |
-muscle contraction pathways, including `CARDIAC CONDUCTION` and |
|
138 |
-`SMOOTH MUSCLE CONTRACTION`. Conversely, we see significant depletion |
|
139 |
-for functions not associated with muscle contraction, such as |
|
140 |
-`OLFACTORY SIGNALING PATHWAY` and |
|
148 |
+Here we see the strongest enrichment for the `MUSCLE CONTRACTION` pathway. |
|
149 |
+Since our test set of genes are exclusively from this pathway, this is totally |
|
150 |
+expected. We also see significant enrichment for other muscle contraction |
|
151 |
+pathways, including `CARDIAC CONDUCTION` and `SMOOTH MUSCLE CONTRACTION`. |
|
152 |
+Conversely, we see significant depletion for functions not associated with |
|
153 |
+muscle contraction, such as `OLFACTORY SIGNALING PATHWAY` and |
|
141 | 154 |
`AMINO ACID AND DERIVATIVE METABOLISM`. Nice! |
142 | 155 |
|
143 |
-Plot enriched and depleted pathways (qvalue < 0.05) in the form of a |
|
144 |
-dot plot via the `plotDotPlot` function: |
|
156 |
+Plot enriched and depleted pathways (qvalue < 0.05) in the form of a dot plot |
|
157 |
+via the `plotDotPlot` function: |
|
145 | 158 |
|
146 |
-``` r |
|
159 |
+ |
|
160 |
+```r |
|
147 | 161 |
fedupPlot <- fedupRes[which(fedupRes$qvalue < 0.05),] |
148 | 162 |
fedupPlot$log10qvalue <- -log10(fedupPlot$qvalue + 1e-10) # -log10(qvalue) |
149 | 163 |
fedupPlot$pathway <- gsub("\\%.*", "", fedupPlot$pathway) # clean names |
... | ... |
@@ -165,12 +179,11 @@ p <- p + # facet by status to separate enriched and depleted pathways |
165 | 179 |
print(p) |
166 | 180 |
``` |
167 | 181 |
|
168 |
-<img src="man/figures/FEDUP_dotplot-1.png" width="100%" /> |
|
182 |
+<img src="man/figures/fedup_dotplot-1.png" title="plot of chunk fedup_dotplot" alt="plot of chunk fedup_dotplot" width="100%" /> |
|
169 | 183 |
|
170 |
-Look at all those chick… enrichments! This is a bit overwhelming, isn’t |
|
171 |
-it? How do we interpret these 76 seemingly redundant pathways in a way |
|
172 |
-that doesn’t hurt our tired brains even more? Oh I know, let’s use |
|
173 |
-EnrichmentMap! |
|
184 |
+Look at all those chick... enrichments! This is a bit overwhelming, isn't it? |
|
185 |
+How do we interpret these 76 seemingly redundant pathways in a way that doesn't |
|
186 |
+hurt our tired brains even more? Oh I know, let's use EnrichmentMap! |
|
174 | 187 |
|
175 | 188 |
First, make sure to have |
176 | 189 |
[Cytoscape](https://cytoscape.org/download.html) downloaded and and open |
... | ... |
@@ -178,36 +191,38 @@ on your computer. You’ll also need to install the |
178 | 191 |
[EnrichmentMap](http://apps.cytoscape.org/apps/enrichmentmap) and |
179 | 192 |
[AutoAnnotate](http://apps.cytoscape.org/apps/autoannotate) apps. |
180 | 193 |
|
181 |
-Then format results for compatibility with EnrichmentMap with |
|
182 |
-`writeFemap`: |
|
194 |
+Then format results for compatibility with EnrichmentMap with `writeFemap`: |
|
195 |
+ |
|
183 | 196 |
|
184 |
-``` r |
|
197 |
+```r |
|
185 | 198 |
resultsFile <- tempfile("fedupRes", fileext = ".txt") |
186 | 199 |
writeFemap(fedupRes, resultsFile) |
187 |
-#> Wrote out Cytoscape-formatted FEDUP results file to /var/folders/mh/_0z2r5zj3k75yhtgm6l7xy3m0000gn/T//RtmpmEZRQI/fedupRes18391308b962e.txt |
|
200 |
+#> Wrote out Cytoscape-formatted fedup results file to /var/folders/mh/_0z2r5zj3k75yhtgm6l7xy3m0000gn/T//RtmpKkUyBJ/fedupRes11041452f8f8f.txt |
|
188 | 201 |
``` |
189 | 202 |
|
190 | 203 |
Prepare a pathway annotation file (gmt format) from the pathway list you |
191 |
-passed to `runFedup` using the `writePathways` function (you don’t need |
|
192 |
-to run this function if your pathway annotations are already in gmt |
|
193 |
-format, but it doesn’t hurt to make sure): |
|
204 |
+passed to `runFedup` using the `writePathways` function (you don't need to run |
|
205 |
+this function if your pathway annotations are already in gmt format, but it |
|
206 |
+doesn't hurt to make sure): |
|
194 | 207 |
|
195 |
-``` r |
|
208 |
+ |
|
209 |
+```r |
|
196 | 210 |
gmtFile <- tempfile("pathwaysGMT", fileext = ".gmt") |
197 | 211 |
writePathways(pathwaysGMT, gmtFile) |
198 |
-#> Wrote out pathway gmt file to /var/folders/mh/_0z2r5zj3k75yhtgm6l7xy3m0000gn/T//RtmpmEZRQI/pathwaysGMT1839144457fcd.gmt |
|
212 |
+#> Wrote out pathway gmt file to /var/folders/mh/_0z2r5zj3k75yhtgm6l7xy3m0000gn/T//RtmpKkUyBJ/pathwaysGMT1104162f048f0.gmt |
|
199 | 213 |
``` |
200 | 214 |
|
201 | 215 |
Cytoscape is open right? If so, run these lines and let the `plotFemap` |
202 | 216 |
magic happen: |
203 | 217 |
|
204 |
-``` r |
|
205 |
-netFile <- tempfile("FEDUP_EM", fileext = ".png") |
|
218 |
+ |
|
219 |
+```r |
|
220 |
+netFile <- tempfile("fedup_EM", fileext = ".png") |
|
206 | 221 |
plotFemap( |
207 | 222 |
gmtFile = gmtFile, |
208 | 223 |
resultsFile = resultsFile, |
209 | 224 |
qvalue = 0.05, |
210 |
- netName = "FEDUP_EM", |
|
225 |
+ netName = "fedup_EM", |
|
211 | 226 |
netFile = netFile |
212 | 227 |
) |
213 | 228 |
#> You are connected to Cytoscape! |
... | ... |
@@ -215,22 +230,20 @@ plotFemap( |
215 | 230 |
#> Setting network chart data |
216 | 231 |
#> Annotating the network using AutoAnnotate |
217 | 232 |
#> Applying a force-directed network layout |
218 |
-#> Drawing out network to /var/folders/mh/_0z2r5zj3k75yhtgm6l7xy3m0000gn/T//RtmpmEZRQI/FEDUP_EM1839132bab598.png |
|
233 |
+#> Drawing out network to /var/folders/mh/_0z2r5zj3k75yhtgm6l7xy3m0000gn/T//RtmpKkUyBJ/fedup_EM110411a5eaa57.png |
|
219 | 234 |
#> file |
220 |
-#> "/var/folders/mh/_0z2r5zj3k75yhtgm6l7xy3m0000gn/T/RtmpmEZRQI/FEDUP_EM1839132bab598.png" |
|
235 |
+#> "/var/folders/mh/_0z2r5zj3k75yhtgm6l7xy3m0000gn/T/RtmpKkUyBJ/fedup_EM110411a5eaa57.png" |
|
221 | 236 |
``` |
222 | 237 |
|
223 |
- |
|
238 |
+ |
|
224 | 239 |
|
225 |
-After some manual rearrangement of the annotated pathway clusters, this |
|
226 |
-is the resulting EnrichmentMap we get from our `FEDUP` results. Much |
|
227 |
-better! |
|
240 |
+After some manual rearrangement of the annotated pathway clusters, this is the |
|
241 |
+resulting EnrichmentMap we get from our `fedup` results. Much better! |
|
228 | 242 |
|
229 |
-This has effectively summarized the 76 pathways from our dot plot into |
|
230 |
-14 unique biological themes (including 4 unclustered pathways). We can |
|
231 |
-now see clear themes in the data pertaining to muscle contraction, such |
|
232 |
-as `NMDA receptor function`, `calcium homeostasis`, and |
|
233 |
-`ATPase transport`. |
|
243 |
+This has effectively summarized the 76 pathways from our dot plot into 14 unique |
|
244 |
+biological themes (including 4 unclustered pathways). We can now see clear |
|
245 |
+themes in the data pertaining to muscle contraction, such as `NMDA receptor |
|
246 |
+function`, `calcium homeostasis`, and `ATPase transport`. |
|
234 | 247 |
|
235 | 248 |
Try this out yourself! Hopefully it’s the only fedup you achieve |
236 | 249 |
:grimacing: |
... | ... |
@@ -238,7 +251,7 @@ Try this out yourself! Hopefully it’s the only fedup you achieve |
238 | 251 |
# Versioning |
239 | 252 |
|
240 | 253 |
For the versions available, see the [tags on this |
241 |
-repo](https://github.com/rosscm/FEDUP/tags). |
|
254 |
+repo](https://github.com/rosscm/fedup/tags). |
|
242 | 255 |
|
243 | 256 |
# Shoutouts |
244 | 257 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
## code to prepare `testGene` and `backgroundGene` datasets goes here |
2 |
-pathwayFile <- system.file("extdata", "Human_Reactome_November_17_2020_symbol.gmt", package = "FEDUP") |
|
2 |
+pathwayFile <- system.file("extdata", "Human_Reactome_November_17_2020_symbol.gmt", package = "fedup") |
|
3 | 3 |
pathwaysGMT <- readPathways(pathwayFile, minGene = 10, maxGene = 500) |
4 | 4 |
|
5 | 5 |
testGene <- pathwaysGMT[[grep("397014", names(pathwaysGMT))]] # Reactome muscle contraction pathway |
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
## code to prepare `pathwaysGMT` dataset goes here |
2 |
-pathwayFile <- system.file("extdata", "Human_Reactome_November_17_2020_symbol.gmt", package = "FEDUP") |
|
2 |
+pathwayFile <- system.file("extdata", "Human_Reactome_November_17_2020_symbol.gmt", package = "fedup") |
|
3 | 3 |
pathwaysGMT <- readPathways(pathwayFile, minGene = 10, maxGene = 500) |
4 | 4 |
names(pathwaysGMT) <- stringi::stri_trans_general(names(pathwaysGMT), "latin-ascii") |
5 | 5 |
usethis::use_data(pathwaysGMT, compress = "xz", version = 2, overwrite = TRUE) |
... | ... |
@@ -1,7 +1,7 @@ |
1 | 1 |
## code to prepare `pathwaysXLSX` dataset goes here |
2 | 2 |
library(tibble) |
3 | 3 |
|
4 |
-pathwayFile <- system.file("extdata", "SAFE_terms.txt", package = "FEDUP") |
|
4 |
+pathwayFile <- system.file("extdata", "SAFE_terms.txt", package = "fedup") |
|
5 | 5 |
pathwaysTXT <- readPathways( |
6 | 6 |
pathwayFile, |
7 | 7 |
header = TRUE, |
... | ... |
@@ -17,8 +17,8 @@ Raw GMT file is available from |
17 | 17 |
\details{ |
18 | 18 |
Raw data location |
19 | 19 |
system.file("extdata", "Human_Reactome_November_17_2020_symbol.gmt", |
20 |
- package="FEDUP") |
|
20 |
+ package = "fedup") |
|
21 | 21 |
Script to prepare data |
22 |
-system.file("data-raw", "pathwaysGMT.R", package="FEDUP") |
|
22 |
+system.file("data-raw", "pathwaysGMT.R", package ="fedup") |
|
23 | 23 |
} |
24 | 24 |
\keyword{datasets} |
... | ... |
@@ -12,10 +12,10 @@ pathwaysTXT |
12 | 12 |
} |
13 | 13 |
\description{ |
14 | 14 |
Raw data location |
15 |
-system.file("extdata", "SAFE_terms.txt", package="FEDUP") |
|
15 |
+system.file("extdata", "SAFE_terms.txt", package = "fedup") |
|
16 | 16 |
} |
17 | 17 |
\details{ |
18 | 18 |
Script to prepare data |
19 |
-system.file("data-raw", "pathwaysTXT.R", package="FEDUP") |
|
19 |
+system.file("data-raw", "pathwaysTXT.R", package = "fedup") |
|
20 | 20 |
} |
21 | 21 |
\keyword{datasets} |
... | ... |
@@ -12,10 +12,10 @@ pathwaysXLSX |
12 | 12 |
} |
13 | 13 |
\description{ |
14 | 14 |
Raw data location |
15 |
-system.file("extdata", "SAFE_terms.xlsx", package="FEDUP") |
|
15 |
+system.file("extdata", "SAFE_terms.xlsx", package = "fedup") |
|
16 | 16 |
} |
17 | 17 |
\details{ |
18 | 18 |
Script to prepare data |
19 |
-system.file("data-raw", "pathwaysXLSX.R", package="FEDUP") |
|
19 |
+system.file("data-raw", "pathwaysXLSX.R", package = "fedup") |
|
20 | 20 |
} |
21 | 21 |
\keyword{datasets} |
... | ... |
@@ -19,7 +19,7 @@ plotDotPlot( |
19 | 19 |
) |
20 | 20 |
} |
21 | 21 |
\arguments{ |
22 |
-\item{df}{(data.frame) table with FEDUP enrichment results to plot.} |
|
22 |
+\item{df}{(data.frame) table with fedup enrichment results to plot.} |
|
23 | 23 |
|
24 | 24 |
\item{xVar}{(char) x-axis variable (must be a column value in \code{df}).} |
25 | 25 |
|
... | ... |
@@ -17,7 +17,7 @@ plotFemap( |
17 | 17 |
\arguments{ |
18 | 18 |
\item{gmtFile}{(char) path to GMT file (must be an absolute path).} |
19 | 19 |
|
20 |
-\item{resultsFile}{(char) path to file with FEDUP results |
|
20 |
+\item{resultsFile}{(char) path to file with fedup results |
|
21 | 21 |
(must be an absolute path).} |
22 | 22 |
|
23 | 23 |
\item{pvalue}{(numeric) pvalue cutoff. Pathways with a higher pvalue |
... | ... |
@@ -48,14 +48,14 @@ data(pathwaysGMT) |
48 | 48 |
gmtFile <- tempfile("pathwaysGMT", fileext = ".gmt") |
49 | 49 |
fedupRes <- runFedup(testGene, backgroundGene, pathwaysGMT) |
50 | 50 |
resultsFile <- tempfile("fedupRes", fileext = ".txt") |
51 |
-netFile <- tempfile("FEDUP_EM", fileext = ".png") |
|
51 |
+netFile <- tempfile("fedup_EM", fileext = ".png") |
|
52 | 52 |
writePathways(pathwaysGMT, gmtFile) |
53 | 53 |
writeFemap(fedupRes, resultsFile) |
54 | 54 |
plotFemap( |
55 | 55 |
gmtFile = gmtFile, |
56 | 56 |
resultsFile = resultsFile, |
57 | 57 |
qvalue = 0.05, |
58 |
- netName = "FEDUP_EM", |
|
58 |
+ netName = "fedup_EM", |
|
59 | 59 |
netFile = netFile |
60 | 60 |
) |
61 | 61 |
} |
... | ... |
@@ -42,12 +42,12 @@ Currently supports the following file format: gmt, txt, xlsx. |
42 | 42 |
\examples{ |
43 | 43 |
pathways <- readPathways( |
44 | 44 |
system.file("extdata", "Human_Reactome_November_17_2020_symbol.gmt", |
45 |
- package = "FEDUP" |
|
45 |
+ package = "fedup" |
|
46 | 46 |
), |
47 | 47 |
minGene = 10, maxGene = 500 |
48 | 48 |
) |
49 | 49 |
pathways <- readPathways( |
50 |
- system.file("extdata", "SAFE_terms.xlsx", package = "FEDUP"), |
|
50 |
+ system.file("extdata", "SAFE_terms.xlsx", package = "fedup"), |
|
51 | 51 |
header = TRUE, pathCol = "Enriched.GO.names", geneCol = "Gene.ID" |
52 | 52 |
) |
53 | 53 |
} |
... | ... |
@@ -7,7 +7,7 @@ |
7 | 7 |
writeFemap(df, resultsFile) |
8 | 8 |
} |
9 | 9 |
\arguments{ |
10 |
-\item{df}{(data.frame) table with FEDUP enrichment results. |
|
10 |
+\item{df}{(data.frame) table with fedup enrichment results. |
|
11 | 11 |
(see runFedup() for column descriptions)} |
12 | 12 |
|
13 | 13 |
\item{resultsFile}{(char) name of output results file.} |
... | ... |
@@ -1,6 +1,6 @@ |
1 | 1 |
context("Enrichment analysis") |
2 | 2 |
|
3 |
-test_that("Test that FEDUP stops without proper inputs", { |
|
3 |
+test_that("Test that fedup stops without proper inputs", { |
|
4 | 4 |
data(testGene) |
5 | 5 |
data(backgroundGene) |
6 | 6 |
data(pathwaysGMT) |
... | ... |
@@ -13,7 +13,7 @@ test_that("Test that FEDUP stops without proper inputs", { |
13 | 13 |
expect_error(runFedup(backgroundGene, testGene, pathwaysGMT)) |
14 | 14 |
}) |
15 | 15 |
|
16 |
-test_that("Test that FEDUP analysis works", { |
|
16 |
+test_that("Test that fedup analysis works", { |
|
17 | 17 |
data(testGene) |
18 | 18 |
data(backgroundGene) |
19 | 19 |
data(pathwaysGMT) |
... | ... |
@@ -4,7 +4,7 @@ test_that("Test that readPathways stops without proper inputs", { |
4 | 4 |
expect_error(readPathways("test.123.xls")) |
5 | 5 |
expect_error(readPathways("test.gmt.123")) |
6 | 6 |
|
7 |
- pathwayFile <- system.file("extdata", "SAFE_terms.xlsx", package = "FEDUP") |
|
7 |
+ pathwayFile <- system.file("extdata", "SAFE_terms.xlsx", package = "fedup") |
|
8 | 8 |
expect_error(readPathways( |
9 | 9 |
pathwayFile, |
10 | 10 |
header = TRUE, |
... | ... |
@@ -23,7 +23,7 @@ test_that("Test that readPathways stops without proper inputs", { |
23 | 23 |
}) |
24 | 24 |
|
25 | 25 |
test_that("Test that readPathways works with GMT input", { |
26 |
- pathwayFile <- system.file("extdata", "Human_Reactome_November_17_2020_symbol.gmt", package = "FEDUP") |
|
26 |
+ pathwayFile <- system.file("extdata", "Human_Reactome_November_17_2020_symbol.gmt", package = "fedup") |
|
27 | 27 |
s <- c("gmt", "txt", "xlsx") |
28 | 28 |
f <- sub(".*\\.", "", pathwayFile) |
29 | 29 |
expect_true(f %in% s) |
... | ... |
@@ -35,7 +35,7 @@ test_that("Test that readPathways works with GMT input", { |
35 | 35 |
}) |
36 | 36 |
|
37 | 37 |
test_that("Test that readPathways works with XLSX input", { |
38 |
- pathwayFile <- system.file("extdata", "SAFE_terms.xlsx", package = "FEDUP") |
|
38 |
+ pathwayFile <- system.file("extdata", "SAFE_terms.xlsx", package = "fedup") |
|
39 | 39 |
s <- c("gmt", "txt", "xlsx") |
40 | 40 |
f <- sub(".*\\.", "", pathwayFile) |
41 | 41 |
expect_true(f %in% s) |
... | ... |
@@ -50,7 +50,7 @@ test_that("Test that readPathways works with XLSX input", { |
50 | 50 |
}) |
51 | 51 |
|
52 | 52 |
test_that("Test that readPathways works with TXT input", { |
53 |
- pathwayFile <- system.file("extdata", "SAFE_terms.txt", package = "FEDUP") |
|
53 |
+ pathwayFile <- system.file("extdata", "SAFE_terms.txt", package = "fedup") |
|
54 | 54 |
s <- c("gmt", "txt", "xlsx") |
55 | 55 |
f <- sub(".*\\.", "", pathwayFile) |
56 | 56 |
expect_true(f %in% s) |
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
--- |
2 |
-title: "Introduction to FEDUP" |
|
2 |
+title: "Introduction to fedup" |
|
3 | 3 |
author: Catherine Ross |
4 | 4 |
output: |
5 | 5 |
rmdformats::html_clean: |
... | ... |
@@ -8,7 +8,7 @@ output: |
8 | 8 |
thumbnails: false |
9 | 9 |
lightbox: true |
10 | 10 |
vignette: > |
11 |
- %\VignetteIndexEntry{Introduction to FEDUP} |
|
11 |
+ %\VignetteIndexEntry{Introduction to fedup} |
|
12 | 12 |
%\VignetteEngine{knitr::rmarkdown} |
13 | 13 |
%\VignetteEncoding{UTF-8} |
14 | 14 |
--- |
... | ... |
@@ -22,7 +22,7 @@ knitr::opts_chunk$set( |
22 | 22 |
) |
23 | 23 |
``` |
24 | 24 |
|
25 |
-FEDUP is an R package that tests for enrichment and depletion of user-defined |
|
25 |
+This is an R package that tests for enrichment and depletion of user-defined |
|
26 | 26 |
pathways using a Fisher's exact test. The method is designed for versatile |
27 | 27 |
pathway annotation formats (eg. gmt, txt, xlsx) to allow the user to run |
28 | 28 |
pathway analysis on custom annotations. This package is also |
... | ... |
@@ -41,10 +41,17 @@ that enhances the interpretability of the results. |
41 | 41 |
|
42 | 42 |
## Installation |
43 | 43 |
|
44 |
-Install `FEDUP` via devtools: |
|
44 |
+Install `fedup` via devtools: |
|
45 | 45 |
|
46 | 46 |
```{r} |
47 |
-devtools::install_github("rosscm/FEDUP", quiet = TRUE) |
|
47 |
+devtools::install_github("rosscm/fedup", quiet = TRUE) |
|
48 |
+``` |
|
49 |
+ |
|
50 |
+Load package: |
|
51 |
+ |
|
52 |
+```{r} |
|
53 |
+#library(fedup) |
|
54 |
+devtools::load_all() |
|
48 | 55 |
``` |
49 | 56 |
|
50 | 57 |
# Running the package |
... | ... |
@@ -59,7 +66,7 @@ to see strong **enrichment** for pathways related to muscle contraction and, |
59 | 66 |
**depletion** for pathways *not* associated with muscle contraction. Let's see! |
60 | 67 |
|
61 | 68 |
```{r, message = FALSE} |
62 |
-library(FEDUP) |
|
69 |
+library(fedup) |
|
63 | 70 |
data(testGene) |
64 | 71 |
data(backgroundGene) |
65 | 72 |
data(pathwaysGMT) |
... | ... |
@@ -97,7 +104,7 @@ muscle contraction, such as `OLFACTORY SIGNALING PATHWAY` and |
97 | 104 |
Plot enriched and depleted pathways (qvalue < 0.05) in the form of a dot plot |
98 | 105 |
via the `plotDotPlot` function: |
99 | 106 |
|
100 |
-```{r, FEDUP_dotplot, fig.width = 9, fig.height = 9.5} |
|
107 |
+```{r, fedup_dotplot, fig.width = 9, fig.height = 9.5} |
|
101 | 108 |
fedupPlot <- fedupRes[which(fedupRes$qvalue < 0.05),] |
102 | 109 |
fedupPlot$log10qvalue <- -log10(fedupPlot$qvalue + 1e-10) # -log10(qvalue) |
103 | 110 |
fedupPlot$pathway <- gsub("\\%.*", "", fedupPlot$pathway) # clean names |
... | ... |
@@ -149,20 +156,20 @@ Cytoscape is open right? If so, run these lines and let the `plotFemap` |
149 | 156 |
magic happen: |
150 | 157 |
|
151 | 158 |
```{r} |
152 |
-#netFile <- tempfile("FEDUP_EM", fileext = ".png") |
|
159 |
+#netFile <- tempfile("fedup_EM", fileext = ".png") |
|
153 | 160 |
#plotFemap( |
154 | 161 |
# gmtFile = gmtFile, |
155 | 162 |
# resultsFile = resultsFile, |
156 | 163 |
# qvalue = 0.05, |
157 |
-# netName = "FEDUP_EM", |
|
164 |
+# netName = "fedup_EM", |
|
158 | 165 |
# netFile = netFile |
159 | 166 |
#) |
160 | 167 |
``` |
161 | 168 |
|
162 |
- |
|
169 |
+ |
|
163 | 170 |
|
164 | 171 |
After some manual rearrangement of the annotated pathway clusters, this is the |
165 |
-resulting EnrichmentMap we get from our `FEDUP` results. Much better! |
|
172 |
+resulting EnrichmentMap we get from our `fedup` results. Much better! |
|
166 | 173 |
|
167 | 174 |
This has effectively summarized the 76 pathways from our dot plot into 14 unique |
168 | 175 |
biological themes (including 4 unclustered pathways). We can now see clear |
... | ... |
@@ -172,10 +179,10 @@ function`, `calcium homeostasis`, and `ATPase transport`. |
172 | 179 |
|
173 | 180 |
## Manual input |
174 | 181 |
|
175 |
-Supply `FEDUP` with your own custom pathway annotations, eg. from an excel file: |
|
182 |
+Supply `fedup` with your own custom pathway annotations, eg. from an excel file: |
|
176 | 183 |
|
177 | 184 |
```{r} |
178 |
-pathwayFile <- system.file("extdata", "SAFE_terms.xlsx", package = "FEDUP") |
|
185 |
+pathwayFile <- system.file("extdata", "SAFE_terms.xlsx", package = "fedup") |
|
179 | 186 |
``` |
180 | 187 |
|
181 | 188 |
Take a look at the raw data structure: |
... | ... |
@@ -218,7 +225,7 @@ print(head(fedupRes[which(fedupRes$status == "Depleted"),])) |
218 | 225 |
|
219 | 226 |
Run through `plotDotPlot` to visualize: |
220 | 227 |
|
221 |
-```{r, FEDUP_dotplot_manual, fig.width = 5, fig.height = 3.5} |
|
228 |
+```{r, fedup_dotplot_manual, fig.width = 5, fig.height = 3.5} |
|
222 | 229 |
fedupPlot <- fedupRes[which(fedupRes$qvalue < 0.05),] |
223 | 230 |
fedupPlot$log10qvalue <- -log10(fedupPlot$qvalue + 1e-10) # log10(qvalue) |
224 | 231 |
fedupPlot$pathway <- gsub("\\%.*", "", fedupPlot$pathway) # clean names |
... | ... |
@@ -243,4 +250,4 @@ print(p) |
243 | 250 |
# Versioning |
244 | 251 |
|
245 | 252 |
For the versions available, see the |
246 |
-[tags on this repo](https://github.com/rosscm/FEDUP/tags). |
|
253 |
+[tags on this repo](https://github.com/rosscm/fedup/tags). |