Hi, thanks for your response! I tried your solution, but I got errors unfortunately. Is there something I'm missing?
genes_of_interest <- c("OSTN", "BDNF", "FOS", "NPAS4", "EGR1", "LINC00473", "ZNF331", "PER1")
genes_in_data <- genes_of_interest[genes_of_interest %in% rownames(seurat.obj_combined_filtered_excitatiory)]
print(genes_in_data)
seurat.obj_combined_filtered_active <- seurat.obj_combined_filtered_excitatiory[genes_in_data, ]
I viewed subsetted seurat object of excitatory clusters
seurat.obj_combined_filtered_active
# An object of class Seurat
# 8 features across 39702 samples within 1 assay
# Active assay: RNA (8 features, 0 variable features)
# 3 layers present: counts, data, scale.data
# 2 dimensional reductions calculated: pca, umap
But it isn't subsetted? It has the same number of cells as seurat.obj_combined_filtered_excitatiory
I then ran these lines but got these errors
cells_with_expression <- colnames(seurat.obj_combined_filtered_active)[colSums(seurat.obj_combined_filtered_active@assays$RNA@counts) > 0]
print(cells_with_expression)
# Error in h(simpleError(msg, call)) :
# error in evaluating the argument 'x' in selecting a method for function 'colSums': no slot of name "counts" for this object of class "Assay5"
#
# Error in print(cells_with_expression) :
# object 'cells_with_expression' not found