Generates a heatmap of sample clustering results and summarizes sample group assignments.
Details
This function:
Extracts sample cluster assignments from
metadata(expomicset)$sample_clustering
.Merges cluster labels with
colData(expomicset)
.Plots the heatmap stored in
metadata(expomicset)$sample_clustering$heatmap
.
Examples
# create example data
mae <- make_example_data(
n_samples = 30,
return_mae = TRUE
)
#> Ensuring all omics datasets are matrices with column names.
#> Creating SummarizedExperiment objects.
#> Creating MultiAssayExperiment object.
#> MultiAssayExperiment created successfully.
# determine sample clusters
mae <- run_cluster_samples(
expomicset = mae,
exposure_cols = c("exposure_pm25", "exposure_no2", "age", "bmi"),
clustering_approach = "diana"
)
#> Starting clustering analysis...
#> Optimal number of clusters for samples: 12
# plot sample clusters
sample_cluster_p <- mae |>
plot_sample_clusters(
exposure_cols = c("exposure_pm25", "exposure_no2", "age", "bmi")
)