cellgeni / sceasy

A package to help convert different single-cell data formats to each other
GNU General Public License v3.0
344 stars 52 forks source link

no slot of name "meta.features" for this object of class "Assay5" #82

Open Rohit-Satyam opened 6 months ago

Rohit-Satyam commented 6 months ago

Hi

I was trying to use sceasy to convert my Seurat object to anndata but I get this weird error no slot of name "meta.features" for this object of class "Assay5". For some unknown reason, meta.features is missing. I am using Seurat v5

c <- read.csv("/data/data/pf-ch10x-set4-ch10x-raw.csv", header = T, row.names = 1)
meta <- read.csv("/data/data/pf-ch10x-set4-ch10x-data.csv", header = T,row.names = 1)

## Normalising the reference data
mca <- CreateSeuratObject(counts = as.sparse(c), project = "MCA",meta.data=meta)

mca_subset<- mca[,mca$STAGE_HR %in% c("ring","trophozoite" ,"schizont")]
> sceasy::convertFormat(mca_subset, from="seurat", to="anndata",
+                       outFile='filename.h5ad')
Error in ncol(df) : 
  no slot of name "meta.features" for this object of class "Assay5"
In addition: Warning message:
In .regularise_df(obj@meta.data, drop_single_values = drop_single_values) :
  Dropping single category variables:orig.ident, HOST
leezx commented 3 months ago

for seurat v5, run this code to downgrade the assay: sobj[["RNA"]] <- as(sobj[["RNA"]], "Assay")