def setUp(self): self.data_locator = DataLocator(f"{PROJECT_ROOT}/server/test/test_datasets/nan.h5ad") self.config = app_config(self.data_locator.path) with warnings.catch_warnings(): warnings.simplefilter("ignore", category=UserWarning) self.data = AnndataAdaptor(self.data_locator, self.config) self.data._create_schema()
def convert_pbmc3k(self, **kwargs): rand_str = random_string(8) data_locator = f"/tmp/test_{rand_str}.cxg" self.fixtures.append(data_locator) source_h5ad = anndata.read_h5ad(f"{PROJECT_ROOT}/example-dataset/pbmc3k.h5ad") write_cxg(adata=source_h5ad, container=data_locator, title="pbmc3k", **kwargs) config = app_config(data_locator) return CxgAdaptor(DataLocator(data_locator), config)
def load_dataset(self, path, extra_server_config={}, extra_dataset_config={}): config = app_config(path, extra_server_config=extra_server_config, extra_dataset_config=extra_dataset_config) loader = MatrixDataLoader(path) adaptor = loader.open(config) return adaptor
def convert_pbmc3k(self, **kwargs): random_string = "".join( random.choice(string.ascii_letters) for _ in range(8)) data_locator = f"/tmp/test_{random_string}.cxg" self.fixtures.append(data_locator) source_h5ad = anndata.read_h5ad( f"{PROJECT_ROOT}/example-dataset/pbmc3k.h5ad") write_cxg(adata=source_h5ad, container=data_locator, title="pbmc3k", **kwargs) config = app_config(data_locator) return CxgAdaptor(DataLocator(data_locator), config)
def setUp(self): config = app_config(self.data_locator, self.backed) self.data = AnndataAdaptor(DataLocator(self.data_locator), config)
def get_data(self, fixture): data_locator = f"{PROJECT_ROOT}/server/test/test_datasets/{fixture}" config = app_config(data_locator) return CxgAdaptor(DataLocator(data_locator), config)
def get_data(self, fixture): data_locator = f"{FIXTURES_ROOT}/{fixture}" config = app_config(data_locator) return CxgAdaptor(DataLocator(data_locator), config)
def setUp(self): data_locator = f"{PROJECT_ROOT}/server/test/test_datasets/pbmc3k.cxg" config = app_config(data_locator) self.data = CxgAdaptor(DataLocator(data_locator), config)