openproblems-bio / openproblems-v2

Formalizing and benchmarking open problems in single-cell genomics
MIT License
51 stars 19 forks source link

[label_projection] seurat_transfer method out of date #207

Open KaiWaldrant opened 12 months ago

KaiWaldrant commented 12 months ago

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 commented 12 months ago

Disabled the component for now