czbenchmarks.tasks.single_cell ============================== .. py:module:: czbenchmarks.tasks.single_cell Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/czbenchmarks/tasks/single_cell/cross_species/index /autoapi/czbenchmarks/tasks/single_cell/perturbation/index Classes ------- .. autoapisummary:: czbenchmarks.tasks.single_cell.CrossSpeciesIntegrationTask czbenchmarks.tasks.single_cell.PerturbationTask Package Contents ---------------- .. py:class:: CrossSpeciesIntegrationTask(label_key: str) Bases: :py:obj:`czbenchmarks.tasks.base.BaseTask` Task for evaluating cross-species integration quality. This task computes metrics to assess how well different species' data are integrated in the embedding space while preserving biological signals. It operates on multiple datasets from different species. :param label_key: Key to access ground truth cell type labels in metadata .. py:attribute:: label_key .. py:property:: display_name :type: str A pretty name to use when displaying task results .. py:property:: required_inputs :type: Set[czbenchmarks.datasets.DataType] Required input data types. :returns: Set of required input DataTypes (metadata with labels) .. py:property:: required_outputs :type: Set[czbenchmarks.datasets.DataType] Required output data types. :returns: required output types from models this task to run (embedding coordinates) .. py:property:: requires_multiple_datasets :type: bool Whether this task requires multiple datasets. :returns: True as this task compares data across species .. py:method:: set_baseline(data: List[czbenchmarks.datasets.SingleCellDataset], **kwargs) :abstractmethod: Set a baseline embedding for cross-species integration. This method is not implemented for cross-species integration tasks as standard preprocessing workflows are not directly applicable across different species. :param data: List of SingleCellDataset objects from different species :param \*\*kwargs: Additional arguments passed to run_standard_scrna_workflow :raises NotImplementedError: Always raised as baseline is not implemented .. py:class:: PerturbationTask Bases: :py:obj:`czbenchmarks.tasks.base.BaseTask` Task for evaluating perturbation prediction quality. This task computes metrics to assess how well a model predicts gene expression changes in response to perturbations. Compares predicted vs ground truth perturbation effects using MSE and correlation metrics. .. py:property:: display_name :type: str A pretty name to use when displaying task results .. py:property:: required_inputs :type: Set[czbenchmarks.datasets.DataType] Required input data types. :returns: Set of required input DataTypes (ground truth perturbation effects) .. py:property:: required_outputs :type: Set[czbenchmarks.datasets.DataType] Required output data types. :returns: required output types from models this task to run (predicted perturbation effects) .. py:method:: set_baseline(data: czbenchmarks.datasets.PerturbationSingleCellDataset, gene_pert: str, baseline_type: Literal['median', 'mean'] = 'median', **kwargs) Set a baseline embedding for perturbation prediction. Creates baseline predictions using simple statistical methods (median and mean) applied to the control data, and evaluates these predictions against ground truth. :param data: PerturbationSingleCellDataset containing control and perturbed data :param gene_pert: The perturbation gene to evaluate :param baseline_type: The statistical method to use for baseline prediction (median or mean) :param \*\*kwargs: Additional arguments passed to the evaluation :returns: List of MetricResult objects containing baseline performance metrics for different statistical methods (median, mean)