Skip to content

Commit

Permalink
fixed data simulation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinMenden committed Mar 25, 2021
1 parent 11678f0 commit c984d91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scaden/simulation/bulk_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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?")
Expand Down Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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}")

Expand Down

0 comments on commit c984d91

Please sign in to comment.