calour.manipulation.join_experiments

calour.manipulation.join_experiments(exp: calour.experiment.Experiment, other, field_name='experiments', prefixes=None)[source]

Combine two Experiment objects into one.

A new column will be added to the combined Experiment.sample_metadata to store which of the 2 combined objects it is from.

Note

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

Parameters:
  • exp (Experiment) – Input experiment object.
  • other (Experiment) – The Experiment object to combine with the current one. If both experiments contain the same feature metadata column and there is a conflict between the two, the value will be taken from exp and not from other.
  • field_name (None or str, optional) – Name of the new sample_metdata field containing the experiment each sample is coming from. If it is None, don’t add such column.
  • prefixes (tuple of (str, str), optional) – Prefix to append to the sample_metadata index for identical samples in the 2 experiments. Required only if the two experiments share any identical sample ID
Returns:

A new experiment with samples from both experiments concatenated, features from both experiments merged.

Return type:

Experiment