Hello, referencing #2855, I have an integrated Seurat object ("so"). I want to add additional genes to the object after integration (I don't want the additional genes to be considered when integrating the object). I have tried to do the following:
However, when I do this:
print(Features(so.updated)), I do not see the additional genes I've added in the list of features, and I cannot plot these additional genes as FeaturePlots. Is there a different way to approach this? I am using Seurat v5, and I have confirmed that in updated_expr_matrix, the additional genes are being appended as rows to the end. Also, the column names are the same between assay_data_all and additional_genes_matrix.
Any help would be greatly appreciated. Thank you so much!
Hello, referencing #2855, I have an integrated Seurat object ("so"). I want to add additional genes to the object after integration (I don't want the additional genes to be considered when integrating the object). I have tried to do the following:
assay_data_all <- GetAssayData(so, assay = "RNA", layer = "data") updated_expr_matrix <- rbind(as.matrix(assay_data_all), additional_genes_matrix) so.updated <- SetAssayData(so, assay = "RNA", layer = "data", new.data = updated_expr_matrix)
However, when I do this:
print(Features(so.updated))
, I do not see the additional genes I've added in the list of features, and I cannot plot these additional genes as FeaturePlots. Is there a different way to approach this? I am using Seurat v5, and I have confirmed that in updated_expr_matrix, the additional genes are being appended as rows to the end. Also, the column names are the same between assay_data_all and additional_genes_matrix.Any help would be greatly appreciated. Thank you so much!