From 46d86720859d99256619f38158f1cb655a3c5eb0 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Thu, 24 Oct 2024 21:20:17 +0200 Subject: [PATCH] make sure that assay meta.data ends up in the output --- R/Seurat.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/Seurat.R b/R/Seurat.R index 390d4513..f2f94b65 100644 --- a/R/Seurat.R +++ b/R/Seurat.R @@ -143,9 +143,11 @@ to_Seurat <- function( ) # trackstatus: class=Seurat, feature=get_var, status=done - assay <- obj@assays[[assay_name]] if (!is.null(var)) { - assay <- SeuratObject::AddMetaData(assay, metadata = adata$var) + obj@assays[[assay_name]] <- SeuratObject::AddMetaData( + obj@assays[[assay_name]], + metadata = adata$var + ) } # make sure obs and var names are set properly