Compress clusters of features to a single feature
Source:R/feature_clustering.R
compress_clusters.RdThis 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.
Arguments
- object
a
SummarizedExperimentobject
Examples
data(toy_notame_set)
clustered <- cluster_features(toy_notame_set,
rt_window = 1, corr_thresh = 0.5, d_thresh = 0.6)
#> INFO [2025-10-29 12:02:54] Identified m/z column Average_Mz and retention time column Average_Rt_min
#> INFO [2025-10-29 12:02:54] Identified m/z column Average_Mz and retention time column Average_Rt_min
#> INFO [2025-10-29 12:02:54] Identified m/z column Average_Mz and retention time column Average_Rt_min
#> INFO [2025-10-29 12:02:54]
#> Starting feature clustering at 2025-10-29 12:02:54.255442
#> INFO [2025-10-29 12:02:54] Finding connections between features in HILIC_neg
#> INFO [2025-10-29 12:02:54] Found 1 connections in HILIC_neg
#> INFO [2025-10-29 12:02:54] Finding connections between features in HILIC_pos
#> INFO [2025-10-29 12:02:54] Found 4 connections in HILIC_pos
#> INFO [2025-10-29 12:02:54] Finding connections between features in RP_neg
#> INFO [2025-10-29 12:02:54] Found 1 connections in RP_neg
#> INFO [2025-10-29 12:02:54] Finding connections between features in RP_pos
#> INFO [2025-10-29 12:02:54] Found 2 connections in RP_pos
#> INFO [2025-10-29 12:02:54] Found 8 connections
#> 5 components found
#> 1 components found
#> INFO [2025-10-29 12:02:54] Found 5 clusters of 2 or more features, clustering finished at 2025-10-29 12:02:54.289561
compressed <- compress_clusters(clustered)
#> INFO [2025-10-29 12:02:54] Clusters compressed, left with 73 features