calour.experiment.Experiment.join_metadata_fields

Experiment.join_metadata_fields(field1, field2, newfield=None, axis=0, sep='_', inplace=True)[source]

Join two sample/feature metadata fields into a single new field

Parameters:
  • field1 (str) – Name of the first sample metadata field to join
  • field2 (str) – Name of the second sample metadata field to join
  • newfield (str or None, optional) – name of the new (joined) sample metadata field None (default) to name it as field1 + sep + field2
  • axis (0, 1, 's', or 'f', optional) – 0 or ‘s’ (default) to modify sample metadata fields; 1 or ‘f’ to modify feature metadata fields
  • sep (str, optional) – The separator between the values of the two fields when joining
  • inplace (bool, optional) – True (default) to add in current experiment, False to create a new Experiment
Returns:

with an added sample metadata field

Return type:

Experiment