calour.sorting.sort_samples

calour.sorting.sort_samples(exp: calour.experiment.Experiment, field, **kwargs)[source]

Sort samples by field A convenience function for sort_by_metadata

Note

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

Parameters:
  • exp (Experiment) – Input experiment object.
  • field (str) – The field to sort the samples by
Keyword Arguments:
 
  • field (str) – Name of the field to sort by
  • axis (0, 1, 's', or 'f') – sort by samples (0 or ‘s’) or by features (1 or ‘f’), i.e. the field is a column in sample_metadata (0 or ‘s’) or feature_metadata (1 or ‘f’)
  • inplace (bool, optional) – False (default) to create a copy True to Replace data in exp
Returns:

Return type:

Experiment with samples sorted according to values in field