Browse code

man page updates

Former-commit-id: 6c9cb5c25c50990937f6f4fad54168326755e9ee

Catherine Ross authored on 10/02/2021 07:10:06
Showing 8 changed files

... ...
@@ -5,19 +5,20 @@
5 5
 \alias{pathwaysGMT}
6 6
 \title{Named list of human pathway annotations obtained from a GMT file.}
7 7
 \format{
8
-a named list of 8080 vectors
8
+a named list of 1437 vectors
9 9
 }
10 10
 \usage{
11 11
 pathwaysGMT
12 12
 }
13 13
 \description{
14 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}
15
+\url{http://download.baderlab.org/EM_Genesets/November_17_2020/Human
16
+    /symbol/Pathways/Human_Reactome_November_17_2020_symbol.gmt}
16 17
 }
17 18
 \details{
18 19
 Raw data location
19
-system.file("extdata", "Human_Reactome_November_17_2020_symbol.gmt", package = "FEDUP")
20
-
20
+system.file("extdata", "Human_Reactome_November_17_2020_symbol.gmt",
21
+    package = "FEDUP")
21 22
 Script to prepare data
22 23
 system.file("data-raw", "pathwaysGMT.R", package = "FEDUP")
23 24
 }
... ...
@@ -21,11 +21,11 @@ plotDotPlot(
21 21
 \arguments{
22 22
 \item{df}{(data.frame) table with FEDUP enrichment results to plot.}
23 23
 
24
-\item{x_var}{(char) x-axis variable (must be a column value in `df`).}
24
+\item{x_var}{(char) x-axis variable (must be a column value in \code{df}).}
25 25
 
26
-\item{y_var}{(char) y-axis variable (must be a column value in `df`).}
26
+\item{y_var}{(char) y-axis variable (must be a column value in \code{df}).}
27 27
 
28
-\item{x_lab}{(char) x-axis label (default `x_var` value).}
28
+\item{x_lab}{(char) x-axis label (default \code{x_var} value).}
29 29
 
30 30
 \item{y_lab}{(char) y-axis label (default NULL).}
31 31
 
... ...
@@ -35,11 +35,11 @@ plotDotPlot(
35 35
 
36 36
 \item{fill_col}{(char) point fill colours (default NULL).}
37 37
 
38
-\item{fill_lab}{(char) point fill label (default `fill_var` value).}
38
+\item{fill_lab}{(char) point fill label (default \code{fill_var} value).}
39 39
 
40 40
 \item{size_var}{(char) point size variable (default NULL).}
41 41
 
42
-\item{size_lab}{(char) point size label (default `size_var` value).}
42
+\item{size_lab}{(char) point size label (default \code{size_var} value).}
43 43
 }
44 44
 \value{
45 45
 object returned from ggplot with the enrichment dot plot.
... ...
@@ -56,12 +56,12 @@ fedup_plot <- fedup_res[which(fedup_res$qvalue < 0.05),]
56 56
 fedup_plot$log10qvalue <- -log10(fedup_plot$qvalue + 1e-10)
57 57
 fedup_plot$pathway <- gsub("\\\\\%.*", "", fedup_plot$pathway)
58 58
 plotDotPlot(
59
-     df = fedup_plot,
60
-     x_var = "log10qvalue",
61
-     y_var = "pathway",
62
-     x_lab = "-log10(Qvalue)",
63
-     fill_var = "enrichment",
64
-     fill_lab = "Enrichment\nstatus",
65
-     size_var = "real_pathway_frac",
66
-     size_lab = "Gene fraction")
59
+    df = fedup_plot,
60
+    x_var = "log10qvalue",
61
+    y_var = "pathway",
62
+    x_lab = "-log10(Qvalue)",
63
+    fill_var = "status",
64
+    fill_lab = "Enrichment\nstatus",
65
+    size_var = "fold_enrichment",
66
+    size_lab = "Fold enrichment")
67 67
 }
... ...
@@ -41,20 +41,20 @@ pathways using EnrichmentMap (EM) in Cytoscape.
41 41
 }
