powered by
Analyze recurring subgraph patterns (motifs) in networks and test their statistical significance against null models.
motif_census( x, size = 3, n_random = 100, method = c("configuration", "gnm"), directed = NULL, seed = NULL )
A cograph_motifs object containing:
cograph_motifs
counts: Motif counts in observed network
counts
null_mean: Mean counts in random networks
null_mean
null_sd: Standard deviation in random networks
null_sd
z_scores: Z-scores (observed - mean) / sd
z_scores
p_values: Two-tailed p-values
p_values
significant: Logical vector (|z| > 2)
significant
size: Motif size (3 or 4)
size
directed: Whether network is directed
directed
n_random: Number of random networks used
n_random
A matrix, igraph object, or cograph_network
Motif size: 3 (triads) or 4 (tetrads). Default 3.
Number of random networks for null model. Default 100.
Null model method: "configuration" (preserves degree) or "gnm" (preserves edge count). Default "configuration".
Logical. Treat as directed? Default auto-detected.
Random seed for reproducibility
motifs() for the unified API, extract_motifs() for detailed triad extraction, plot.cograph_motifs() for plotting
motifs()
extract_motifs()
plot.cograph_motifs()
Other motifs: extract_motifs(), extract_triads(), get_edge_list(), motifs(), plot.cograph_motif_analysis(), plot.cograph_motifs(), subgraphs(), triad_census()
extract_triads()
get_edge_list()
plot.cograph_motif_analysis()
subgraphs()
triad_census()
# Create a directed network mat <- matrix(c( 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0 ), 4, 4, byrow = TRUE) # Analyze triadic motifs m <- motif_census(mat) print(m) plot(m)
Run the code above in your browser using DataLab