% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/motifs.R
\name{motif_census}
\alias{motif_census}
\title{Network Motif Analysis}
\usage{
motif_census(
  x,
  size = 3,
  n_random = 100,
  method = c("configuration", "gnm"),
  directed = NULL,
  seed = NULL
)
}
\arguments{
\item{x}{A matrix, igraph object, or cograph_network}

\item{size}{Motif size: 3 (triads) or 4 (tetrads). Default 3.}

\item{n_random}{Number of random networks for null model. Default 100.}

\item{method}{Null model method: "configuration" (preserves degree) or
"gnm" (preserves edge count). Default "configuration".}

\item{directed}{Logical. Treat as directed? Default auto-detected.}

\item{seed}{Random seed for reproducibility}
}
\value{
A \code{cograph_motifs} object containing:
\itemize{
\item \code{counts}: Motif counts in observed network
\item \code{null_mean}: Mean counts in random networks
\item \code{null_sd}: Standard deviation in random networks
\item \code{z_scores}: Z-scores (observed - mean) / sd
\item \code{p_values}: Two-tailed p-values
\item \code{significant}: Logical vector (|z| > 2)
\item \code{size}: Motif size (3 or 4)
\item \code{directed}: Whether network is directed
\item \code{n_random}: Number of random networks used
}
}
\description{
Analyze recurring subgraph patterns (motifs) in networks and test their
statistical significance against null models.
}
\examples{
# 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)

}
\seealso{
\code{\link[=motifs]{motifs()}} for the unified API, \code{\link[=extract_motifs]{extract_motifs()}} for detailed
triad extraction, \code{\link[=plot.cograph_motifs]{plot.cograph_motifs()}} for plotting

Other motifs: 
\code{\link{extract_motifs}()},
\code{\link{extract_triads}()},
\code{\link{get_edge_list}()},
\code{\link{motifs}()},
\code{\link{plot.cograph_motif_analysis}()},
\code{\link{plot.cograph_motifs}()},
\code{\link{subgraphs}()},
\code{\link{triad_census}()}
}
\concept{motifs}
\keyword{internal}
