loomR
loomR copied to clipboard
Not working with loompy v2
Hi, Current loomR version is not working with loompy v2. Planning to upgrade loomR to be compatible with loompy v2? M
Try the develop branch. While neither loomR nor the development version are at feature parity with loompy, the development version of loomR should be able to read/manipulate loom v2 objects.
devtools::install_github(repo = 'mojaveazure/loomR', ref = 'develop')
Here is the error I get when I use the convert function in Seurat and the develop branch of loomR:
Warning message in loomR::create(filename = filename, data = [email protected][, cell.order], :
“NAs introduced by coercion”Warning message in dataset_create_pl$set_chunk(chunk_dims):
“During conversion, the following issues occured: H5T_CONV_EXCEPT_RANGE_LOW”
Error in dataset_create_pl$set_chunk(chunk_dims): HDF5-API Errors:
error #000: ../../../src/H5Pdcpl.c in H5Pset_chunk(): line 2030: all chunk dimensions must be positive
class: HDF5
major: Invalid arguments to routine
minor: Out of range
Traceback:
1. Convert(from = sobj, to = "loom", filename = paste0("out.loom"))
2. Convert.seurat(from = sobj, to = "loom", filename = paste0("out.loom"))
3. loomR::create(filename = filename, data = [email protected][, cell.order],
. cell.attrs = [email protected][cell.order, ], layers = list(norm_data = t(x = from@data[,
. cell.order])), chunk.dims = chunk.dims, chunk.size = chunk.size,
. overwrite = overwrite, display.progress = display.progress)
4. new.loom$create_dataset(name = "matrix", dtype = dtype, space = matrix.space,
. chunk_dims = chunk.dims, gzip_level = 4)
5. dataset_create_pl$set_chunk(chunk_dims)
Hi Gökçen,
What version of the HDF5 library and the hdf5r R package are you using? Are you able to make a loom object passing your expression matrix to loomR::create?
apt-cache show libhdf5-dev:
Package: libhdf5-dev
Architecture: amd64
Version: 1.10.0-patch1+docs-4build2
Priority: optional
Section: universe/libdevel
Source: hdf5
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Debian GIS Project <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 11081
Provides: libhdf5-serial-dev
Depends: libhdf5-100 (= 1.10.0-patch1+docs-4build2), zlib1g-dev, libjpeg-dev, libaec-dev, hdf5-helpers, libhdf5-cpp-100 (= 1.10.0-patch1+docs-4build2)
Suggests: libhdf5-doc
Breaks: libhdf5-serial-dev (<< 1.8.12-9~)
Replaces: libhdf5-serial-dev (<< 1.8.12-9~)
I just install hdf5r from github (devtools::install_github(repo = "hhoeflin/hdf5r") ): hdf5r::h5version():
hdf5r version 1.0.1 with C-library HDF5 Version 1.10.0
Interestingly, specifying chunk.dims i.e. chunk.dims = 100 fixes the error.
Are you able to make a loom object passing your expression matrix to
loomR::create?
Yes, loomR::create('filename', obj@data) works without any errors.
Okay, this seems to be an issue with Seurat::Convert rather than with loomR. At the moment, we are scrapping the current converters in Seurat for a more R-like approach (eg. as.SingleCellExperiment, as.Seurat, and a future as.loom). We don't have an ETA for Seurat ↔ loom converters, so converting between Seurat and loom will need to be done manually for the time being.