% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pathways.R
\name{pathways}
\alias{pathways}
\alias{pathways.net_hon}
\alias{pathways.net_hypa}
\alias{pathways.netobject}
\alias{pathways.net_association_rules}
\alias{pathways.net_link_prediction}
\alias{pathways.net_mogen}
\title{Extract Pathways from Higher-Order Network Objects}
\usage{
pathways(x, ...)

\method{pathways}{net_hon}(x, min_count = 1L, min_prob = 0, top = NULL, order = NULL, ...)

\method{pathways}{net_hypa}(x, type = "all", ...)

\method{pathways}{netobject}(x, ho_method = c("hon", "hypa"), ...)

\method{pathways}{net_association_rules}(x, top = NULL, min_lift = NULL, min_confidence = NULL, ...)

\method{pathways}{net_link_prediction}(x, method = NULL, top = 10L, evidence = TRUE, max_evidence = 3L, ...)

\method{pathways}{net_mogen}(x, order = NULL, min_count = 1L, min_prob = 0, top = NULL, ...)
}
\arguments{
\item{x}{A higher-order network object (\code{net_hon},
\code{net_hypa}, or \code{net_mogen}).}

\item{...}{Additional arguments.}

\item{min_count}{Integer. Minimum transition count to include
(default: 1).}

\item{min_prob}{Numeric. Minimum transition probability to include
(default: 0).}

\item{top}{Integer or NULL. Return only the top N pathways ranked
by count (default: NULL = all).}

\item{order}{Integer or NULL. Markov order to extract. Default:
optimal order from model selection.}

\item{type}{Character. Which anomalies to include: \code{"all"}
(default), \code{"over"}, or \code{"under"}.}

\item{ho_method}{Character. Higher-order method: \code{"hon"} (default) or
\code{"hypa"}.}

\item{min_lift}{Numeric or NULL. Additional lift filter applied on top of
the object's original threshold (default: NULL).}

\item{min_confidence}{Numeric or NULL. Additional confidence filter
(default: NULL).}

\item{method}{Character or NULL. Which prediction method to use.
Default: first method in the object.}

\item{evidence}{Logical. If TRUE, include common neighbor evidence
nodes in each pathway. Default: TRUE.}

\item{max_evidence}{Integer. Maximum number of evidence nodes per
pathway (default: 3).}
}
\value{
A character vector of pathway strings in arrow notation
(e.g. \code{"A B -> C"}), suitable for
\code{cograph::plot_simplicial()}.

A character vector of pathway strings.

A character vector of pathway strings.

A character vector of pathway strings.

A character vector of pathway strings.

A character vector of pathway strings.

A character vector of pathway strings.
}
\description{
Extracts higher-order pathway strings suitable for
\code{cograph::plot_simplicial()}. Each pathway represents a
multi-step dependency: source states lead to a target state.

For \code{net_hon}: extracts edges where the source node is
higher-order (order > 1), i.e., the transitions that differ from
first-order Markov.

For \code{net_hypa}: extracts anomalous paths (over- or
under-represented relative to the hypergeometric null model).

For \code{net_mogen}: extracts all transitions at the optimal order
(or a specified order).
}
\section{Methods (by class)}{
\itemize{
\item \code{pathways(net_hon)}: Extract higher-order pathways from HON

\item \code{pathways(net_hypa)}: Extract anomalous pathways from HYPA

\item \code{pathways(netobject)}: Extract pathways from a netobject

Builds a Higher-Order Network (HON) from the netobject's sequence data
and returns the higher-order pathways. Requires that the netobject was
built from sequence data (has \code{$data}).

\item \code{pathways(net_association_rules)}: Extract pathways from association rules

Converts association rules \code{{A, B} => {C}} into pathway strings
\code{"A B -> C"} suitable for \code{cograph::plot_simplicial()}.
Antecedent items become source nodes; consequent items become the target.

\item \code{pathways(net_link_prediction)}: Extract pathways from link predictions

Converts predicted links into pathway strings for
\code{cograph::plot_simplicial()}. When \code{evidence = TRUE}
(default), each predicted edge \code{A -> B} is enriched with common
neighbors that structurally support the prediction, producing
\code{"A cn1 cn2 -> B"}.

\item \code{pathways(net_mogen)}: Extract transition pathways from MOGen

}}
\examples{
\donttest{
seqs <- list(c("A","B","C","D"), c("A","B","C","A"))
hon <- build_hon(seqs, max_order = 3)
pw <- pathways(hon)
}

trans <- list(c("A","B","C"), c("A","B"), c("B","C","D"), c("A","C","D"))
rules <- association_rules(trans, min_support = 0.3, min_confidence = 0.3,
                           min_lift = 0)
pathways(rules)

seqs <- data.frame(
  V1 = sample(LETTERS[1:5], 50, TRUE),
  V2 = sample(LETTERS[1:5], 50, TRUE),
  V3 = sample(LETTERS[1:5], 50, TRUE)
)
net <- build_network(seqs, method = "relative")
pred <- predict_links(net, methods = "common_neighbors")
pathways(pred)

}
