Splitting Seurat object by sample layers
1
0
Entering edit mode
7 months ago
kilcdincer ▴ 10

Hello,

I have this seurat object:

An object of class Seurat 
16143 features across 29645 samples within 1 assay 
Active assay: RNA (16143 features, 2000 variable features)
5 layers present: counts.control, counts.treated, data.control, data.treated, scale.data
2 dimensional reductions calculated: pca, umap

I would like to split this by sample layer so I will have 2 separate Seurat objects, one of which such as:

An object of class Seurat 
15143 features across 19645 samples within 1 assay 
Active assay: RNA (16143 features, 2000 variable features)
3 layers present: counts.control (or named just "counts"), data.control, scale.data
2 dimensional reductions calculated: pca, umap

Do you know how to do that?

seurat • 512 views
ADD COMMENT
0
Entering edit mode
7 months ago
bk11 ★ 3.0k

You can do the following-

Idents(SeuratObj) <- "orig.ident"
control_set <- subset(SeuratObj, idents = c("counts.control","data.control"))

#for treated data, you can do the following-
treated_set <- subset(SeuratObj, idents = c("counts.treated","data.treated"))
ADD COMMENT

Login before adding your answer.

Traffic: 1892 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6