% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sequence-subsequences.R
\name{extract_sequence_subsequences}
\alias{extract_sequence_subsequences}
\title{Extract bounded non-contiguous sequence subsequences}
\usage{
extract_sequence_subsequences(
  data,
  sequence_id_col = "sequence_id",
  order_col = "sequence_order",
  state_col = "state",
  metadata_cols = NULL,
  min_length = 2L,
  max_length = 5L,
  max_gap = Inf,
  max_span = Inf,
  repeated_state_policy = c("preserve", "collapse"),
  separator = " > ",
  max_combinations_per_sequence = 100000L
)
}
\arguments{
\item{data}{Long-format sequence data or a prepared result.}

\item{sequence_id_col, order_col, state_col}{Core sequence columns.}

\item{metadata_cols}{Optional sequence-constant metadata retained as
attributes.}

\item{min_length, max_length}{Minimum and maximum subsequence lengths.}

\item{max_gap}{Maximum number of skipped positions between adjacent selected
states. Use \code{Inf} for no restriction.}

\item{max_span}{Maximum difference between the first and last selected
sequence positions. Use \code{Inf} for no restriction.}

\item{repeated_state_policy}{Preserve or collapse consecutive repeated
states before mining.}

\item{separator}{Separator used in stable motif labels.}

\item{max_combinations_per_sequence}{Safety limit for the number of index
combinations considered for any one sequence.}
}
\value{
A data frame of class \code{gp3_sequence_subsequences}, with one row per
qualifying occurrence.
}
\description{
Enumerates ordered non-contiguous subsequences under explicit length, gap,
span, and safety limits. The implementation is transparent and intended for
modest sequence collections; specialist mining packages remain preferable
for very large search spaces.
}
\examples{
sequences <- data.frame(
  sequence_id = rep(c("s1", "s2"), each = 5L),
  sequence_order = rep(1:5, times = 2L),
  state = c("A", "B", "C", "D", "E", "A", "C", "B", "D", "E")
)
extract_sequence_subsequences(sequences, min_length = 2L, max_length = 3L,
                              max_gap = 2L)
}
