scvelo.utils.clean_obs_names(data, base='[AGTCBDHKMNRSVWY]', ID_length=12, copy=False)

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

data : AnnData

Annotated data matrix.

base : str

Genetic code letters to be identified.

ID_length : int

Length of the Genetic Codes in the samples.

copy : bool

Return a copy instead of writing to adata.

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