aertslab / SCopeLoomR

R package (compatible with SCope) to create generic .loom files and extend them with other data e.g.: SCENIC regulons, Seurat clusters and markers, ...
MIT License
40 stars 15 forks source link

Error trying to open a loom file that is the output of pySCENIC #18

Closed gilhornung closed 4 years ago

gilhornung commented 4 years ago

Hi, I'm trying to open a loom file that is the output of pySCENIC, and I'm getting this error:

> loom <- open_loom("pySCENIC/T.cell.pyscenic.loom", mode = "r")
Error in x$create_attr(which, robj = value) : HDF5-API Errors:
    error #000: ../../../src/H5A.c in H5Acreate2(): line 267: no write intent on file
        class: HDF5
        major: Invalid arguments to routine
        minor: Write failed
dweemx commented 4 years ago

Hi @gilhornung, I cannot reproduce your error unfortunately Could you try to run this command:

loom <- H5File$new("pySCENIC/T.cell.pyscenic.loom", mode = "r")
gilhornung commented 4 years ago

Thank you for the reply, I'm sending a link to the file on dropbox, so you will be able to reproduce the error: https://www.dropbox.com/s/vaqkg2or2k6y2sx/T.cell.pyscenic.loom?dl=0

dweemx commented 4 years ago

Hey @gilhornung,

Running

 loom <- open_loom("pySCENIC/T.cell.pyscenic.loom", mode = "r")

works for me

Which version of SCopeLoomR do you use ?

packageVersion("SCopeLoomR")
gilhornung commented 4 years ago
> packageVersion("SCopeLoomR")
[1] ‘0.9.1’
> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] pheatmap_1.0.12             BiocParallel_1.22.0         forcats_0.5.0              
 [4] stringr_1.4.0               dplyr_0.8.5                 purrr_0.3.4                
 [7] readr_1.3.1                 tidyr_1.0.3                 tibble_3.0.1               
[10] tidyverse_1.3.0             scran_1.14.6                scater_1.14.6              
[13] ggplot2_3.3.2               SingleCellExperiment_1.8.0  SummarizedExperiment_1.18.1
[16] DelayedArray_0.14.0         matrixStats_0.56.0          Biobase_2.48.0             
[19] GenomicRanges_1.38.0        GenomeInfoDb_1.24.0         IRanges_2.22.1             
[22] S4Vectors_0.26.0            BiocGenerics_0.34.0         SCENIC_1.1.2-2             
[25] SCopeLoomR_0.9.1           

loaded via a namespace (and not attached):
  [1] readxl_1.3.1             backports_1.1.8          plyr_1.8.6               igraph_1.2.5            
  [5] GSEABase_1.50.0          usethis_1.6.1            digest_0.6.25            htmltools_0.5.0         
  [9] viridis_0.5.1            fansi_0.4.1              magrittr_1.5             memoise_1.1.0           
 [13] limma_3.44.1             remotes_2.1.1            annotate_1.66.0          modelr_0.1.7            
 [17] R.utils_2.9.2            prettyunits_1.1.1        colorspace_1.4-1         rvest_0.3.5             
 [21] blob_1.2.1               haven_2.2.0              xfun_0.14                callr_3.4.3             
 [25] crayon_1.3.4             RCurl_1.98-1.2           jsonlite_1.6.1           graph_1.66.0            
 [29] glue_1.4.1               registry_0.5-1           repotools_1.10.1         gtable_0.3.0            
 [33] zlibbioc_1.34.0          XVector_0.28.0           pkgbuild_1.0.8           BiocSingular_1.2.2      
 [37] scales_1.1.1             DBI_1.1.0                edgeR_3.30.0             bibtex_0.4.2.2          
 [41] Rcpp_1.0.4.6             viridisLite_0.3.0        xtable_1.8-4             dqrng_0.2.1             
 [45] bit_1.1-15.2             rsvd_1.0.3               httr_1.4.1.9000          RColorBrewer_1.1-2      
 [49] ellipsis_0.3.1           pkgconfig_2.0.3          XML_3.99-0.3             R.methodsS3_1.8.0       
 [53] dbplyr_1.4.3             locfit_1.5-9.4           tidyselect_1.1.0         rlang_0.4.6             
 [57] later_1.1.0.1            AnnotationDbi_1.50.0     munsell_0.5.0            cellranger_1.1.0        
 [61] tools_3.6.3              cli_2.0.2                generics_0.0.2           RSQLite_2.2.0           
 [65] devtools_2.3.0           broom_0.5.6              fastmap_1.0.1            processx_3.4.2          
 [69] knitr_1.28               bit64_0.9-7              fs_1.4.1                 nlme_3.1-147            
 [73] mime_0.9                 R.oo_1.23.0              xml2_1.3.2               hdf5r_1.3.2.9000        
 [77] compiler_3.6.3           rstudioapi_0.11          beeswarm_0.2.3           curl_4.3                
 [81] testthat_2.3.2           reprex_0.3.0             rversions_2.0.1          statmod_1.4.34          
 [85] stringi_1.4.6            ps_1.3.3                 desc_1.2.0               lattice_0.20-41         
 [89] Matrix_1.2-18            vctrs_0.3.1              pillar_1.4.4             lifecycle_0.2.0         
 [93] BiocNeighbors_1.4.2      data.table_1.12.8        bitops_1.0-6             irlba_2.3.3             
 [97] httpuv_1.5.4             AUCell_1.8.0             R6_2.4.1                 promises_1.1.1          
[101] gridExtra_2.3            vipor_0.4.5              sessioninfo_1.1.1        codetools_0.2-16        
[105] assertthat_0.2.1         pkgload_1.1.0            pkgmaker_0.31.2          rprojroot_1.3-2         
[109] withr_2.2.0              GenomeInfoDbData_1.2.3   hms_0.5.3                grid_3.6.3              
[113] DelayedMatrixStats_1.8.0 shiny_1.4.0.2            lubridate_1.7.8          ggbeeswarm_0.6.0
gilhornung commented 4 years ago

I am able to open the file with the LoomExperiment package

dweemx commented 4 years ago

Very weird... I even updated the hdf5r package to match your version but it still works for me

gilhornung commented 4 years ago

I found a workaround. I load the loom file using the LoomExperiment package, and use the AUC data that is found in the colData slot. I'm placing the code here in case someone lands on this page. Would also appreciate it if you could tell me if the way I pull the AUC data is valid:

  library(LoomExperiment)

  df <- colData(import(loomfile))
  regulon_colnames <- grep("RegulonsAUC",colnames(df), value = T) 
  regulons <- stringr::str_match(regulon_colnames,
                                 pattern = "RegulonsAUC[.](.*?)[.][.][.]")[,2]
  mat <- t(as.matrix(df[,regulon_colnames]))
  colnames(mat) <- df$CellID
  rownames(mat) <- regulons
dweemx commented 4 years ago

Yes, this should work. I see quite a lot of warnings() do also have these when importing the Loom ?

dweemx commented 4 years ago

Closing issue since no activity Please reopen issue if still encountering this issue