| motif_census | R Documentation |
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
)
## S3 method for class 'cograph_motifs'
print(x, ...)
x |
A matrix, igraph object, or cograph_network |
size |
Motif size: 3 (triads) or 4 (tetrads). Default 3. |
n_random |
Number of random networks for the null model. Must be a whole number of at least 2. Default 100. |
method |
Null model method: "configuration" (preserves degree) or "gnm" (preserves edge count). Default "configuration". |
directed |
Logical. Treat as directed? Default auto-detected. |
seed |
Random seed for reproducibility. Default NULL. When supplied, the caller's RNG state is saved and restored. |
... |
Passed to methods; currently unused. |
A cograph_motifs data frame with one row per motif class and
columns:
Motif class name (the 16 MAN codes for directed triads, the
four undirected triad classes, or motif_<i> labels for size 4).
Observed number of that motif in the network.
Mean and standard deviation of the count
across the n_random null graphs.
(count - null_mean) / null_sd; NA when the
null is degenerate (null_sd = 0) and the observation differs
from it.
Two-sided empirical (add-one corrected) permutation p-value, not a Gaussian approximation.
Logical, p_value < 0.05.
The motif size ("size"), directed flag ("directed"),
null-model method ("method"), and number of random networks
("n_random") are stored as attributes. Self-loops and multiple
edges are removed before counting.
motifs() for the unified API, extract_motifs() for detailed
triad extraction, plot.cograph_motifs() for plotting
Other motifs:
extract_motifs(),
extract_triads(),
get_edge_list(),
motifs(),
plot.cograph_motif_analysis(),
plot.cograph_motifs(),
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.