Hello,
I've combined 3 seurat files in order to do an integrated analysis and everything is working fine, but I would like to extract some cells for subsequent analysis. As the dimplot is now, the clusters consist of cells from all of my conditions so I can not seem to do the usual approach which would be something like :
Cluster.1.8.12.only <- subset(x = seuratA, idents = c('1','8', '12'))
if for example I wanted clusters 1,8 and 12.
Does anyone know how I would modify the above to for example, get clusters 1, 8 and 12 but of only the condition I'm interested in? for simplicity sake lets assume the conditions are labelled A, B and C and are in an integrated seurat called ABC.combined.
Thank you for your help :)
Hello,
I've tried to do this but it does not seem to be working for me. I'm probably missing something dumb.
My seurat object is called 'epithelial', which consists of cells obtained from 3 conditions. I'm trying to take out all cells that are under the 'Healthy' condition.
I've done the below to check what column the metadata is stored at :
Which returns :
Which means my condition is stored in the 4th column. I then run to try to replicate the above you've mentioned :
and receive this error :
Also for the fun of it tried to be inventive to run :
which returned
If you could provide any help that would be most appreciated :( thank you.
Try:
test.subset <- subset(x = epithelial, subset = stim == "Healthy")
Worked like a charm, I took out all the cells from the 'Healthy' condition but can now subset again with more specifics.
Thank you so much! V
Hi, Is it possible to select two conditions? I tried
test.subset <- subset(x = epithelial, subset = stim == c("Healthy",'another_condition'))
. But I got much less cells by this. I also tried subset those two conditions and merge them. But I lose all the@graph
info. Otherwise, is there a way to only analyse two certain conditions in an integrated seurat object which has multiple conditions? Thanks in advance!This way worked for me:
test.subset <- subset(x = epithelial, subset = (stim == "Healthy" | stim == "another_condition"))
Try: seurat.subset <- subset(x = epithelial, subset = (stim == "Healthy" & stim == "Others") & (another_condition == "Ambigious"))
Save filtered subset
seurat.subset <- seurat.subset@meta.data
Check the result
table(seurat.subset$stim)