From c984d9146439597e94e7bd1c300cef872491f98a Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Thu, 25 Mar 2021 06:52:16 +0100 Subject: [PATCH] fixed data simulation bug --- scaden/simulation/bulk_simulator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scaden/simulation/bulk_simulator.py b/scaden/simulation/bulk_simulator.py index fee9e64..80cf959 100644 --- a/scaden/simulation/bulk_simulator.py +++ b/scaden/simulation/bulk_simulator.py @@ -68,7 +68,7 @@ def simulate(self): files = glob.glob(os.path.join(self.data_path, self.pattern)) files = [os.path.basename(x) for x in files] self.datasets = [x.replace(self.pattern.replace("*", ""), "") for x in files] - self.dataset_files = [x + ".h5ad" for x in self.datasets] + self.dataset_files = [os.path.join(self.out_dir, x + ".h5ad") for x in self.datasets] if len(self.datasets) == 0: logging.error("No datasets found! Have you specified the pattern correctly?") @@ -114,7 +114,7 @@ def simulate_dataset(self, dataset): ann_data.uns['unknown'] = self.unknown_celltypes ann_data.uns['cell_types'] = celltypes - ann_data.write(self.out_dir + dataset + ".h5ad") + ann_data.write(os.path.join(self.out_dir, dataset + ".h5ad")) def load_dataset(self, dataset): """ @@ -303,7 +303,7 @@ def merge_datasets(data_dir="./", files=None, out_name="data.h5ad"): """ non_celltype_obs = ["ds", "batch"] if not files: - files = glob.glob(data_dir + "*.h5ad") + files = glob.glob(os.path.join(data_dir, "*.h5ad")) logger.info(f"Merging datasets: {files} into [bold cyan]{out_name}")