openproblems-v2 icon indicating copy to clipboard operation
openproblems-v2 copied to clipboard

[label_projection] seurat_transfer method out of date

Open KaiWaldrant opened this issue 2 years ago • 1 comments

Describe the bug The seurat_transfer method gives an error when trying to create a seurat object from anndata:

Error in validityMethod(as(object, superClass)) : 
  object 'Csparse_validate' not found

To Reproduce Steps to reproduce the behavior:

  1. run viash test src/tasks/label_projection/methods/seurat_transferdata/config.vsh.yaml
  2. See error

Expected behavior the test should pass and say All checks succeeded!

Additional context According to search results this should be fixed by updating the Matrix Package to >=1.5.3 and load the Matrix package first. after investigation the package is at version 1.6.0. This cause has been ruled out.

After looking at the script it seems the syntax used is from Seurat version 3.1.0 whereas the version of the Seurat package installed is 4.3.0.

I have tried updating the function anndataToSeurat with following code:

obj <- Seurat::CreateSeuratObject(
    counts = adata$layers[["counts"]],
    data = adata$layers[["normalized"]],
    meta.data = adata$obs,
    assay = "RNA",
    features = adata$var_names,
    project = "anndataToSeurat"
)

This gave errors such as:

Error: None of the features provided are in this Assay object In addition: Warning message: In CreateSeuratObject.default(counts = adata$layers[["counts"]], : Some cells in meta.data not present in provided counts matrix

I've also tried to update to beta version 5 of Seurat but failed.

KaiWaldrant avatar Jul 20 '23 14:07 KaiWaldrant

Disabled the component for now

KaiWaldrant avatar Jul 20 '23 14:07 KaiWaldrant