Former-commit-id: 0ef905fee4bf648953d9a4f6dcb3a09a07a09abd
... | ... |
@@ -1,13 +1,17 @@ |
1 | 1 |
% Generated by roxygen2: do not edit by hand |
2 |
-% Please edit documentation in R/fedup-data.R |
|
2 |
+% Please edit documentation in R/data.R |
|
3 | 3 |
\docType{data} |
4 | 4 |
\name{backgroundGene} |
5 | 5 |
\alias{backgroundGene} |
6 |
-\title{Example vector of human genes to use as background set for enrichment. |
|
7 |
-Script to generate example background gene vector |
|
8 |
-system.file("genes.R", package = "FEDUP")} |
|
6 |
+\title{Example vector of human genes to use as background set for enrichment.} |
|
7 |
+\format{ |
|
8 |
+a character vector with 15965 elements (gene IDs) |
|
9 |
+} |
|
10 |
+\usage{ |
|
11 |
+backgroundGene |
|
12 |
+} |
|
9 | 13 |
\description{ |
10 |
-Example vector of human genes to use as background set for enrichment. |
|
11 |
-Script to generate example background gene vector |
|
12 |
-system.file("genes.R", package = "FEDUP") |
|
14 |
+Script to generate data |
|
15 |
+system.file("data-raw", "genes.R", package = "FEDUP") |
|
13 | 16 |
} |
17 |
+\keyword{datasets} |
... | ... |
@@ -1,13 +1,24 @@ |
1 | 1 |
% Generated by roxygen2: do not edit by hand |
2 |
-% Please edit documentation in R/fedup-data.R |
|
2 |
+% Please edit documentation in R/data.R |
|
3 | 3 |
\docType{data} |
4 | 4 |
\name{pathwaysGMT} |
5 | 5 |
\alias{pathwaysGMT} |
6 |
-\title{Example list of human pathway annotations obtained from a GMT file. |
|
7 |
-Script to generate example pathway list |
|
8 |
-system.file("pathwaysGMT.R", package = "FEDUP")} |
|
6 |
+\title{Named list of human pathway annotations obtained from a GMT file.} |
|
7 |
+\format{ |
|
8 |
+a named list of 8080 vectors |
|
9 |
+} |
|
10 |
+\usage{ |
|
11 |
+pathwaysGMT |
|
12 |
+} |
|
9 | 13 |
\description{ |
10 |
-Example list of human pathway annotations obtained from a GMT file. |
|
11 |
-Script to generate example pathway list |
|
12 |
-system.file("pathwaysGMT.R", package = "FEDUP") |
|
14 |
+Raw GMT file is available from |
|
15 |
+\url{http://download.baderlab.org/EM_Genesets/November_17_2020/Human/symbol/Pathways/Human_Reactome_November_17_2020_symbol.gmt} |
|
16 |
+} |
|
17 |
+\details{ |
|
18 |
+Raw data location |
|
19 |
+system.file("extdata", "Human_Reactome_November_17_2020_symbol.gmt", package = "FEDUP") |
|
20 |
+ |
|
21 |
+Script to prepare data |
|
22 |
+system.file("data-raw", "pathwaysGMT.R", package = "FEDUP") |
|
13 | 23 |
} |
24 |
+\keyword{datasets} |
... | ... |
@@ -1,13 +1,21 @@ |
1 | 1 |
% Generated by roxygen2: do not edit by hand |
2 |
-% Please edit documentation in R/fedup-data.R |
|
2 |
+% Please edit documentation in R/data.R |
|
3 | 3 |
\docType{data} |
4 | 4 |
\name{pathwaysXLSX} |
5 | 5 |
\alias{pathwaysXLSX} |
6 |
-\title{Example list of yeast SAFE terms obtained from a XLSX file. |
|
7 |
-Script to generate example pathway list |
|
8 |
-system.file("pathwaysXLSX.R", package = "FEDUP")} |
|
6 |
+\title{Example list of yeast SAFE terms obtained from a XLSX file.} |
|
7 |
+\format{ |
|
8 |
+a named list of 30 vectors |
|
9 |
+} |
|
10 |
+\usage{ |
|
11 |
+pathwaysXLSX |
|
12 |
+} |
|
9 | 13 |
\description{ |
10 |
-Example list of yeast SAFE terms obtained from a XLSX file. |
|
11 |
-Script to generate example pathway list |
|
12 |
-system.file("pathwaysXLSX.R", package = "FEDUP") |
|
14 |
+Raw data location |
|
15 |
+system.file("extdata", "SAFE_terms.xlsx", package = "FEDUP") |
|
16 |
+} |
|
17 |
+\details{ |
|
18 |
+Script to prepare data |
|
19 |
+system.file("data-raw", "pathwaysXLSX.R", package = "FEDUP") |
|
13 | 20 |
} |
21 |
+\keyword{datasets} |
... | ... |
@@ -52,20 +52,17 @@ data(testGene) |
52 | 52 |
data(backgroundGene) |
53 | 53 |
data(pathwaysGMT) |
54 | 54 |
fedup_res <- runFedup(testGene, backgroundGene, pathwaysGMT) |
55 |
-fedup_res$log10fdr <- -log10(fedup_res$fdr) # log10-transform FDR for plotting |
|
56 |
-fedup_enr <- head(fedup_res[with(fedup_res, which(enrichment == "enriched")),], 10) |
|
57 |
-fedup_dep <- head(fedup_res[with(fedup_res, which(enrichment == "depleted")),], 10) |
|
58 |
-fedup_plot <- rbind(fedup_enr, fedup_dep) |
|
55 |
+fedup_plot <- fedup_res[which(fedup_res$fdr < 0.05),] |
|
59 | 56 |
fedup_plot$log10fdr <- -log10(fedup_plot$fdr + 1e-10) # log10-transform FDR for plotting |
60 | 57 |
fedup_plot$pathway <- gsub("\\\\\%.*", "", fedup_plot$pathway) # clean pathway names |
61 |
-\dontrun{ |
|
62 |
-plotDotPlot(df = fedup_plot, |
|
63 |
- x_var = "log10fdr", |
|
64 |
- y_var = "pathway", |
|
65 |
- x_lab = "-log10(FDR)", |
|
66 |
- fill_var = "enrichment", |
|
67 |
- fill_lab = "Enrichment", |
|
68 |
- size_var = "real_pathway_frac", |
|
69 |
- size_lab = "Gene fraction") |
|
70 |
-} |
|
58 |
+ plotDotPlot( |
|
59 |
+ df = fedup_plot, |
|
60 |
+ x_var = "log10fdr", |
|
61 |
+ y_var = "pathway", |
|
62 |
+ x_lab = "-log10(FDR)", |
|
63 |
+ fill_var = "enrichment", |
|
64 |
+ fill_lab = "Enrichment", |
|
65 |
+ size_var = "real_pathway_frac", |
|
66 |
+ size_lab = "Gene fraction" |
|
67 |
+ ) |
|
71 | 68 |
} |
... | ... |
@@ -2,40 +2,47 @@ |
2 | 2 |
% Please edit documentation in R/femap.R |
3 | 3 |
\name{plotFemap} |
4 | 4 |
\alias{plotFemap} |
5 |
-\title{Plots an EnrichmentMap in Cytoscape to visualize enriched gene sets} |
|
5 |
+\title{Plots an EnrichmentMap (EM) in Cytoscape to visualize enriched and depleted gene sets.} |
|
6 | 6 |
\usage{ |
7 |
-plotFemap( |
|
8 |
- gmt_file, |
|
9 |
- EM_file, |
|
10 |
- EM_group_file, |
|
11 |
- output_folder, |
|
12 |
- net_name = "generic", |
|
13 |
- image_format = "png" |
|
14 |
-) |
|
7 |
+plotFemap(gmt_file, results_file, pvalue = 1, qvalue = 1, net_name = "generic") |
|
15 | 8 |
} |
16 | 9 |
\arguments{ |
17 |
-\item{gmt_file}{(char) file path to GMT file (this needs to be absolute path name).} |
|
18 |
- |
|
19 |
-\item{EM_file}{(char) file path to results_EM.txt (generated by writeEmapFile.R).} |
|
20 |
- |
|
21 |
-\item{EM_group_file}{(char) file path to write pathway groupings as determined |
|
22 |
-by EnrichmentMap.} |
|
10 |
+\item{gmt_file}{(char) path to GMT file (must be absolute path)} |
|
23 | 11 |
|
24 |
-\item{output_folder}{(char) file path to write gene set grouping file. This will be |
|
25 |
-used for between-pathway SNP association analysis.} |
|
12 |
+\item{results_file}{(char) path to file with enrichment results (must be absolute path)} |
|
26 | 13 |
|
27 |
-\item{net_name}{(char) name for network in Cytoscape.} |
|
14 |
+\item{pvalue}{(numeric) pvalue cutoff (value between 0 and 1). Gene set |
|
15 |
+nodes with a p-value lower than the given value will not be included |
|
16 |
+ in the network. (default = 1)} |
|
28 | 17 |
|
29 |
-\item{image_format}{(char) one of PNG, PDF, SVG, or JPEG. |
|
18 |
+\item{qvalue}{(numeric) FDR qvalue cutoff (value between 0 and 1). Gene set |
|
19 |
+nodes with a p-value lower than the given value will not be included |
|
20 |
+in the network. (default = 1)} |
|
30 | 21 |
|
31 |
-# Not run because requires Cytoscape to be installed and open. |
|
32 |
-# plotEmap(gmt_file=gmt_file, EM_file=EM_file, output_folder=enrich_folder, |
|
33 |
- net_name="generic", image_format="png").} |
|
22 |
+\item{net_name}{(char) name for network in Cytoscape} |
|
34 | 23 |
} |
35 | 24 |
\value{ |
36 |
-Filename of image to which EnrichmentMap is exported. Also side |
|
37 |
- effect of plotting the EnrichmentMap in an open session of Cytoscape. |
|
25 |
+filename of image to which EM is exported. Also side effect of |
|
26 |
+ plotting the EM in an open session of Cytoscape. |
|
38 | 27 |
} |
39 | 28 |
\description{ |
40 |
-Plots an EnrichmentMap in Cytoscape to visualize enriched gene sets |
|
29 |
+Plots an EnrichmentMap (EM) in Cytoscape to visualize enriched and depleted gene sets. |
|
30 |
+} |
|
31 |
+\examples{ |
|
32 |
+\dontrun{ |
|
33 |
+# not run because this function requires Cytoscape to be installed and open |
|
34 |
+data(testGene) |
|
35 |
+data(backgroundGene) |
|
36 |
+data(pathwaysGMT) |
|
37 |
+gmt_file <- tempfile("pathwaysGMT", fileext = ".gmt") |
|
38 |
+writePathways(pathwaysGMT, gmt_file) |
|
39 |
+fedup_res <- runFedup(testGene, backgroundGene, pathwaysGMT) |
|
40 |
+results_file <- tempfile("fedup_res", fileext = ".txt") |
|
41 |
+writeFemap(fedup_res, results_file) |
|
42 |
+plotFemap( |
|
43 |
+ gmt_file = gmt_file, |
|
44 |
+ results_file = results_file, |
|
45 |
+ qvalue = 0.05, |
|
46 |
+ net_name = "FEDUP_EM" |
|
47 |
+)} |
|
41 | 48 |
} |
42 | 49 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,56 @@ |
1 |
+% Generated by roxygen2: do not edit by hand |
|
2 |
+% Please edit documentation in R/pathways.R |
|
3 |
+\name{readPathways} |
|
4 |
+\alias{readPathways} |
|
5 |
+\title{Returns a list of pathways from a variety of file formats. |
|
6 |
+Currently supports the following file format: GMT, TXT, XLSX} |
|
7 |
+\usage{ |
|
8 |
+readPathways( |
|
9 |
+ pathway_file, |
|
10 |
+ header = TRUE, |
|
11 |
+ pathway_col, |
|
12 |
+ gene_col, |
|
13 |
+ MIN_GENE = 1L, |
|
14 |
+ MAX_GENE = Inf, |
|
15 |
+ GO_class = NULL |
|
16 |
+) |
|
17 |
+} |
|
18 |
+\arguments{ |
|
19 |
+\item{pathway_file}{(char) path to file with pathway annotations} |
|
20 |
+ |
|
21 |
+\item{header}{(logical) whether pathway_file has a header (default = TRUE)} |
|
22 |
+ |
|
23 |
+\item{pathway_col}{(char) column name with pathway identifiers, one pathway per row |
|
24 |
+use for non-GMT input (eg "Pathway.ID", default = NULL)} |
|
25 |
+ |
|
26 |
+\item{gene_col}{(char) column name with gene identifiers |
|
27 |
+use for non-GMT input (eg "Gene.ID", default = NULL)} |
|
28 |
+ |
|
29 |
+\item{MIN_GENE}{(integer) minimum number of genes to be considered in a pathway |
|
30 |
+(default = 1)} |
|
31 |
+ |
|
32 |
+\item{MAX_GENE}{(integer) maximum number of genes to be considered in a pathway |
|
33 |
+(default = Inf)} |
|
34 |
+ |
|
35 |
+\item{GO_class}{(char) if GO terms are present in 'pathway_file', which |
|
36 |
+class(es) should be subsetted (i.e., BP, MF, CC) |
|
37 |
+(default = NULL)} |
|
38 |
+} |
|
39 |
+\value{ |
|
40 |
+a list of vectors with pathway annotations |
|
41 |
+} |
|
42 |
+\description{ |
|
43 |
+Returns a list of pathways from a variety of file formats. |
|
44 |
+Currently supports the following file format: GMT, TXT, XLSX |
|
45 |
+} |
|
46 |
+\examples{ |
|
47 |
+pathways <- readPathways( |
|
48 |
+ system.file("extdata", "Human_Reactome_November_17_2020_symbol.gmt", |
|
49 |
+ package = "FEDUP"), MIN_GENE = 10, MAX_GENE = 500 |
|
50 |
+) |
|
51 |
+pathways <- readPathways( |
|
52 |
+ system.file("extdata", "SAFE_terms.xlsx", package = "FEDUP"), |
|
53 |
+ header = TRUE, pathway_col = "Enriched.GO.names", gene_col = "Gene.ID", |
|
54 |
+ MIN_GENE = 10, MAX_GENE = 500 |
|
55 |
+) |
|
56 |
+} |
... | ... |
@@ -1,13 +1,17 @@ |
1 | 1 |
% Generated by roxygen2: do not edit by hand |
2 |
-% Please edit documentation in R/fedup-data.R |
|
2 |
+% Please edit documentation in R/data.R |
|
3 | 3 |
\docType{data} |
4 | 4 |
\name{testGene} |
5 | 5 |
\alias{testGene} |
6 |
-\title{Example vector of human genes to use as test set for enrichment. |
|
7 |
-Script to generate example test gene vector |
|
8 |
-system.file("genes.R", package = "FEDUP")} |
|
6 |
+\title{Example vector of human genes to use as test set for enrichment.} |
|
7 |
+\format{ |
|
8 |
+a character vector with 396 elements (gene IDs) |
|
9 |
+} |
|
10 |
+\usage{ |
|
11 |
+testGene |
|
12 |
+} |
|
9 | 13 |
\description{ |
10 |
-Example vector of human genes to use as test set for enrichment. |
|
11 |
-Script to generate example test gene vector |
|
12 |
-system.file("genes.R", package = "FEDUP") |
|
14 |
+Script to prepare data |
|
15 |
+system.file("data-raw", "genes.R", package = "FEDUP") |
|
13 | 16 |
} |
17 |
+\keyword{datasets} |
14 | 18 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,38 @@ |
1 |
+% Generated by roxygen2: do not edit by hand |
|
2 |
+% Please edit documentation in R/femap.R |
|
3 |
+\name{writeFemap} |
|
4 |
+\alias{writeFemap} |
|
5 |
+\title{Writes an enrichment dataset file for use in Cytoscape EnrichmentMap} |
|
6 |
+\usage{ |
|
7 |
+writeFemap(df, results_file) |
|
8 |
+} |
|
9 |
+\arguments{ |
|
10 |
+\item{df}{(data.frame) table with FEDUP enrichment results |
|
11 |
+(see ?runFedup() for column descriptions)} |
|
12 |
+ |
|
13 |
+\item{results_file}{(char) name of output results file} |
|
14 |
+} |
|
15 |
+\value{ |
|
16 |
+table of gene enrichment and depletion results formatted as a |
|
17 |
+'Generic results file'. Rows represent tested pathways. Columns represent: |
|
18 |
+\itemize{ |
|
19 |
+ \item geneset -- gene-set ID (must match the gene-set ID in the GMT file); |
|
20 |
+ \item description -- gene-set name or description; |
|
21 |
+ \item pvalue -- enrichment pvalue; |
|
22 |
+ \item qvalue -- FDR correction value; |
|
23 |
+ \item phenotype -- +1 or -1, to identify enrichment in up- and down-regulation, |
|
24 |
+ or, more in general in either of the two phenotypes being compared |
|
25 |
+ in the two-class analysis (+1 maps to red, -1 maps to blue) |
|
26 |
+} |
|
27 |
+} |
|
28 |
+\description{ |
|
29 |
+Writes an enrichment dataset file for use in Cytoscape EnrichmentMap |
|
30 |
+} |
|
31 |
+\examples{ |
|
32 |
+data(testGene) |
|
33 |
+data(backgroundGene) |
|
34 |
+data(pathwaysGMT) |
|
35 |
+fedup_res <- runFedup(testGene, backgroundGene, pathwaysGMT) |
|
36 |
+results_file <- tempfile("fedup_res", fileext = ".txt") |
|
37 |
+writeFemap(fedup_res, results_file) |
|
38 |
+} |
... | ... |
@@ -2,54 +2,27 @@ |
2 | 2 |
% Please edit documentation in R/pathways.R |
3 | 3 |
\name{writePathways} |
4 | 4 |
\alias{writePathways} |
5 |
-\title{Returns a list of pathways from a file. |
|
6 |
-Currently supports the following file format: GMT, TXT, XLSX} |
|
5 |
+\title{Writes a set of pathways (list of vectors) to a GMT file} |
|
7 | 6 |
\usage{ |
8 |
-writePathways( |
|
9 |
- pathway_file, |
|
10 |
- header = TRUE, |
|
11 |
- pathway_col, |
|
12 |
- gene_col, |
|
13 |
- MIN_GENE = 1L, |
|
14 |
- MAX_GENE = Inf, |
|
15 |
- GO_class = NULL |
|
16 |
-) |
|
7 |
+writePathways(pathways, gmt_file) |
|
17 | 8 |
} |
18 | 9 |
\arguments{ |
19 |
-\item{pathway_file}{(char) path to file with pathway annotations} |
|
10 |
+\item{pathways}{(list) named list of vectors} |
|
20 | 11 |
|
21 |
-\item{header}{(logical) whether pathway_file has a header (default = TRUE)} |
|
22 |
- |
|
23 |
-\item{pathway_col}{(char) column name with pathway identifiers, one pathway per row |
|
24 |
-use for non-GMT input (eg "Pathway.ID", default = NULL)} |
|
25 |
- |
|
26 |
-\item{gene_col}{(char) column name with gene identifiers |
|
27 |
-use for non-GMT input (eg "Gene.ID", default = NULL)} |
|
28 |
- |
|
29 |
-\item{MIN_GENE}{(integer) minimum number of genes to be considered in a pathway |
|
30 |
-(default = 1)} |
|
31 |
- |
|
32 |
-\item{MAX_GENE}{(integer) maximum number of genes to be considered in a pathway |
|
33 |
-(default = Inf)} |
|
34 |
- |
|
35 |
-\item{GO_class}{(char) if GO terms are present in 'pathway_file', which class(es) |
|
36 |
-should be used (i.e., BP, MF, CC) (default = NULL)} |
|
12 |
+\item{gmt_file}{(char) name of output GMT file} |
|
37 | 13 |
} |
38 | 14 |
\value{ |
39 |
-a list of vectors with pathway annotations |
|
15 |
+GMT formatted file. Rows represent gene sets. Columns represent: |
|
16 |
+\itemize{ |
|
17 |
+ \item gene set name; |
|
18 |
+ \item description; |
|
19 |
+ \item a list of tab-delimited genes |
|
20 |
+} |
|
40 | 21 |
} |
41 | 22 |
\description{ |
42 |
-Returns a list of pathways from a file. |
|
43 |
-Currently supports the following file format: GMT, TXT, XLSX |
|
23 |
+Writes a set of pathways (list of vectors) to a GMT file |
|
44 | 24 |
} |
45 | 25 |
\examples{ |
46 |
-pathways <- writePathways( |
|
47 |
- system.file("extdata", "Human_GOBP_AllPathways_no_GO_iea_November_17_2020_symbol.gmt", package = "FEDUP"), |
|
48 |
- MIN_GENE = 10, MAX_GENE = 500, |
|
49 |
-) |
|
50 |
-pathways <- writePathways( |
|
51 |
- system.file("extdata", "SAFE_terms.xlsx", package = "FEDUP"), |
|
52 |
- header = TRUE, pathway_col = "Enriched.GO.names", gene_col = "Gene.ID", |
|
53 |
- MIN_GENE = 10, MAX_GENE = 500 |
|
54 |
-) |
|
26 |
+data(pathwaysXLSX) |
|
27 |
+writePathways(pathwaysXLSX, tempfile("pathwaysXLSX", fileext = ".gmt")) |
|
55 | 28 |
} |