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
38 stars 15 forks source link

Error adding scenic results #11

Closed hummuscience closed 3 years ago

hummuscience commented 4 years ago

I tried to do this using the export2scope from SCENIC but it didn't work so I decided to go through SCopeLoomR.

Following the vignette, I am getting the following error:

> add_scenic_regulons(loom = loom,regulons = regulons)
Error in loom$create_dataset(name = paste0("row_attrs/", key), robj = value,  : 
  HDF5-API Errors:
    error #000: ../../../src/H5D.c in H5Dcreate2(): line 147: unable to create dataset
        class: HDF5
        major: Dataset
        minor: Unable to initialize object

    error #001: ../../../src/H5Dint.c in H5D__create_named(): line 494: unable to create and link to dataset
        class: HDF5
        major: Dataset
        minor: Unable to initialize object

    error #002: ../../../src/H5L.c in H5L_link_object(): line 1697: unable to create new link to object
        class: HDF5
        major: Links
        minor: Unable to initialize object

    error #003: ../../../src/H5L.c in H5L_create_real(): line 1941: can't insert link
        class: HDF5
        major: Symbol table
        minor: Unable to insert object

    error #004: ../../../src/H5Gtraverse.c in H5G_traverse(): line 869: internal path traversal failed
        class: HDF5
        major: Symbol table
        minor: Object not found

    error #005: ../../../src/H5Gtraverse.c in H5G_traver
dweemx commented 4 years ago

Hi @Cumol, Could you share the full script you're are using ? (It would be easier for me to debug)

hummuscience commented 4 years ago
library(SCopeLoomR)

dgem <- exprMat

cell.info <- cellInfo
cell.info$nGene <- colSums(dgem>0)

newembed <- embedding[,c("lvl1","lvl2")]
newembed.name <- "Embedding from Soldatov 2019"

file.name <- "output/mouseNCC-soldatov2019.loom"
loom <- build_loom(file.name=file.name,
                   dgem=dgem,
                   title="Developing mouse NCC data from soldatov 2019",
                   genome="Mouse",
                   default.embedding=newembed,
                   default.embedding.name=newembed.name)

regulonsAUC <- loadInt(scenicOptions, "aucell_regulonAUC")

library(AUCell)

add_scenic_regulons_auc_matrix(loom=loom, regulons.AUC=getAUC(regulonsAUC))

regulons <- readRDS("int/3.1_regulons_forAUCell.Rds")

regulon.enrichment.table <- readRDS("int/2.3_motifEnrichment.Rds")

add_scenic_regulons(loom = loom,regulons = regulons,regulon.enrichment.table = regulon.enrichment.table)
dweemx commented 4 years ago

Hi @Cumol,

There's a mistake in the tutorial (sorry for that, I just fixed it now). The problem is that build_loom does not return any output. Moreover it closes the loom file, this is why you got your error while trying to use add_scenic_regulons.

The following should work tough:

library(SCopeLoomR)
dgem <- exprMat
cell.info <- cellInfo
cell.info$nGene <- colSums(dgem>0)
newembed <- embedding[,c("lvl1","lvl2")]
newembed.name <- "Embedding from Soldatov 2019"
file.name <- "output/mouseNCC-soldatov2019.loom"
build_loom(file.name=file.name,
                   dgem=dgem,
                   title="Developing mouse NCC data from soldatov 2019",
                   genome="Mouse",
                   default.embedding=newembed,
                   default.embedding.name=newembed.name)
regulonsAUC <- loadInt(scenicOptions, "aucell_regulonAUC")
library(AUCell)
loom <- open_loom(file.name)
add_scenic_regulons_auc_matrix(loom=loom, regulons.AUC=getAUC(regulonsAUC))
regulons <- readRDS("int/3.1_regulons_forAUCell.Rds")
regulon.enrichment.table <- readRDS("int/2.3_motifEnrichment.Rds")
add_scenic_regulons(loom = loom,regulons = regulons,regulon.enrichment.table = regulon.enrichment.table)
finalize(loom)

Cheers

hummuscience commented 4 years ago

Goes smoothly until the last step (add_senic_regulons) which is the same error.

Error in loom$create_dataset(name = paste0("row_attrs/", key), robj = value,  :
  HDF5-API Errors:
    error #000: ../../../src/H5D.c in H5Dcreate2(): line 147: unable to create dataset
        class: HDF5
        major: Dataset
        minor: Unable to initialize object

    error #001: ../../../src/H5Dint.c in H5D__create_named(): line 494: unable to create and link to dataset
        class: HDF5
        major: Dataset
        minor: Unable to initialize object

    error #002: ../../../src/H5L.c in H5L_link_object(): line 1697: unable to create new link to object
        class: HDF5
        major: Links
        minor: Unable to initialize object

    error #003: ../../../src/H5L.c in H5L_create_real(): line 1941: can't insert link
        class: HDF5
        major: Symbol table
        minor: Unable to insert object

    error #004: ../../../src/H5Gtraverse.c in H5G_traverse(): line 869: internal path traversal failed
        class: HDF5
        major: Symbol table
        minor: Object not found

    error #005: ../../../src/H5Gtraverse.c in H5G_traver
dweemx commented 4 years ago

Hi @Cumol, Which version of SCopeLoomR are you using ? Unfortunately, I haven't been able to reproduce your error It would be very useful if you could share the script + data (by email for instance) so that I can try to reproduce your error. Best, M

dweemx commented 3 years ago

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