regvelo.preprocessing.preprocess_data

regvelo.preprocessing.preprocess_data(adata, spliced_layer='Ms', unspliced_layer='Mu', min_max_scale=True, filter_on_r2=True)[source]

Preprocess an AnnData object.

This function optionally applies min-max scaling to the spliced and unspliced layers, and filters genes based on the velocity regression results (velocity_r2 and gamma).

Parameters:
  • adata (AnnData) – Annotated data object.

  • spliced_layer (str) – Name of the spliced layer.

  • unspliced_layer (str) – Name of the unspliced layer.

  • min_max_scale (bool) – Whether to apply min-max scaling to the spliced and unspliced layers.

  • filter_on_r2 (bool) – Whether to filter genes based on the velocity regression results.

Return type:

AnnData

Returns:

: Preprocessed annotated data object.