42 42
 \examples{
43 43
 \dontrun{
44
- # not run because Cytoscape needs to be installed and open
45
- data(testGene)
46
- data(backgroundGene)
47
- data(pathwaysGMT)
48
- gmt_file <- tempfile("pathwaysGMT", fileext = ".gmt")
49
- fedup_res <- runFedup(testGene, backgroundGene, pathwaysGMT)
50
- results_file <- tempfile("fedup_res", fileext = ".txt")
51
- net_file <- tempfile("FEDUP_EM", fileext = ".png")
52
- writePathways(pathwaysGMT, gmt_file)
53
- writeFemap(fedup_res, results_file)
54
- plotFemap(
55
-   gmt_file = gmt_file,
56
-   results_file = results_file,
57
-   qvalue = 0.05,
58
-   net_name = "FEDUP_EM",
59
-   net_file = net_file)}
44
+    # not run because Cytoscape needs to be installed and open
45
+    data(testGene)
46
+    data(backgroundGene)
47
+    data(pathwaysGMT)
48
+    gmt_file <- tempfile("pathwaysGMT", fileext = ".gmt")
49
+    fedup_res <- runFedup(testGene, backgroundGene, pathwaysGMT)
50
+    results_file <- tempfile("fedup_res", fileext = ".txt")
51
+    net_file <- tempfile("FEDUP_EM", fileext = ".png")
52
+    writePathways(pathwaysGMT, gmt_file)
53
+    writeFemap(fedup_res, results_file)
54
+    plotFemap(
55
+        gmt_file = gmt_file,
56
+        results_file = results_file,
57
+        qvalue = 0.05,
58
+        net_name = "FEDUP_EM",
59
+        net_file = net_file)}
60 60
 }
... ...
@@ -7,7 +7,7 @@ Currently supports the following file format: GMT, TXT, XLSX.}
7 7
 \usage{
8 8
 readPathways(
9 9
   pathway_file,
10
-  header = TRUE,
10
+  header = FALSE,
11 11
   pathway_col = NULL,
12 12
   gene_col = NULL,
13 13
   MIN_GENE = 1L,
... ...
@@ -18,13 +18,14 @@ readPathways(
18 18
 \arguments{
19 19
 \item{pathway_file}{(char) path to file with pathway annotations.}
20 20
 
21
-\item{header}{(logical) whether pathway_file has a header (default TRUE).}
21
+\item{header}{(logical) whether \code{pathway_file} has a header
22
+(default FALSE).}
22 23
 
23 24
 \item{pathway_col}{(char) column name with pathway identifiers.
24
-For use with for non-GMT input files (eg "Pathway.ID"; default NULL).}
25
+For use with non-GMT input files (eg "Pathway.ID"; default NULL).}
25 26
 
26 27
 \item{gene_col}{(char) column name with gene identifiers.
27
-For use with for non-GMT input files (eg "Gene.ID"; default NULL).}
28
+For use with non-GMT input files (eg "Gene.ID"; default NULL).}
28 29
 
29 30
 \item{MIN_GENE}{(integer) minimum number of genes to be considered
30 31
 in a pathway (default = 1).}
... ...
@@ -32,8 +33,8 @@ in a pathway (default = 1).}
32 33
 \item{MAX_GENE}{(integer) maximum number of genes to be considered
33 34
 in a pathway (default = Inf).}
34 35
 
35
-\item{GO_class}{(char) if GO terms are present in `pathway_file`, which
36
-class(es) should be subsetted (BP, MF and/or CC, default NULL).}
36
+\item{GO_class}{(char) if GO terms are present in \code{pathway_file},
37
+which class(es) should be subsetted (BP, MF and/or CC, default NULL).}
37 38
 }
38 39
 \value{
39 40
 a list of vectors with pathway annotations.
... ...
@@ -44,10 +45,9 @@ Currently supports the following file format: GMT, TXT, XLSX.
44 45
 }
45 46
 \examples{
46 47
 pathways <- readPathways(
47
- system.file("extdata", "Human_Reactome_November_17_2020_symbol.gmt",
48
- package = "FEDUP"), MIN_GENE = 10, MAX_GENE = 500)
48
+    system.file("extdata", "Human_Reactome_November_17_2020_symbol.gmt",
49
+    package = "FEDUP"), MIN_GENE = 10, MAX_GENE = 500)
49 50
 pathways <- readPathways(
50
- system.file("extdata", "SAFE_terms.xlsx", package = "FEDUP"),
51
- header = TRUE, pathway_col = "Enriched.GO.names", gene_col = "Gene.ID",
52
- MIN_GENE = 10, MAX_GENE = 500)
51
+    system.file("extdata", "SAFE_terms.xlsx", package = "FEDUP"),
52
+    header = TRUE, pathway_col = "Enriched.GO.names", gene_col = "Gene.ID")
53 53
 }
