KrishnaswamyLab / phateR

PHATE dimensionality reduction method implemented in R
GNU General Public License v2.0
77 stars 9 forks source link

Clustering from Suerat object and downstream DE analysis #50

Closed amjass12 closed 4 years ago

amjass12 commented 4 years ago

Hi,

thanks for this amazing package! it is incredibly useful. I have a question regarding clustering and DE:

I am running Runphate on the devtools::install_github("scottgigante/seurat", ref="patch/add-PHATE-again") version so that i can integrate phate analysis with my already existing Seurat. This works perfectly well and is completely reproducible to running phate when installed alone.

I would like now however, to generate new clusters based on the phate mapping and not the umap as is normal for seurat.

I havent seen any documentation referencing any of the downstream steps after 'Runphate' in seurat, so i am sorry if I have missed it:

Can i run:


FindNeighbors(seuratObj, dims = NULL, reduction = "phate")
FindClusters(seuratObj, resolution = 0.5)

should this apply the clustering to the phate mapping?

and downstream from that, I assume the normal FindMarkers function will be able to do DE analysis if i specify which clusters to do the DE analysis on (and these clusters would be directly tied to the phate mapping clusters)?

many thanks!

**Edit: I generated kmeans clustering of the embedding data from the phate output and this produces very nice clusters....

clust<-kmeans(phateoutput$embedding, centers =8) and then add to seurat object etc this works without issue and clusters are generated in the 'appropriate places' (clusters can practically be seen in the phate analysis when you just plot the output)

an additional question: I installed seurat fork with RunPhate incorporated as it just makes life easier for me -- which version of Seurat should i report ion a methods section?should I reference the github link for the modified version? never been in a situation like this. thanks again in advance!!**

scottgigante commented 4 years ago

@amjass12 you can report the version as version 3.1.5.999 from the https://github.com/scottgigante/seurat@patch/add-PHATE-again fork. Version number is listed in https://github.com/scottgigante/seurat/blob/patch/add-PHATE-again/DESCRIPTION#L2.

Re: your other questions, these would be questions for the Seurat team for how to interact with an alternate reduction. Your code makes sense to me but I am not an experienced Seurat user. So long as you use reduction='phate' wherever the reduction argument is available this should work in theory but I recommend checking with the Seurat team.

amjass12 commented 4 years ago

Hi @scottgigante

thank you very much for your response and for the details citing package version!

With regards top seurat, I have worked on it all, and it is actually extremely simple-- treat as normal object.. when doing DE simply change Idents to the kmeans_clusters generated from the embeddings and it uses those as the cells to the DE. I did not generate clusters from within suerat, but calculated the kmeans of the phate embeddings (as above) and simply inserted the cluster membership in to the metadata

Also, I compared to the kmeans, to the clusters generated in phate in python and are practically identical..

thanks again!