dandelion.utilities.concat

dandelion.utilities.concat(arrays, check_unique=True, sep='_', suffixes=None, prefixes=None, remove_trailing_hyphen_number=False, concat_meta=True)[source]

Concatenate data frames and return as Dandelion object.

If both suffixes and prefixes are None and check_unique is True, then a sequential number suffix will be appended.

Parameters:
  • arrays (list[pd.DataFrame | Dandelion]) – List of Dandelion class objects or pandas data frames

  • check_unique (bool, optional) – Check the new index for duplicates. Otherwise defer the check until necessary. Setting to False will improve the performance of this method.

  • sep (str, optional) – the separator to append suffix/prefix.

  • suffixes (list[str] | None, optional) – List of suffixes to append to sequence_id and cell_id.

  • prefixes (list[str] | None, optional) – List of prefixes to append to sequence_id and cell_id.

  • remove_trailing_hyphen_number (bool, optional) – whether or not to remove the trailing hyphen number e.g. ‘-1’ from the cell/contig barcodes.

  • concat_meta (bool, optional) – Whether to also concatenate the existing metadata. If False, create a new Dandelion object instead.

Returns:

concatenated Dandelion object

Return type:

Dandelion

Raises:

ValueError – if both prefixes and suffixes are provided.