rename_obs#

Pseudobulk.rename_obs(mapping, /, *, cell_types=None, excluded_cell_types=None)[source]#

Create a new Pseudobulk dataset with column(s) of obs renamed for each cell type.

Parameters:
  • mapping: dict[str, str] | Callable[[str], str]

    the renaming to apply, either as a dictionary with the old names as keys and the new names as values, or a function that takes an old name and returns a new name

  • cell_types: str | Iterable[str] | None

    one or more cell types to operate on; if None, operate on all cell types. Mutually exclusive with excluded_cell_types.

  • excluded_cell_types: str | Iterable[str] | None

    one or more cell types to exclude from the operation; mutually exclusive with cell_types

Returns:

A new Pseudobulk dataset with the column(s) of obs renamed.

Return type:

Pseudobulk