% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/reverseMedianNormalize.R
\name{reverseMedianNormalize}
\alias{reverseMedianNormalize}
\title{Reverse Median Normalization from Study Samples}
\usage{
reverseMedianNormalize(adat, verbose = TRUE)
}
\arguments{
\item{adat}{A \code{soma_adat} object with study samples that have been median normalized}

\item{verbose}{Logical. Should progress messages be printed? Default is \code{TRUE}.}
}
\value{
A \code{soma_adat} object with median normalization reversed for study samples.
QC, Calibrator, and Buffer samples retain their original normalization.
The \code{ProcessSteps} header is updated to reflect the reversal operation,
and median normalization-specific metadata fields are cleared.
}
\description{
Reverses median normalization (including ANML) that was
previously applied to study samples (\code{SampleType == "Sample"}). This function
is designed to work with standard SomaScan deliverable ADAT files where
study samples have undergone median normalization as the final processing step.

This function validates that:
\enumerate{
\item Study samples have a median normalization step applied
\item The normalization was the last transformation applied to study samples
\item The correct reversal method is applied based on the normalization type
}
}
\section{Use Cases}{

\itemize{
\item Converting from normalized ADAT to unnormalized ADAT for custom normalization
\item Preparing normalized delivery data for use with \code{medianNormalize()} function
\item Backing out normalization to apply different normalization strategies
}
}

\section{Data Requirements}{

\itemize{
\item ADAT file with study samples (\code{SampleType == "Sample"}) that have been
median normalized (either standard median normalization or ANML)
\item Intact header metadata with \code{ProcessSteps} field indicating the
normalization history
\item Median normalization must be the last processing step applied to study samples
}
}

\examples{
\dontrun{
# Reverse normalization from a delivered ADAT file
normalized_adat <- read_adat("normalized_study_data.adat")
unnormalized_adat <- reverseMedianNormalize(normalized_adat)
}
}
