veloev.postprocessing package#

Submodules#

veloev.postprocessing.postprocess module#

veloev.postprocessing.postprocess.check_save_summarize_info(info_dict, save=True, file_path='benchmark_info.pkl')[source]#

Validates, saves, and summarizes the benchmark configuration. Updated to support ‘seq_depth’ variations of dataset types.

Return type:

DataFrame

veloev.postprocessing.postprocess.postprocess(methods, task, k_fold, cluster_key=None, time_key=None, basis='umap', result_path='./', n_jobs=8, scale=30.0)[source]#

Post-processes for RNA velocity methods.

This function iterates through specified methods and cross-validation folds, loading the resulting AnnData objects. It computes velocity graphs, embeddings, pseudotime, and transition matrices based on the task (e.g., specific flags for directional consistency or temporal precision). The processed results are saved as pickle files for downstream evaluation.

Parameters:
  • methods (List[str]) – A list of method names to process (e.g., [‘scvelo’, ‘unitvelo’]).

  • task (str) – evaluation task. Determines which metrics are computed. Options include: - ‘directional’: Computes velocity graph and embeddings. - ‘temporal’: Computes pseudotime. - ‘negative_control’: Computes transition matrices. - ‘directional_temporal’: Computes both Directional and Temporal metrics. - ‘simulation’: Handles ground truth velocity comparison. - ‘seq_depth_directional’: Directional metrics with sequencing depth variation. - ‘seq_depth_temporal’: Temporal metrics with sequencing depth variation. - ‘seq_depth_directional_temporal’: Both Directional and Temporal metrics with sequencing depth variation.

  • k_fold (int) – The number of cross-validation folds. Set to 0 for full data processing.

  • cluster_key (Optional[str], optional) – Key in adata.obs storing cell type/cluster labels. Defaults to None.

  • time_key (Optional[str], optional) – Key in adata.obs storing ground truth time labels. Defaults to None.

  • basis (str, optional) – The embedding basis to use for visualization (e.g., ‘umap’, ‘pca’). Defaults to ‘umap’.

  • result_path (Union[str, Path], optional) – Path to the directory containing raw results. Defaults to ‘./’.

  • n_jobs (int, optional) – Number of parallel jobs for velocity graph computation. Defaults to 8.

  • scale (float, optional) – Scale factor for transition matrix computation. Defaults to 30.0.

Raises:
  • ValueError – If neither cluster_key nor time_key is provided.

  • ValueError – If the provided keys do not exist in adata.obs.

Returns:

Results are saved to disk in the ‘{result_path}/postprocess’ directory.

Return type:

None

veloev.postprocessing.postprocess.run_postprocessing(benchmark_info, base_dir='./', n_jobs=8)[source]#

Runs the post-processing step for all datasets defined in benchmark_info.

Parameters:
  • benchmark_info (dict) – The benchmark configuration dictionary.

  • base_dir (str) – The base directory where dataset results are stored. Defaults to ‘./’.

  • n_jobs (int) – Number of cores to use for processing. Defaults to 20.

veloev.postprocessing.utils module#

veloev.postprocessing.utils.fill_in_neighbors_indices(adata)[source]#

Module contents#