How to remove the analysis slots added to my scRNA-Seq and scATAC-Seq data objects in R?
1
0
Entering edit mode
4 months ago

Hi,

I have a question about the removing or deleting the analysis slots added to my scRNA-Seq and scATAC-Seq data objects in R perhaps performed via Seurat and Signac. The reason I am deleting this because, previously a member of our lab had performed this analysis (not sure about the parameters used), and I would like to re-perform the analysis using the from both scRNA-Seq and scATAC-Seq data as we are unable to locate the primary data files.

It seems, in Seurat, an object can contain multiple assays, and each assay can have its own data slots like counts, data, and scale.data. If want to keep only the RNA counts and ATAC starting data and remove all other data slots (like scale.data, neighbors, reduction, etc) or other assays, how can I do this by modifying the object as str(my_data) shows a lengthy data object:

assays(my_data)
[1] "RNA"   "ATAC"  "peaks"

class(my_data)
[1] "Seurat"
attr(,"package")
[1] "SeuratObject"

Thank you,
Toufiq

scrna-seq seurat signac • 1.0k views
ADD COMMENT
1
Entering edit mode
4 months ago
bk11 ★ 2.4k

You can do something like- seuratobj@scale.dat <- NULL for the slots you want to get rid of.

ADD COMMENT
0
Entering edit mode

Thank you bk11

It seems like there are more than 25 slots for each sample. Is there are way to do it all at once?

ADD REPLY
1
Entering edit mode

You can use DietSeurat to do this. See an example below. For the reference Link To DietSeurat.

data
An object of class Seurat 
31360 features across 45698 samples within 2 assays 
Active assay: ADT (140 features, 0 variable features)
 2 layers present: counts, data
 1 other assay present: RNA
 2 dimensional reductions calculated: pca, umap

bar <- DietSeurat(data, layers =NULL, assays=c("RNA","ADT"), dimreducs = NULL, graphs = NULL, misc = FALSE)
bar
An object of class Seurat 
31360 features across 45698 samples within 2 assays 
Active assay: ADT (140 features, 0 variable features)
 2 layers present: counts, data
 1 other assay present: RNA
ADD REPLY
0
Entering edit mode

bk11 thank you.

ADD REPLY

Login before adding your answer.

Traffic: 1985 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