calour.experiment.Experiment.sort_by_metadata

Experiment.sort_by_metadata(field, axis=0, inplace=False)[source]

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

Parameters:
  • 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