Create visualizations for motif analysis results including network diagrams of triads, bar plots of type distributions, and significance plots.
Arguments
- x
A
cograph_motif_analysisobject fromextract_motifs()- type
Plot type:
"triads"(default) Network diagrams of specific named triads, arranged in a grid. Each cell shows the three nodes and their edges.
"types"Bar chart of MAN type frequencies.
"significance"Z-score plot showing over- and under-represented types. Requires
significance = TRUEinextract_motifs()."patterns"Abstract MAN pattern diagrams showing edge structure of each triad type without specific node labels.
- n
Number of triads/patterns to show. Default 20.
- colors
Two-element color vector for the types/significance plots: first color for over-represented, second for under-represented. Default
c("#2166AC", "#B2182B")(blue/red).- res
Resolution for scaling (kept for backwards compatibility). Default 72.
- node_size
Size of nodes in triad diagrams (1-10 scale). Default 5.
- label_size
Font size for node labels (3-letter abbreviations). Default 7.
- title_size
Font size for motif type title (e.g., "120C"). Default 7.
- stats_size
Font size for statistics text (n, z, p). Default 5.
- ncol
Number of columns in the plot grid. Default 5.
- legend
Show abbreviation legend at bottom? Default TRUE.
- color
Color for nodes, edges, and labels in triad diagrams. Default
"#800020"(maroon).- spacing
Spacing multiplier between grid cells (0.5-2). Default 1.
- ...
Additional arguments (unused).
Value
Invisibly returns NULL for triad plots, or a ggplot2 object for types/significance/patterns plots.
See also
extract_motifs() for the analysis that produces this object,
motif_census() for statistical motif analysis
Other motifs:
extract_motifs(),
extract_triads(),
get_edge_list(),
motif_census(),
motifs(),
plot.cograph_motifs(),
subgraphs(),
triad_census()
Examples
if (FALSE) { # \dontrun{
Mod <- tna::tna(tna::group_regulation)
m <- extract_motifs(Mod, significance = TRUE)
# Default network diagram
plot(m)
# Customize appearance
plot(m, node_size = 0.15, label_size = 6, title_size = 9)
# Change layout
plot(m, ncol = 4, n = 12)
# Other plot types
plot(m, type = "types")
plot(m, type = "significance")
} # }
