Learn R Programming

cograph (version 2.0.0)

plot.cograph_motifs: Plot Network Motifs

Description

Visualize motif frequencies and their statistical significance.

Usage

# S3 method for cograph_motifs
plot(
  x,
  type = c("bar", "heatmap", "network"),
  show_nonsig = FALSE,
  top_n = NULL,
  colors = c("#2166AC", "#F7F7F7", "#B2182B"),
  ...
)

Value

A ggplot2 object (invisibly)

Arguments

x

A cograph_motifs object from motif_census()

type

Plot type: "bar" (default), "heatmap", or "network"

show_nonsig

Show non-significant motifs? Default FALSE

top_n

Show only top N motifs by |z-score|. Default NULL (all)

colors

Colors for under/neutral/over-represented. Default blue/gray/red.

...

Additional arguments passed to plotting functions

See Also

motif_census() for the analysis that produces this object

Other motifs: extract_motifs(), extract_triads(), get_edge_list(), motif_census(), motifs(), plot.cograph_motif_analysis(), subgraphs(), triad_census()

Examples

Run this code
mat <- matrix(sample(0:1, 100, replace = TRUE, prob = c(0.7, 0.3)), 10, 10)
diag(mat) <- 0
m <- motif_census(mat, directed = TRUE, n_random = 50)
plot(m)
plot(m, type = "network")

Run the code above in your browser using DataLab