% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/loadHostData.R
\name{loadHostData}
\alias{loadHostData}
\title{Load and Normalize Host Bulk RNA-seq Data}
\usage{
loadHostData(counts, col_data = NULL, min_count = 1, assay_name = "voom")
}
\arguments{
\item{counts}{A \code{matrix} of non-negative integer counts with
genes in rows and samples in columns. Alternatively, a
\code{SummarizedExperiment} whose \code{"counts"} assay is used.}

\item{col_data}{An optional \code{data.frame} or \code{DataFrame}
of sample-level metadata. Row names must match the column names of
\code{counts}. If \code{NULL}, an empty \code{DataFrame} is used.
Default: \code{NULL}.}

\item{min_count}{A \code{numeric(1)} minimum total count per gene.
Genes with row sums below this threshold are removed before
normalization. Default: \code{1} (removes all-zero genes only).}

\item{assay_name}{A \code{character(1)} name for the voom-normalized
assay in the output \code{SummarizedExperiment}. Default:
\code{"voom"}.}
}
\value{
A \code{SummarizedExperiment} with two assays:
  \describe{
    \item{\code{"counts"}}{Raw integer count matrix.}
    \item{\code{"voom"}}{Voom-transformed log2-CPM matrix with
      TMM library size normalization applied.}
  }
  Sample metadata (if provided) is stored in \code{colData}.
}
\description{
Imports a bulk RNA-seq count matrix and applies TMM normalization
followed by limma-voom precision weighting. The result is a
\code{SummarizedExperiment} with both the raw counts and
voom-transformed log2-CPM values stored as named assays.
}
\details{
The normalization pipeline:
\enumerate{
  \item Construct a \code{DGEList} from raw counts.
  \item Apply TMM (trimmed mean of M-values) normalization via
    \code{edgeR::normLibSizes} to remove compositional bias
    between libraries.
  \item Apply \code{limma::voom} to compute log2-CPM values with
    precision weights that model the mean-variance trend. These
    weights are used downstream by \code{\link{diagnosticClassifier}}
    and \code{\link{jointDimReduction}}.
}

Genes with very low expression are not filtered here; gene filtering
is performed within \code{\link{jointDimReduction}} and
\code{\link{diagnosticClassifier}} based on expression in the matched
multi-omics dataset. Users may pre-filter genes if desired.
}
\examples{
set.seed(42)
n_genes   <- 200
n_samples <- 20
counts <- matrix(rpois(n_genes * n_samples, lambda = 150),
                 nrow = n_genes, ncol = n_samples)
rownames(counts) <- paste0("Gene", seq_len(n_genes))
colnames(counts) <- paste0("Sample", seq_len(n_samples))

col_data <- data.frame(
    condition = rep(c("ctrl", "treat"), each = 10),
    row.names = colnames(counts)
)

host_se <- loadHostData(counts, col_data = col_data)
host_se
SummarizedExperiment::assayNames(host_se)

}
\seealso{
\code{\link{loadMicrobiomeData}}, \code{\link{matchSamples}},
  \code{\link{MultiOmicsBridgeAnalysis}}
}
