Skip to contents

This function compresses clusters found by cluster_features, keeping only the feature with the highest median peak area. The features that were discarded are recorded in feature data, under Cluster_features.

Usage

compress_clusters(object)

Arguments

object

a SummarizedExperiment or MetaboSet object

Value

A SummarizedExperiment or MetaboSet object with only one feature per cluster.

See also

Examples

data(example_set)
clustered <- cluster_features(example_set, 
  rt_window = 1, corr_thresh = 0.5, d_thresh = 0.6)
#> INFO [2025-06-23 22:36:28] Identified m/z column Average_Mz and retention time column Average_Rt_min
#> INFO [2025-06-23 22:36:28] Identified m/z column Average_Mz and retention time column Average_Rt_min
#> INFO [2025-06-23 22:36:28] Identified m/z column Average_Mz and retention time column Average_Rt_min
#> INFO [2025-06-23 22:36:28] 
#> Starting feature clustering at 2025-06-23 22:36:28.829927
#> INFO [2025-06-23 22:36:28] Finding connections between features in HILIC_neg
#> INFO [2025-06-23 22:36:28] Found 1 connections in HILIC_neg
#> INFO [2025-06-23 22:36:28] Finding connections between features in HILIC_pos
#> INFO [2025-06-23 22:36:28] Found 4 connections in HILIC_pos
#> INFO [2025-06-23 22:36:28] Finding connections between features in RP_neg
#> INFO [2025-06-23 22:36:29] Found 1 connections in RP_neg
#> INFO [2025-06-23 22:36:29] Finding connections between features in RP_pos
#> INFO [2025-06-23 22:36:29] Found 2 connections in RP_pos
#> INFO [2025-06-23 22:36:29] Found 8 connections
#> 5 components found
#> 1 components found
#> INFO [2025-06-23 22:36:29] Found 5 clusters of 2 or more features, clustering finished at 2025-06-23 22:36:29.211733
#> INFO [2025-06-23 22:36:29] Saved cluster plots to: 
compressed <- compress_clusters(clustered)
#> INFO [2025-06-23 22:36:29] Clusters compressed, left with 73 features