Closed vertesy closed 8 months ago
The conversion from numeric
to factor
happens (v1.3.0
) inside AssignGranuleAverageScoresFromGOterm()
after cl.av <- CalcClusterAverages_Gruffi()
, bc cl.av
is still numeric.
It is bc of Seurat::RenameIdents
, bc it inherits from a previous factor, cluster ident
and keeps as is.
# Store cluster average scores in the metadata under a new column
ColNameAverageScore <- paste0(clustering, "_cl.av_", make.names(GO_term))
obj <- Seurat::RenameIdents(obj, cl.av)
obj@meta.data[ColNameAverageScore] <- Seurat::Idents(obj)
obj@meta.data[ColNameAverageScore] <- as.numeric(as.character(Seurat::Idents(obj)))
Currently granule average scores are stored as not factor:
Describe the solution you'd like Keep them as numeric, since we compute with them and code could be much simpler