sidrah maryam
sidrah maryam

Reputation: 55

how to extract cluster data from rds file in R

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

Answers (1)

Tou Mou
Tou Mou

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

Related Questions