Open kleurless opened 4 years ago
Related issue to #9 and #11
I had the same issue. Check the R datatype for the metadata column that is having the issue using 'typeof()'. Try changing it to characters using 'as.character()' before running Convert.
My solution is to convert all of the factor vectors in the meta data over to character vectors, assuming pmbc is a Seurat object:
i <- sapply(pbmc@meta.data, is.factor)
pbmc@meta.data[i] <- lapply(pbmc@meta.data[i], as.character)
I will try this, thanks a lot
Hi!
In Seurat I have a metadata column (merged object) that holds 30 different cell types with a combination of "real" strings ("Neuron") and "integer" strings ("0") . When I Convert to AnnData, that column holds integers from 0-29. I can perform a work-around to create a cell type column after conversion, but it's kind of annoying.
Metadata column in Seurat:
Conversion to .h5ad:
Metadata column in Scanpy:
Scanpy:
scanpy==1.4.6 anndata==0.7.1 umap==0.3.10 numpy==1.18.1 scipy==1.4.1 pandas==1.0.1 scikit-learn==0.22.1 statsmodels==0.11.1 python-igraph==0.8.0 louvain==0.6.1
Seurat:SeuratDisk_0.0.0.9013 Seurat_3.2.1