calour.amplicon_experiment.AmpliconExperiment.sort_ids

AmpliconExperiment.sort_ids(ids, axis=1, inplace=False)[source]

Sort the features or samples by the given ids.

If ids are not cover the all the features (samples), the rest will be unsorted and appended.

Parameters:
  • ids (list of str) – The ids to put first in the new experiment
  • 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 of the experiment, True to filter inplace
Returns:

with features/samples first according to the ids list and then the rest

Return type:

Experiment