This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to remove the analysis slots added to my scRNA-Seq and scATAC-Seq data objects in R?

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 answer

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

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?

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

Log in to answer this question.