Z = (N_real - mean N_rand)/sd N_rand over a degree-preserving randomized ensemble; p = fraction of randomizations with count at or above the real count (P < 0.01 motif cutoff). Feed-forward loop and 3-cycle.
Usage
morie_motiff(
adjacency,
motif = "ffl",
n_random = 100,
seed = 0,
swaps = NULL,
preserve_mutual = TRUE
)Arguments
- adjacency
Directed 0/1 adjacency (n x n).
- motif
"ffl" or "cycle3".
- n_random
Ensemble size.
- seed
SplitMix64 seed (mirrors the Python arm).
- swaps
Edge swaps per randomization (default 10 * edges).
- preserve_mutual
TRUE (default) preserves the mutual-edge count (mfinder, Milo refs. 17-18); FALSE fixes only in/out degree.
Value
A list with elements count, z_score,
p_value, rand_mean, rand_sd, motif,
n_random, seed, method.
