% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/SplitRW.R
\name{SplitRW}
\alias{SplitRW}
\title{SplitRW}
\usage{
SplitRW(
  MB = MB,
  checkSampleCorrespondence = FALSE,
  batchNormalisation = TRUE,
  showSampleCorrespondence = TRUE
)
}
\arguments{
\item{MB}{A \code{MultiBlock} object built with \code{\link{MultiBlock}()}. Must contain
\code{Batch} information; blocks without batch labels are treated as a single batch.}

\item{checkSampleCorrespondence}{Logical. If \code{FALSE} (default), identical sample order
and count are assumed across all batches and only the minimum batch size is used. If
\code{TRUE}, sample names are intersected across all batches and only common samples are
retained, which is safer when batches have different sizes or orderings.}

\item{batchNormalisation}{Logical. If \code{TRUE} (default), each replicate block is divided
by its Frobenius norm and by the square root of the number of replicates in its original
block, to prevent blocks with more replicates from dominating the analysis.}

\item{showSampleCorrespondence}{Logical. If \code{TRUE} (default), the matrix of sample
names assigned to each replicate block is printed to the console via \code{print()}.
Set to \code{FALSE} to suppress this output.}
}
\value{
A \code{MultiBlock} object in which each block corresponds to one batch of one
  original data block (a replicate-wise structure ready for \code{\link{ComDim_PCA}} or
  similar).
}
\description{
Splits a multi-block into a replicate-wise (RW) structure by expanding each block along its
batch dimension. Each batch within each original block becomes a separate block in the output,
enabling replicate-wise ComDim analysis.
}
\details{
Output block names follow the convention \code{<original_block>} when the original block has
  only one batch, or \code{<original_block>_<batch_label>} when it has multiple batches.
  The \code{Metadata} slot of each source block is also split and carried over to the
  corresponding replicate blocks. If the MultiBlock has no \code{Batch} information at all,
  the original object is returned unchanged with a warning.
}
\examples{
b1 <- matrix(rnorm(1500), 30, 50)
b2 <- matrix(rnorm(2400), 30, 80)
batch_b <- c(rep(1, 10), rep(2, 10), rep(3, 10))
# Generate the multi-block (mb) with 3 batches of 10 samples each
mb <- MultiBlock(
  Data = list(b1 = b1, b2 = b2),
  Batch = list(b1 = batch_b, b2 = batch_b),
  ignore.names = TRUE
)
rw <- SplitRW(mb)
}
\seealso{
\code{\link{MultiBlock}}, \code{\link{ComDim_PCA}}, \code{\link{SelectFeaturesRW}}
}
