Removes exposure variables that deviate significantly from a normal distribution based on normality test results stored in metadata.
Details
The function identifies exposure variables that fail a normality test
using metadata(expomicset)$transformation$norm_df
.
Exposure variables with
p.value < p_thresh
are removed fromcolData(expomicset)
.The same filtering is applied to
colData
in each experiment withinexperiments(expomicset)
.
Examples
# Create example data
mae <- make_example_data(
n_samples = 20,
return_mae = TRUE
)
#> Ensuring all omics datasets are matrices with column names.
#> Creating SummarizedExperiment objects.
#> Creating MultiAssayExperiment object.
#> MultiAssayExperiment created successfully.
# Test for normality
mae <- mae |>
run_normality_check() |>
transform_exposure(exposure_cols = c("age", "bmi", "exposure_pm25"))
#> Checking Normality Using Shapiro-Wilk Test
#> 2 Exposure Variables are Normally Distributed
#> 2 Exposure Variables are NOT Normally Distributed
#> Applying the boxcox_best transformation.
# Remove non-normal variables
mae_filtered <- mae |>
filter_non_normal()
#> Filtering out 0 non-normal exposure variables.