loomR
loomR copied to clipboard
subset giving HDF5-API Errors
Hi,
I connected to a loom file with connect function; added metadata using add.col.attribute and add.row.attribute. Then trying to subset a loom file with subset function, based on the added metadata. File is created, and opened, but after reaching 100% "adding data" getting an error.
m <- grep(pattern = "mm10", x = lfile[["col_attrs/call"]][], value = FALSE) s <- grep(pattern = "mm10", x = lfile[["row_attrs/Gene"]][], value = FALSE) loom_out <- subset(lfile, m = m, n = s, filename = NULL, overwrite = T, display.progress = TRUE)
Writing new loom file to cellranger/S_combined_subset.loom Adding data for /matrix and 3 layers |=================================================================================================================================================| 100% Error in new.loom$create_group(name = group) : HDF5-API Errors: error #000: H5G.c in H5Gcreate2(): line 323: unable to create group class: HDF5 major: Symbol table minor: Unable to initialize object
error #001: H5Gint.c in H5G__create_named(): line 157: unable to create and link to group
class: HDF5
major: Symbol table
minor: Unable to initialize object
error #002: H5L.c in H5L_link_object(): line 1557: unable to create new link to object
class: HDF5
major: Links
minor: Unable to initialize object
error #003: H5L.c in H5L__create_real(): line 1798: can't insert link
class: HDF5
major: Links
minor: Unable to insert object
error #004: H5Gtraverse.c in H5G_traverse(): line 851: internal path traversal failed
class: HDF5
major: Symbol table
minor: Object not found
error #005: H5Gtraverse.c in H5G__traverse_real(): line 627: traversal operator failed
class: HDF5
ma
Any ideas what is causing this? I can't find any troubleshooting threads so far.
Thank you in advance, Maria
sessionInfo() R version 3.6.0 (2019-04-26) Platform: x86_64-redhat-linux-gnu (64-bit) Running under: CentOS Linux 7 (Core)
Matrix products: default BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so
Random number generation: RNG: Mersenne-Twister Normal: Inversion Sample: Rounding
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8
[6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] loomR_0.2.1.9000 R6_2.4.0 data.table_1.12.6 Signac_0.1.5 hdf5r_1.3.0 ggplot2_3.2.1 Seurat_3.1.1
@mliiv Any progress, I'm having the same issue?
Hi @gbloeb
if I remember correctly, then I dropped the idea of filtering the loom file with loomR since no luck with really fixing the error. Instead, I prepared the seurat object and then saved as the loom file (i.e. made all filtering in seurat). Important to always close loom files, even when had error in writing, and try again. Even if you get the errors, the loom file might be functional, just try and read in with python and check. Also, you can add attributes to the loom file without re-saving the file (lfile$close_all() will be enough to save and close) with e.g. lfile$add.col.attribute. Also, I suspect the error might have had smth to do with the hdf5 package so making sure the install is solid would also be useful.
Best, Maria
Hello,
I am having an issue subsetting a publicly available loom dataset here - https://console.cloud.google.com/storage/browser/linnarsson-lab-human;tab=objects?authuser=0&pli=1&prefix=&forceOnObjectsSortingFiltering=false
when trying to subset out a certain cluster
library(dplyr)
library(hdf5r)
library(loomR)
loom <- connect(filename = "~/Downloads/adult_human_20221007.loom", mode = "r+", skip.validate = TRUE)
attr.df <- loom$get.attribute.df(MARGIN = 2, col.names = "CellID", row.names = "Gene")
subset(loom, m = attr.df$Clusters == "298", filename = 'CBL.loom', chunk.size = 1000, verbose = T, overwrite = T)
I get the below error
Writing new loom file to CBL.loom Error in H5File.open(filename, mode, file_create_pl, file_access_pl) : HDF5-API Errors: error #000: ../../src/hdf5-1.12.1/src/H5F.c in H5Fcreate(): line 532: unable to create file class: HDF5 major: File accessibility minor: Unable to open file
error #001: ../../src/hdf5-1.12.1/src/H5VLcallback.c in H5VL_file_create(): line 3282: file create failed
class: HDF5
major: Virtual Object Layer
minor: Unable to create file
error #002: ../../src/hdf5-1.12.1/src/H5VLcallback.c in H5VL__file_create(): line 3248: file create failed
class: HDF5
major: Virtual Object Layer
minor: Unable to create file
error #003: ../../src/hdf5-1.12.1/src/H5VLnative_file.c in H5VL__native_file_create(): line 63: unable to create file
class: HDF5
major: File accessibility
minor: Unable to open file
error #004: ../../src/hdf5-1.12.1/src/H5Fint.c in H5F_open(): line 1858: unable to truncate a file which is already open
class: HDF5
major: File ac
I am able to see things in the loom dataset, the output of
attr.df %>% colnames
is
[1] "Age" "CellCycle" "CellID" "Chemistry" "Clusters"
[6] "Donor" "DoubletFinderFlag" "DoubletFinderScore" "MT_ratio" "NGenes"
[11] "ROIGroupCoarse" "ROIGroupFine" "Roi" "SampleID" "Subclusters"
[16] "Tissue" "TotalUMI" "unspliced_ratio"
Which I know to be correct based on viewing with HDFView
Any help is appreciated
Any updates? I'm having the same issue