% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sequence-subsequences.R
\name{compare_sequence_subsequences}
\alias{compare_sequence_subsequences}
\title{Compare subsequence prevalence between groups}
\usage{
compare_sequence_subsequences(
  occurrences,
  group_col,
  test = c("auto", "chisq", "fisher"),
  p_adjust = "BH",
  min_sequence_count = 1L
)
}
\arguments{
\item{occurrences}{A non-contiguous subsequence occurrence table.}

\item{group_col}{Sequence-constant group column retained through
\code{metadata_cols} during extraction.}

\item{test}{\code{"auto"}, \code{"chisq"}, or \code{"fisher"}.}

\item{p_adjust}{Multiple-testing adjustment method.}

\item{min_sequence_count}{Minimum total sequence count per subsequence.}
}
\value{
A data frame of prevalence contrasts and adjusted p-values.
}
\description{
Performs transparent contingency-table tests on sequence-level presence.
Multiple testing is adjusted explicitly. Results are associational unless a
randomized design independently justifies causal interpretation.
}
\examples{
data <- data.frame(
  sequence_id = rep(paste0("s", 1:4), each = 4L),
  sequence_order = rep(1:4, 4L),
  state = c("A", "B", "C", "D", "A", "B", "D", "D",
            "D", "C", "B", "A", "D", "C", "A", "A"),
  group = rep(c("g1", "g2"), each = 8L)
)
occurrences <- extract_sequence_subsequences(data, metadata_cols = "group")
compare_sequence_subsequences(occurrences, "group")
}
