czbenchmarks.datasets.single_cell_labeled ========================================= .. py:module:: czbenchmarks.datasets.single_cell_labeled Attributes ---------- .. autoapisummary:: czbenchmarks.datasets.single_cell_labeled.logger Classes ------- .. autoapisummary:: czbenchmarks.datasets.single_cell_labeled.SingleCellLabeledDataset Module Contents --------------- .. py:data:: logger .. py:class:: SingleCellLabeledDataset(path: pathlib.Path, organism: czbenchmarks.datasets.types.Organism, label_column_key: str = 'cell_type', task_inputs_dir: Optional[pathlib.Path] = None) Bases: :py:obj:`czbenchmarks.datasets.single_cell.SingleCellDataset` Single cell dataset containing gene expression data and a label column. This class extends `SingleCellDataset` to include a label column that contains the expected prediction values for each cell. The labels are extracted from the specified column in `adata.obs` and stored as a `pd.Series` in the `labels` attribute. .. attribute:: labels Extracted labels for each cell. :type: pd.Series .. attribute:: label_column_key Key for the column in `adata.obs` containing the labels. :type: str Initialize a SingleCellLabeledDataset instance. :param path: Path to the dataset file. :type path: Path :param organism: Enum value indicating the organism. :type organism: Organism :param label_column_key: Key for the column in `adata.obs` containing the labels. Defaults to "cell_type". :type label_column_key: str :param task_inputs_dir: Directory for storing task-specific inputs. :type task_inputs_dir: Optional[Path] .. py:attribute:: labels :type: pandas.Series .. py:attribute:: label_column_key :type: str .. py:method:: load_data() -> None Load the dataset and extract labels. This method loads the dataset using the parent class's `load_data` method and extracts the labels from the specified column in `adata.obs`. Populates: labels (pd.Series): Extracted labels for each cell. .. py:method:: store_task_inputs() -> pathlib.Path Store task-specific inputs, such as cell type annotations. This method stores the extracted labels in a JSON file. The filename is dynamically generated based on the `label_column_key`. :returns: Path to the directory storing the task input files. :rtype: Path