summaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
Diffstat (limited to 'R')
-rw-r--r--R/networkplot.R15
1 files changed, 9 insertions, 6 deletions
diff --git a/R/networkplot.R b/R/networkplot.R
index 1055b08..2401cb1 100644
--- a/R/networkplot.R
+++ b/R/networkplot.R
@@ -133,7 +133,7 @@ networkplot <- function(R, groups = NULL, title = NULL){
ggraph::geom_conn_bundle(
data = con,
ggplot2::aes(
- edge_alpha = abs(.data$value),
+ edge_alpha = abs(.data$value)^2,
edge_colour = .data$value
),
tension = 0.5
@@ -153,20 +153,18 @@ networkplot <- function(R, groups = NULL, title = NULL){
ggraph::geom_node_point(
ggplot2::aes(
filter = .data$leaf,
- colour = .data$group,
fill = .data$group
),
- size = 3
+ size = 1
) +
# labels nodes and groups
ggraph::geom_node_text(
ggplot2::aes(label = .data$name),
# prevents text labels from overlapping
repel = TRUE,
- size = 3
+ size = 1
) +
- ggplot2::theme_void() +
- ggplot2::theme(legend.position = 'none')
+ ggplot2::theme_void()
if(!is.null(title)){
p <- p +
@@ -175,6 +173,11 @@ networkplot <- function(R, groups = NULL, title = NULL){
plot.title = ggplot2::element_text(hjust = 0.5)
)
}
+
+ if(!is.null(groups)){
+ p <- p +
+ ggplot2::scale_fill_discrete(name = 'Superpathway')
+ }
return(p)
}