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

invalid loom converted from sce #31

Closed akhst7 closed 3 years ago

akhst7 commented 3 years ago

Hi,

I have his sce file ;

ldat.mod.se
class: SingleCellExperiment 
dim: 36601 10194 
metadata(0):
assays(2): counts logcounts
rownames(36601): BX004987.1 AC145212.1 ... CDY1 TTTY3
rowData names(0):
colnames(10194): AAAGAACAGAGATTCA-1 AAAGAACTCCTCAGGG-1 ... TTTGGTTCAAATCAAG-1 TTTGGAGAGACTTAAG-1
colData names(6): orig.ident nCount_spliced ... nFeature_unspliced ident
reducedDimNames(0):
altExpNames(0):

and coveted to loom by ;

convertFormat(ldat.mod.se, from = "sce", to="loom", outFile = "~/Desktop/ldat.loom")

A convention went without a hitch, and created a loom file, however,  importing this ldat.loom back in R by` read_loom` from anndata R fails ;

Error in py_call_impl(callable, dots$args, dots$keywords) : 
  KeyError: "Unable to open object (object 'attrs' doesn't exist)" 
15.
stop(structure(list(message = "KeyError: \"Unable to open object (object 'attrs' doesn't exist)\"", 
    call = py_call_impl(callable, dots$args, dots$keywords), 
    cppstack = structure(list(file = "", line = -1L, stack = c("1   reticulate.so                       0x00000001126e065e _ZN4Rcpp9exceptionC2EPKcb + 222", 
    "2   reticulate.so                       0x00000001126e8735 _ZN4Rcpp4stopERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE + 53",  ... 
14. h5py at h5o.pyx#190
13. h5py at _objects.pyx#55
12. h5py at _objects.pyx#54
11. __getitem__ at group.py#288
10. h5py at _objects.pyx#55
9. h5py at _objects.pyx#54
8. validate_spec at loom_validator.py#204
7. validate at loom_validator.py#51
6. __init__ at loompy.py#81
5. connect at loompy.py#1389
4. read_loom at read.py#194
3. python_anndata$read_loom(filename = filename, sparse = sparse, 
    cleanup = cleanup, X_name = X_name, obs_names = obs_names, 
    obsm_names = obsm_names, var_names = var_names, varm_names = varm_names, 
    dtype = dtype, ...) 
2. py_to_r(python_anndata$read_loom(filename = filename, sparse = sparse, 
    cleanup = cleanup, X_name = X_name, obs_names = obs_names, 
    obsm_names = obsm_names, var_names = var_names, varm_names = varm_names, 
    dtype = dtype, ...)) 
1. read_loom(filename = "/Volumes/Documents/R/ldat.loom") 

I tried ReadVelocity from SeuratWrappers and Velocyte.R but got the similar error;

dat.test<-ReadVelocity("/Volumes/Documents/R/ldat.loom", verbose = T)
reading loom file via hdf5r...
Error in `[[.H5File`(f, "col_attrs/CellID") : 
  An object with name col_attrs/CellID does not exist in this group

Let me know how to approach this.

Thanks.

nh3 commented 3 years ago

loom conversion only supports loom v2, and there has developed some version dependency issues over time. We might address it in the next release or two. In the meantime, you could try convert it to AnnData, then use anndata's write_loom() function.