calour.sorting.cluster_features

calour.sorting.cluster_features(exp: calour.experiment.Experiment, min_abundance=0, inplace=False, **kwargs)[source]

Cluster features.

Cluster is done after filtering of minimal abundance, log transforming, and scaling on features.

Note

This function is also available as a class method Experiment.cluster_features()

Parameters:
  • exp (Experiment) – Input experiment object.
  • min_abundance (Number, optional) – filter away features less than min_abundance. Default to 0.
Keyword Arguments:
 
  • aixs (0, 1, 's', or 'f', optional) – ‘f’ or 1 (default) means clustering features; ‘s’ or 0 means clustering samples
  • transform (Callable) – a callable transform on a 2-d matrix. Input and output of transform are Experiment. The transform function can modify Experiment.data (it is a copy). It should not change the dimension of Experiment.data.
  • metric (str or callable) – the clustering metric to use. It should be able to be passed to scipy.spatial.distance.pdist.
  • inplace (bool, optional) – False (default) to create a copy. True to Replace data in exp.
Returns:

object with features filtered, log transformed and scaled.

Return type:

Experiment

See also

cluster_data(), transform(), log_n(), scale()