Plot dynamic networks
Usage
plot_dynamic_networks(
network_table,
celltypes_order,
ntop = 10,
title = NULL,
theme_type = "theme_void",
plot_type = "ggplot",
layout = "fruchtermanreingold",
nrow = 2,
figure_save = FALSE,
figure_name = NULL,
figure_width = 6,
figure_height = 6,
seed = 1
)
Arguments
- network_table
The weight data table of network.
- celltypes_order
The order of cell types.
- ntop
The number of top genes to plot.
- title
The title of figure.
- theme_type
Default is
theme_void
, the theme of figure, could betheme_void
,theme_blank
ortheme_facet
.- plot_type
Default is
"ggplot"
, the type of figure, could beggplot
,animate
orggplotly
.- layout
Default is
"fruchtermanreingold"
, the layout of figure, could befruchtermanreingold
orkamadakawai
.- nrow
The number of rows of figure.
- figure_save
Default is
FALSE
, Logical value, whether to save the figure file.- figure_name
The name of figure file.
- figure_width
The width of figure.
- figure_height
The height of figure.
- seed
Default is
1
, the seed random use to plot network.
Examples
data("example_matrix")
network <- inferCSN(example_matrix)[1:100, ]
#> ℹ [2025-05-07 09:38:42] Running for <dense matrix>.
#> ℹ [2025-05-07 09:38:42] Checking input parameters.
#> ℹ [2025-05-07 09:38:42] Using L0 sparse regression model.
#> ℹ [2025-05-07 09:38:42] Using 1 core
#> ✔ [2025-05-07 09:38:42] Run done.
network$celltype <- c(
rep("cluster1", 20),
rep("cluster2", 20),
rep("cluster3", 20),
rep("cluster5", 20),
rep("cluster6", 20)
)
celltypes_order <- c(
"cluster5", "cluster3",
"cluster2", "cluster1",
"cluster6"
)
plot_dynamic_networks(
network,
celltypes_order = celltypes_order
)
plot_dynamic_networks(
network,
celltypes_order = celltypes_order[1:3]
)
plot_dynamic_networks(
network,
celltypes_order = celltypes_order,
plot_type = "ggplotly"
)
if (FALSE) { # \dontrun{
# If setting `plot_type = "animate"` to plot and save `gif` figure,
# please install `gifski` package first.
plot_dynamic_networks(
network,
celltypes_order = celltypes_order,
plot_type = "animate"
)
} # }