scvelo.utils.clean_obs_names(adata, alphabet='[AGTCBDHKMNRSVWY]', id_length=12, inplace=True)

Clean up the obs_names.

For example an obs_name ‘sample1_AGTCdate’ is changed to ‘AGTC’ of the sample ‘sample1_date’. The sample name is then saved in obs[‘sample_batch’]. The genetic codes are identified according to according to

adata : AnnData

Annotated data matrix.

alphabet : str

Genetic code letters to be identified.

id_length : int

Length of the Genetic Codes in the samples.

inplace : bool

Whether to update adata inplace or not.

Return type:

AnnData, None


Optional[AnnData] – Returns or updates adata with the attributes obs_names: list

updated names of the observations

sample_batch: .obs

names of the identified sample batches