calour.sorting.sort_by_metadata

calour.sorting.sort_by_metadata(exp: calour.experiment.Experiment, field, axis=0, inplace=False)[source]

Sort samples or features based on metadata values in the field.

Note

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

Parameters:
  • exp (Experiment) – Input experiment object.
  • 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