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

Transferring metadata from a Seurat object into SWNE #28

Closed pbrazda closed 3 years ago

pbrazda commented 4 years ago

Hi!

I really like this tool. It grabs the best elements of a umap and a trajectory plot :)

My question is about using a Seurat object as an input. I have an object which is the result of several libraries merged together. So, the metadata stored on the Seurat object would be crucial to be carried over into NMF -> SWNE, but only the counts are extracted.

Could you tell me how to transfer the metadata into the SWNE process and how to call then for plotting with PlotSWNE?

Thank you!

yanwu2014 commented 4 years ago

Hi! Thank you! And sure, what kind of metadata are you trying to transfer over? It'd be super helpful if you could send a code sample too!

FYI the SWNE object is just a simple list of different elements and wasn't really meant as a standalone object but you can always stash metadata and other types of data using something like swne.embedding$metadata <- metadata