Entering edit mode
19 months ago
Nal23
•
0
Hi, I am trying to subset a merged Seurat object (containing 5 different samples). Some samples have over 20,000 cells while some only have around 10,000 so I want to subset the merged object so that all samples have a similar cell distribution. I'm struggling to do this with the subset function and hope someone will be able to help me with this.
I can subset the whole object using this script but is there a way I can modify it to specify to subset each sample so that there are only 10,000 cells in each sample within the merged object?
subcells <- sample(Cells(filter_AS), size=10000, replace=F)
filter2_AS <- subset(x = filter_AS, cells = subcells)
Thanks so much!
Try
Replace 'orig.ident' with whatever metadata column is holding your sample identity.