This is a test version of Biostars. For the public version, visit https://www.biostars.org.
SCE object acting strangley

I made a SCE object from a seurat object but it is acting strangely.

seurat_object

An object of class Seurat  85012 features across 6078 samples within 2
assays  Active assay: RNA (55403 features, 0 variable features)  2
layers present: counts, data  1 other assay present: SCT

Converting it to SCE with inbuilt function in Seurat seemed to go fine:

sce_object <- as.SingleCellExperiment(seurat_object)
sce_object

class: SingleCellExperiment  dim: 55403 6078  metadata(0): 
assays(2): counts logcounts
rownames(55403): Xkr4 Gm37180 ... mt-Tt mt-Tp
rowData names(0): 
colnames(6078): P10_AAAGGATCAGCTACCG-1
P10_AAAGTCCCAACTGAAA-1 ...   P28_20RM_TTTGGAGTCTGCTTTA-1
P28_20RM_TTTGGTTAGCGACATG-1
colData names(21): orig.ident nCount_RNA ... SubclusterGroups   Stage
reducedDimNames(0):  mainExpName: RNA 
altExpNames(1): SCT

length(rownames(sce_object))    
55403 

length(sce_object$Stage)
6078

However, when I check

length(rownames(sce_object$Stage)) 
0

Am I entering my metadata in the wrong slot in the SCE object?

r sce seurat singlecellexperiment

1 answer

This is not unexpected. sce_object$Stage will return a character (or factor, numeric, whatever is in this slot) vector, and this by definition has no rownames. What do you try to see with this command?

In a SCE the genes are in rowData() and the metadata are in colData():

Log in to answer this question.