Browse code

added imports, reO2 and manpage rendered

Federico Marini authored on 15/02/2021 21:24:24
Showing 3 changed files

... ...
@@ -127,7 +127,9 @@ importFrom(igraph,V)
127 127
 importFrom(igraph,add_edges)
128 128
 importFrom(igraph,as_adjacency_matrix)
129 129
 importFrom(igraph,as_incidence_matrix)
130
+importFrom(igraph,degree)
130 131
 importFrom(igraph,delete.edges)
132
+importFrom(igraph,delete_vertices)
131 133
 importFrom(igraph,get.edgelist)
132 134
 importFrom(igraph,graph.data.frame)
133 135
 importFrom(igraph,induced_subgraph)
... ...
@@ -29,8 +29,8 @@
29 29
 #' @importFrom graphics par plot
30 30
 #' @importFrom grDevices colorRampPalette rgb col2rgb
31 31
 #' @importFrom grid gpar
32
-#' @importFrom igraph add_edges as_adjacency_matrix as_incidence_matrix delete.edges
33
-#' "%du%" E "E<-" graph.data.frame induced_subgraph
32
+#' @importFrom igraph add_edges as_adjacency_matrix as_incidence_matrix degree
33
+#' delete.edges delete_vertices "%du%" E "E<-" graph.data.frame induced_subgraph
34 34
 #' make_full_graph permute.vertices strength V "V<-" vcount get.edgelist
35 35
 #' @importFrom matrixStats rowSds
36 36
 #' @importFrom methods is
... ...
@@ -16,6 +16,10 @@ ggs_backbone(
16 16
   bb_extract_alpha = 0.05,
17 17
   bb_extract_fwer = c("none", "bonferroni", "holm"),
18 18
   bb_fullinfo = FALSE,
19
+  bb_remove_singletons = TRUE,
20
+  color_graph = TRUE,
21
+  color_by_geneset = "z_score",
22
+  color_by_feature = "log2FoldChange",
19 23
   ...
20 24
 )
21 25
 }
... ...
@@ -59,6 +63,22 @@ either a simple \code{ìgraph} object with the graph backbone (if set to \code{F
59 63
 or a list object containing also the \code{backbone} object, and the gene-geneset
60 64
 graph used for the computation (if \code{TRUE})}
61 65
 
66
+\item{bb_remove_singletons}{Logical value, defines whether to remove or leave
67
+in the returned graph the nodes that are not connected to other vertices}
68
+
69
+\item{color_graph}{Logical value, specifies whether to use information about
70
+genesets or features to colorize the nodes, e.g. for this info to be used in
71
+interactive versions of the graph}
72
+
73
+\item{color_by_geneset}{Character string, corresponding to the column in
74
+\code{res_enrich} to be used for coloring the nodes if \code{bb_on} is set to "genesets".
75
+Defaults to the "z_score", which can be obtained via \code{get_aggrscores()}}
76
+
77
+\item{color_by_feature}{Character string, corresponding to the column in
78
+\code{res_de} to be used for coloring the nodes if \code{bb_on} is set to "features".
79
+Defaults to the "log2FoldChange", which should be normally included in a
80
+DESeqResults object.}
81
+
62 82
 \item{...}{Additional parameters to be passed internally}
63 83
 }
64 84
 \value{
... ...
@@ -106,16 +126,17 @@ data(res_enrich_macrophage, package = "GeneTonic")
106 126
 res_enrich <- shake_topGOtableResult(topgoDE_macrophage_IFNg_vs_naive)
107 127
 res_enrich <- get_aggrscores(res_enrich, res_de, anno_df)
108 128
 
109
-ggs <- ggs_graph(res_enrich,
110
-                 res_de,
111
-                 anno_df
112
-                )
113
-ggs_backbone <- ggs_backbone(res_enrich,
129
+ggs_bbg <- ggs_backbone(res_enrich,
114 130
                              res_de,
115 131
                              anno_df,
116 132
                              n_gs = 50,
117
-                             bb_on = "genesets"
133
+                             bb_on = "genesets",
134
+                             color_graph = TRUE,
135
+                             color_by_geneset = "z_score"
118 136
 )
119
-plot(ggs_backbone)
137
+plot(ggs_bbg)
138
+
139
+# if desired, one can also plot the interactive version
140
+visNetwork::visIgraph(ggs_bbg)
120 141
 
121 142
 }