Skip to content

Commit

Permalink
Allow loom2sce to save files directly
Browse files Browse the repository at this point in the history
  • Loading branch information
nh3 committed Sep 25, 2019
1 parent 07c05b0 commit c6ca65a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Type: Package
Title: A package to help convert different single-cell data formats to each other
Version: 0.0.1
Authors@R: c(
person('Vladimir', 'Kiselev', email='wikiselev@users.noreply.github.com', role='cre'),
person('Ni', 'Huang', email='nh3@users.noreply.github.com', role='aut'))
person('Ni', 'Huang', email='nh3@users.noreply.github.com', role='cre'),
person('Vladimir', 'Kiselev', email='wikiselev@users.noreply.github.com', role='aut'))
Description: Convert Seurat, SingleCellExperiment, Loom object to AnnData object
Depends:
R (>= 3.5.1),
Expand Down
8 changes: 6 additions & 2 deletions R/functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ sce2anndata <- function(
)

if (!is.null(outFile))
anndata$AnnData$write(adata, outFile, compression = 'gzip')
adata$write(outFile, compression = 'gzip')

adata
}
Expand Down Expand Up @@ -140,5 +140,9 @@ sce2loom <- function(obj, outFile, main_layer = NULL, ...) {
}

loom2sce <- function(inFile, outFile = NULL, main_layer = NULL, ...) {
readExchangeableLoom(inFile, backed = FALSE, ...)
sce <- readExchangeableLoom(inFile, backed = FALSE, ...)
if (!is.null(outFile))
saveRDS(sce, outFile)

sce
}
Empty file modified R/loom_utils.R
100755 → 100644
Empty file.

0 comments on commit c6ca65a

Please sign in to comment.