c2v.pp.make_unique_clones

c2v.pp.make_unique_clones#

c2v.pp.make_unique_clones(adata, injection_cols, na_value='NA', final_obs_name='clone')#

Prepares a clone2vec-friendly AnnData object by handling multiple clonal labels per cell. Duplicates cells with multiple clonal labels into separate rows for each unique clone label.

Parameters:
adata AnnData

Annotated data matrix containing the clonal labels across multiple columns.

injection_cols list[str]

List of column names in adata.obs that contain the clonal labels.

na_value str, optional

The value used to indicate missing or absent clonal information. Default is “NA”.

final_obs_name str, optional

The name of the new column in adata.obs to store the merged clone labels. Default is “clone”.

Return type:

AnnData

Returns:

AnnData A new AnnData object with cells duplicated where necessary, with updated clonal labeling in the final_obs_name column.