Plot dynamic networks

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 be theme_void, theme_blank or theme_facet.

plot_type

Default is "ggplot", the type of figure, could be ggplot, animate or ggplotly.

layout

Default is "fruchtermanreingold", the layout of figure, could be fruchtermanreingold or kamadakawai.

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.

Value

A dynamic figure object

Examples

data("example_matrix")
network <- inferCSN(example_matrix)[1:100, ]
#>  Running for <dense matrix>.
#>  Checking input parameters.
#>  Using L0 sparse regression model.
#>  Using 1 core.
#>  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" ) } # }