This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to delete Assay from Seurat object?

If I have a seurat object with two assay classes "ADT" and "RNA" how do I remove one or the other from the object?

I tried

 rm(Object@ADT)   rm(Object@"ADT")     rm(Object$ADT)      rm(Object$"ADT")

?

seurat rna-seq

1 answer

You cannot use rm to remove slots from an S3/S4 object. Set it to NULL instead.

s4obj@myslot <- NULL
s3obj$myNamedItem <- NULL

If an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one answer if they all work.

Upvote|Bookmark|Accept

Log in to answer this question.