Reputation: 55
I have read RDS file, where the data is stored after running PCA and UMAP. I got various clusters in it. However, I only want 2 of the cluster data, as to which cells belong to those groups.
I used [email protected]$seurat_clusters
to get cluster.
Is there a function to subset specific cluster data? please suggest
Thank you in advance
Upvotes: 0
Views: 724
Reputation: 1274
Plz use dput()
to obtain reproducible example.
I think you could use filter
of dplyr package to select rows belonging to wanted clusters :
filter(your_dataset, class_column == "cluster_1" & class_column == "cluster_2")
Here I supposed that your dataset contains a column class_column
that represents the cluster label of observations.
Upvotes: 1