cluster_features: Cluster correlated features

Description Usage Arguments Value See Also Examples

View source: R/feature_clustering.R

Description

Clusters features potentially originating from the same compound. Features with high Pearson correlation coefficient and small retention time difference are linked together. Then clusters are formed by setting a threshold for the relative degree that each node in a cluster needs to fulfil. Each cluster is named after the feature with the highest median peak area (median abundance) This is a wrapper around numerous functions that are based on the MATLAB code by David Broadhurst.

Usage

1
2
3
cluster_features(object, all_features = FALSE, rt_window = 1/60,
  corr_thresh = 0.9, d_thresh = 0.8, mz_col = NULL, rt_col = NULL,
  plotting = FALSE, min_size_plotting = 3, prefix = NULL)

Arguments

object

a MetaboSet object

all_features

logical, should all features be included in the clustering? If FALSE as the default, flagged features are not included in clustering

rt_window

the retention time window for potential links NOTE: use the same unit as the retention time

corr_thresh

the correlation threshold required for potential links between features

d_thresh

the threshold for the relative degree required by each node

mz_col

the column name in fData(object) that holds mass-to-charge ratios

rt_col

the column name in fData(object) that holds retention times

plotting

should plots be drawn for each cluster?

min_size_plotting

the minimum number of features a cluster needs to have to be plotted

prefix

the prefix to the files to be plotted

Value

a MetaboSet object, with median peak area (MPA), the cluster ID, the features in the cluster, and cluster size added to results.

See Also

find_connections, find_clusters, visualize_clusters, assign_cluster_id, compress_clusters

Examples

1
2
# The parameters are really weird because example data is imaginary
clustered <- cluster_features(example_set, rt_window = 1, corr_thresh = 0.5, d_thresh = 0.6)

antonvsdata/amp documentation built on Jan. 8, 2020, 3:15 a.m.