scvelo.utils.clean_obs_names

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 https://www.neb.com/tools-and-resources/usage-guidelines/the-genetic-code.

Parameters:
  • 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.

Returns:

Returns or updates adata with updated names of observations, and names of identified sample batches added as column “sample_batch” to .obs.

Return type:

Optional[AnnData]