yanwu2014 / swne

Similarity Weighted Nonnegative Embedding (SWNE), a method for visualizing high dimensional datasets
BSD 3-Clause "New" or "Revised" License
103 stars 20 forks source link

Bringing a seurat v3 object into SWNE #22

Closed hgb1111 closed 5 years ago

hgb1111 commented 5 years ago

Hi, I have used SWNE before to study an object that I generated in Seurat v2.

However, with a Seurat version 3 object, I am unsure how to extract the necessary information to run a SWNE analysis.

Previously, I was able to run:

se.obj <- OBJECT

se.obj@raw.data <- FilterData(as(se.obj@raw.data, "dgCMatrix"), min.samples.frac = 0.0025, 
                              min.nonzero.features = 200, trim = 0.0025)

norm.counts <- ExtractNormCounts(se.obj, obj.type = "seurat", rescale = T, rescale.method = "log", batch = NULL) 

and then proceed with my swne analysis.

However, I am unsure how to bring this information out of a Seurat v3 object.

Thoughts?

yanwu2014 commented 5 years ago

Hi,

Yes so the Seurat V3 object interface is different. The equivalent command would be something like:

AssayData(se.obj, slot = "counts") <- FilterData(AssayData(se.obj, slot = "counts"), min.samples.frac = 0.0025, min.nonzero.features = 200, trim = 0.0025)

Let me know if that works! Also the full list of updated Seurat V3 commands is here: https://satijalab.org/seurat/essential_commands.html. FYI if you have Seurat V2 objects you'll need to remake them to use Seurat V3 commands.

Let me know if that works!

yanwu2014 commented 5 years ago

Closing this issue if there aren't any more questions!