Skip to content

Error for Seurat V4  #171

@cmubioinformatics

Description

@cmubioinformatics
Error in `[<-.data.frame`(`*tmp*`, , i, value = new("Assay5", layers = list(: replacement has 20 rows, data has 10026
Traceback:

1. .adding.Enrich(input.data, esc, new.assay.name)
2. suppressWarnings(sc[[name]] <- fn(data = as.matrix(Matrix::t(enrichment))))
3. withCallingHandlers(expr, warning = function(w) if (inherits(w, 
 .     classes)) tryInvokeRestart("muffleWarning"))
4. `[[<-`(`*tmp*`, name, value = new("Assay5", layers = list(data = new("dgCMatrix", 

I roughly check the source codes of the process on putting the scoring outcome to the assay of seurat data, it looks like : Instead of going through the process of converting the scoring results to a matrix and putting it into assay, it goes through the process of putting it into metadata.

If this process manually operated, no error.

enrichment.scores <- escape.matrix(scRNA, 
                              method = "ssGSEA", 
                              gene.sets = gene.sets, 
                              min.size = NULL)

mat_t <- t(enrichment.scores)
escape_assay <- CreateAssayObject(counts = mat_t)
scRNA[["escape_ssGSEA"]] <- escape_assay
DefaultAssay(scRNA) <- "escape_ssGSEA"
Image

Here is my package version.
Image

Thanks for your work, very interesting work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions