This function performs a series of checks and initial setups for input data, metadata, and parameters, ensuring everything is correctly formatted for downstream analysis.

SanityChecK(
  x,
  niter = 1000,
  K = NULL,
  meta.info,
  group.name,
  formula.str,
  verbose = TRUE,
  log = TRUE
)

Arguments

x

A matrix-like object or a SummarizedExperiment containing the data to be analyzed.

niter

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.

meta.info

Data frame. Metadata associated with the samples (columns of data.exp). If data.exp is a SummarizedExperiment, meta.info can be a vector of colData 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.