... ...
@@ -7,7 +7,7 @@
7 7
 runFedup(test_gene, background_gene, pathways)
8 8
 }
9 9
 \arguments{
10
-\item{test_gene}{(char) vector of genes to test set.}
10
+\item{test_gene}{(char) vector of genes to use as test set.}
11 11
 
12 12
 \item{background_gene}{(char) vector of genes to use as background set.}
13 13
 
... ...
@@ -17,21 +17,20 @@ runFedup(test_gene, background_gene, pathways)
17 17
 table of pathway enrichment and depletion results. Rows represent
18 18
 tested pathways. Columns represent:
19 19
 \itemize{
20
- \item pathway -- name of the pathway, corresponds to names(pathways);
21
- \item size -- size of the pathway;
22
- \item real_total -- number of genes in `test_gene`;
23
- \item real_pathway -- number of `test_gene` members in pathway;
24
- \item real_pathway_frac -- fraction of `test_gene` members in pathway,
25
-     evaluates as (`real_pathawy` / `real_total`) * 100;
26
- \item expected_total -- number of genes in 'background_gene';
27
- \item expected_pathway -- number of `background_gene` members in pathway;
28
- \item expected_pathway_frac -- fraction of `background_gene` members in
29
-     pathway, evaluates as (`expected_pathway` / `expected_total`) * 100;
30
- \item enrichment -- indicator that pathway is enriched or depleted for
31
-     `test_gene` members;
32
- \item real_pathway_gene -- vector of `real_pathway` genes;
33
- \item pvalue -- enrichment p-value calculated via Fisher's exact test;
34
- \item qvalue -- BH-adjusted p-value
20
+    \item pathway -- name of the pathway, corresponds to
21
+        names(\code{pathways});
22
+    \item size -- size of the pathway;
23
+    \item real_frac -- fraction of \code{test_gene} members in pathway;
24
+    \item expected_frac -- fraction of \code{background_gene} members in
25
+        pathway;
26
+    \item fold_enrichment -- fold enrichment measure,
27
+        evaluates as \code{real_frac} / \code{expected_frac};
28
+    \item status -- indicator that pathway is enriched or depleted for
29
+        \code{test_gene} members;
30
+    \item real_gene -- vector of \code{test_gene} gene members annotated
31
+        to \code{pathways};
32
+    \item pvalue -- enrichment p-value calculated via Fisher's exact test;
33
+    \item qvalue -- BH-adjusted p-value
35 34
 }
36 35
 }
37 36
 \description{
... ...
@@ -5,7 +5,7 @@
5 5
 \alias{testGene}
6 6
 \title{Example vector of human genes to use as test set for enrichment.}
7 7
 \format{
8
-a character vector with 396 elements (gene IDs)
8
+a character vector with 190 elements (gene IDs)
9 9
 }
10 10
 \usage{
11 11
 testGene
... ...
@@ -16,13 +16,14 @@ writeFemap(df, results_file)
16 16
 table of gene enrichment and depletion results formatted as a
17 17
 'Generic results file'. Rows represent tested pathways. Columns represent:
18 18
 \itemize{
19
-   \item pathway -- pathway ID (must match pathway IDs in the GMT file provided to plotFemap());
20
-   \item description -- gene-set name or description;
21
-   \item pvalue -- enrichment pvalue;
22
-   \item qvalue -- BH-corrected pvalue;
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)
19
+    \item pathway -- pathway ID (must match pathway IDs in the GMT file
20
+        provided to plotFemap());
21
+    \item description -- pathway name or description;
22
+    \item pvalue -- enrichment pvalue;
23
+    \item qvalue -- BH-corrected pvalue;
24
+    \item status -- +1 or -1, to identify enrichment in either of the two
25
+        phenotypes being compared in the two-class analysis
26
+        (+1 maps to red, -1 maps to blue)
26 27
 }
27 28
 }
28 29
 \description{
... ...
@@ -14,9 +14,9 @@ writePathways(pathways, gmt_file)
14 14
 \value{
15 15
 GMT-formatted file. Rows represent pathways. Columns represent:
16 16
 \itemize{
17
- \item pathway ID;
18
- \item description;
19
- \item a list of tab-delimited genes
17
+    \item pathway ID;
18
+    \item description;
19
+    \item a list of tab-delimited genes
20 20
 }
21 21
 }
22 22
 \description{