Closed jessielam415 closed 1 year ago
Try this:
MS4A1 = logcounts(sce)["MS4A1",] #if this doesn't work, check the rownames of your data
PC1 = logcounts(sce)["PC1",]
sce.subsetted = sce[, MS4A1 > 3 & PC1 > 5]
It works! Thank you so much! Would you know if there is a simple way to visualize the location of these subsetted spots using a plot?
BayesSpace has its own plotting functions in clusterPlot
and featurePlot
. It will need your colData to have the columns row
, col
, imagerow
, and imagecol
which are in the tissue_positions_list.csv file from SpaceRanger output. These are the grid and image coordinates of each spot. You may also need to add in some metadata using the spatialPreprocess
function with skip.PCA = TRUE
and log.normalize = FALSE
if you just need the metadata and not the preprocessing.
Otherwise, Seurat or SpatialExperiment have alternative ways to make spatial plots.
Thank you!
Hello! Thank you for creating this amazing package. I was wondering whether BayesSpace provides a way to subset cells in enhanced SCE based on expression-level conditions of multiple genes/features. In seurat, this can be done using their subset function. Eg.
subset(x = pbmc, subset = MS4A1 > 3 & PC1 > 5)
If this cannot be done using BayesSpace, would you have an idea on how I would be able to create a seurat object from enhanced SCE such that I can use the subset function in seurat? I tried using the following code below from #29 , but am encountering the error "Error: No cells found" when I use the subset function on the created Seurat object.Thank you!