% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils_provenance.R
\name{print_provenance}
\alias{print_provenance}
\title{Print metabom8 preprocessing pipeline}
\usage{
print_provenance(x, detail = FALSE, max_items = 8)
}
\arguments{
\item{x}{A metabom8 object or spectral matrix with attached
\code{"m8_prep"} provenance metadata.}

\item{detail}{Prints full information trail, incl. timestamp / versioning}

\item{max_items}{Limits individual list entries (e.g., parameter) to specified
number}
}
\value{
Invisibly returns \code{NULL}. This function is called for
its side effect of printing pipeline information.
}
\description{
Displays the recorded preprocessing history attached to a metabom8
spectral matrix. The function reads the \code{"m8_prep"} attribute
and prints each processing step in chronological order, including
parameters and notes.
}
\details{
The input can be either:
\itemize{
\item A metabom8-style list containing \code{$X}, or
\item A matrix with metabom8 provenance attributes attached.
}

If no preprocessing metadata is found, a message is printed.

metabom8 records preprocessing steps as an ordered list of
transformation descriptors stored in the \code{"m8_prep"} attribute.
Each step typically contains:
\itemize{
\item \code{step}: Name of the preprocessing operation
\item \code{params}: Parameters used
\item \code{notes}: Optional description
\item \code{time}: Timestamp
\item \code{pkg}: Package name and version
}

This function provides a compact audit trail of the processing
workflow, facilitating reproducibility and provenance inspection.
}
\examples{
params <- list(
  runtime  = "docker",
  image    = Sys.getenv("IMAGE", "docker-image-dummy"),
  workflow = Sys.getenv("M8_WORKFLOW", "std_prof-urine"),
  agent    = paste0("snakemake/", Sys.getenv("SNAKEMAKE_VERSION", "v?")),
  run_id   = Sys.getenv("M8_RUN_ID", "m8-2605-001")
)

data(hiit_raw)
print_provenance(hiit_raw)

hiit_proc <- hiit_raw |>
  calibrate(type = "tsp") |>
  excise() |>
  add_note('dilution-adaptive acquisition mode -> verify snr after normalisation',
    params)

print_provenance(hiit_proc)
}
\seealso{
Other provenance: 
\code{\link{add_note}()},
\code{\link{get_provenance}()}
}
\concept{provenance}
