... | ... |
@@ -51,14 +51,15 @@ exportSCEtoAnnData <- function(sce, |
51 | 51 |
if (!is(SummarizedExperiment::assay(sce), 'dgCMatrix')) { |
52 | 52 |
SummarizedExperiment::assay(sce) <- .convertToMatrix(SummarizedExperiment::assay(sce)) |
53 | 53 |
} |
54 |
- |
|
54 |
+ |
|
55 |
+ dir.create(outputDir, showWarnings = FALSE, recursive = TRUE) |
|
55 | 56 |
annData <- .sce2adata(sce,useAssay) |
56 | 57 |
fileName <- paste0(sample,".h5ad") |
57 | 58 |
filePath <- file.path(outputDir,fileName) |
58 |
- |
|
59 |
+ |
|
59 | 60 |
if (file.exists(filePath) && !isTRUE(overwrite)) { |
60 | 61 |
stop(paste0(path, " already exists. Change 'outputDir' or set 'overwrite' to TRUE.")) |
61 |
- } |
|
62 |
+ } |
|
62 | 63 |
|
63 | 64 |
annData$write_h5ad(filePath, |
64 | 65 |
compression = compression, |