Irene Robles
09/06/2023, 9:48 AMJuan Luis
09/06/2023, 9:53 AMIrene Robles
09/06/2023, 9:54 AMdatajoely
09/06/2023, 9:55 AMPartitionedDataSet
!Irene Robles
09/06/2023, 9:55 AMJuan Luis
09/06/2023, 10:02 AMsc.read
and adata.write
. when you get to that point, let us know!Irene Robles
09/06/2023, 10:03 AMimport scanpy as sc
from <http://kedro.io|kedro.io> import AbstractDataSet
from typing import Any, Dict
class scRNAseqDataset(AbstractDataSet):
def __init__(self, filepath):
"""Creates a new instance of scRNAseqDataset.
Args:
filepath: Path to the h5ad file.
"""
self._filepath = filepath
def _load(self) -> sc.AnnData:
return sc.read_h5ad(self._filepath)
def _save(self, data: sc.AnnData) -> None:
data.write_h5ad(self._filepath, compression = 'gzip')
def _describe(self) -> Dict[str, Any]:
return dict(filepath=self._filepath)
Juan Luis
09/06/2023, 10:08 AM