This function performs a series of checks and initial setups for input data, metadata, and parameters, ensuring everything is correctly formatted for downstream analysis.
Usage
SanityChecK(
x,
B = 1000,
K = NULL,
a1 = NULL,
a2 = NULL,
meta.info = NULL,
group.name = NULL,
formula.str = NULL,
verbose = TRUE,
log = TRUE
)
Arguments
- x
A matrix-like object or a
SummarizedExperiment
containing the data to be analyzed.- B
Integer. Number of bootstrap samples or resampling iterations. Default is 1000.
- K
Integer. Top list size. If NULL, it will be set to a quarter of the number of rows in the data matrix. Default is NULL.
- a1, a2
Optional numeric parameters related to optimization.
- meta.info
Data frame. Metadata associated with the samples (columns of
data.exp
). Ifdata.exp
is aSummarizedExperiment
,meta.info
can be a vector ofcolData
column names to use.- group.name
Character. Column name in
meta.info
that defines the groups or conditions for comparison.- formula.str
Optional character string representing the formula for the model.
- verbose
Logical, indicating whether to display messages during the function's execution. Default is TRUE.
- log
Logical, indicating whether the data is already log-transformed. Default is TRUE.
Value
A list containing:
meta.info
: Processed metadata.data
: Processed data matrix.groups
: Numeric or factor vector indicating group assignments.K
: Top list size to be used in the analysis.
Details
This function checks whether the input data and metadata are in the correct
format, processes metadata from a SummarizedExperiment
object if provided,
and ensures that group information is correctly specified. If no top list
size (K
) is provided, it defaults to a quarter of the number of rows in
the data.