cellgeni / sceasy

A package to help convert different single-cell data formats to each other
GNU General Public License v3.0
363 stars 53 forks source link

No anndata to other format conversion #11

Closed likejie closed 3 years ago

likejie commented 4 years ago

I would like to test anndata to seurat conversion by calling convertFormat function. But it turned out there is no "from anndata" option. Did i miss anything?

Thanks a lot!

convertFormat function (obj, from = c("seurat", "sce", "loom"), to = c("anndata", "loom", "sce"), outFile = NULL, main_layer = NULL, ...) { from <- match.arg(from) to <- match.arg(to) tryCatch({ func <- eval(parse(text = paste(from, to, sep = "2"))) }, error = function(e) { stop(paste0("Unsupported conversion from \"", from, "\" to \"", to, "\""), call. = FALSE) }, finally = { }) return(func(obj, outFile = outFile, main_layer = main_layer, ...)) }

sonejilab commented 4 years ago

Same here: Error in match.arg(from) : 'arg' should be one of “seurat”, “sce”, “loom”

It would be great to know if conversion from h5ad to seurat is possible.

cshasha commented 3 years ago

Hi -- any updates to this?

nh3 commented 3 years ago

Sorry for getting back to you late. The functionality was implemented but not enabled in convertFormat(). It was fixed in #10 . Please try again with the github version.

bschilder commented 3 years ago

The error still seems to come up (in this case anndata -> sce):

> sce <- sceasy::convertFormat(sc_files[["LaManno2020"]], 
                             outFile = gsub(".h5ad",".sce",sc_files[["LaManno2020"]]),
                             from="anndata", to="sce")
Error: Unsupported conversion from "anndata" to "sce"

# I have the most recent version
> devtools::install_github("cellgeni/sceasy")
Skipping install of 'sceasy' from a github remote, the SHA1 (5e059239) has not changed since last install.
  Use `force = TRUE` to force installation

> packageVersion("sceasy")
[1] ‘0.0.6’