Manipulation#

SingleCell.set_obs_names

Sets a column as the new first column of obs, i.e. the obs_names.

SingleCell.set_var_names

Sets a column as the new first column of var, i.e. the var_names.

SingleCell.set_num_threads

Return a new SingleCell dataset with a different default number of threads.

SingleCell.make_obs_names_unique

Make obs_names unique by appending '-1' to the second occurence of a given name, '-2' to the third occurrence, and so on, where '-' can be switched to a different string via the separator argument.

SingleCell.make_var_names_unique

Make var_names unique by appending '-1' to the second occurence of a given name, '-2' to the third occurrence, and so on, where '-' can be switched to a different string via the separator argument.

SingleCell.filter_obs

Equivalent to df.filter() from polars, but applied to both obs/obsm and X.

SingleCell.filter_var

Equivalent to df.filter() from polars, but applied to both var/varm and X.

SingleCell.select_obs

Equivalent to df.select() from polars, but applied to obs.

SingleCell.select_var

Equivalent to df.select() from polars, but applied to var.

SingleCell.select_obsm

Subsets obsm to the specified key(s).

SingleCell.select_varm

Subsets varm to the specified key(s).

SingleCell.select_obsp

Subsets obsp to the specified key(s).

SingleCell.select_varp

Subsets varp to the specified key(s).

SingleCell.select_uns

Subsets uns to the specified key(s).

SingleCell.with_columns_obs

Equivalent to df.with_columns() from polars, but applied to obs.

SingleCell.with_columns_var

Equivalent to df.with_columns() from polars, but applied to var.

SingleCell.with_obsm

Adds one or more keys to obsm, overwriting existing keys with the same names if present.

SingleCell.with_varm

Adds one or more keys to varm, overwriting existing keys with the same names if present.

SingleCell.with_obsp

Adds one or more keys to obsp, overwriting existing keys with the same names if present.

SingleCell.with_varp

Adds one or more keys to varp, overwriting existing keys with the same names if present.

SingleCell.with_uns

Adds one or more keys to uns, overwriting existing keys with the same names if present.

SingleCell.drop_X

Create a new SingleCell dataset with X removed, to reduce memory use.

SingleCell.drop_obs

Create a new SingleCell dataset with columns and more_columns removed from obs.

SingleCell.drop_var

Create a new SingleCell dataset with columns and more_columns removed from var.

SingleCell.drop_obsm

Create a new SingleCell dataset with keys and more_keys removed from obsm.

SingleCell.drop_varm

Create a new SingleCell dataset with keys and more_keys removed from varm.

SingleCell.drop_obsp

Create a new SingleCell dataset with keys and more_keys removed from obsp.

SingleCell.drop_varp

Create a new SingleCell dataset with keys and more_keys removed from varp.

SingleCell.drop_uns

Create a new SingleCell dataset with keys and more_keys removed from uns.

SingleCell.rename_obs

Create a new SingleCell dataset with column(s) of obs renamed.

SingleCell.rename_var

Create a new SingleCell dataset with column(s) of var renamed.

SingleCell.rename_obsm

Create a new SingleCell dataset with key(s) of obsm renamed.

SingleCell.rename_varm

Create a new SingleCell dataset with key(s) of varm renamed.

SingleCell.rename_obsp

Create a new SingleCell dataset with key(s) of obsp renamed.

SingleCell.rename_varp

Create a new SingleCell dataset with key(s) of varp renamed.

SingleCell.rename_uns

Create a new SingleCell dataset with key(s) of uns renamed.

SingleCell.cast_X

Cast X to the specified data type.

SingleCell.cast_obs

Cast column(s) of obs to the specified data type(s).

SingleCell.cast_var

Cast column(s) of var to the specified data type(s).

SingleCell.join_obs

Left-join obs with another DataFrame, using the same logic as polars.DataFrame.join().

SingleCell.join_var

Left-join var with another DataFrame, using the same logic as polars.DataFrame.join().

SingleCell.subsample_obs

Subsample a specific number or fraction of cells.

SingleCell.subsample_var

Subsample a specific number or fraction of genes.

SingleCell.tocsr

Make a copy of this SingleCell dataset, converting X to a csr_array.

SingleCell.tocsc

Make a copy of this SingleCell dataset, converting X to a csc_array.