scvelo.utils.clean_obs_names

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

Cleans up the obs_names and identifies sample names. For example an obs_name ‘samlple1_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.

base : str (default: [AGTCBDHKMNRSVWY])

Genetic code letters to be identified.

ID_length : int (default: 12)

Length of the Genetic Codes in the samples.

copy : bool (default: False)

Return a copy instead of writing to adata.

Returns:

  • Returns or updates adata with the attributes
  • obs_names (list) – updated names of the observations
  • sample_batch (.obs) – names of the identified sample batches