% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/preprocess.R
\name{clr_normalize}
\alias{clr_normalize}
\title{CLR-normalise a count table}
\usage{
clr_normalize(count_table, pseudocount = 1)
}
\arguments{
\item{count_table}{A data.frame or matrix of counts (MAGs as rows,
samples as columns).}

\item{pseudocount}{Numeric value added to all counts before
transformation. Default \code{1}.}
}
\value{
A data.frame of CLR-transformed values preserving the original
row and column names.
}
\description{
Applies centred log-ratio (CLR) transformation via
\code{\link[compositions:clr]{compositions::clr()}}, adding a pseudocount first to handle zeros.
Equivalent to the original \code{clr(as.matrix(selected_count + 1))}.
}
\note{
In the original \verb{02_Preprocessing.Rmd} the CLR output was saved
as \code{normalised_count}, but every downstream script (05_, 06_, 07_)
references \code{clr_transform_df}.  The saved RData was renamed at some
point; this function's output corresponds to both names.
}
\examples{
data(fancy_tiny_counts)
clr_df <- clr_normalize(fancy_tiny_counts[1:10, 1:10])
dim(clr_df)

}
