Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add PHATE again #1172

Closed

Conversation

scottgigante
Copy link
Contributor

Looks like somewhere along the line RunPHATE got removed. Here it is again.

@scottgigante
Copy link
Contributor Author

I'll note that appveyor is failing for a reason related to Bioconductor/R compatibility, nothing to do with this PR.

@scottgigante
Copy link
Contributor Author

@mojaveazure @satijalab any idea when you'll have time to merge this? I have collaborators who have updated to Seurat v3 and want to continue using PHATE through Seurat the way they did previously in Seurat v2.

@satijalab
Copy link
Collaborator

Hi Scott,

We're trying to keep the codebase a bit smaller - would it be possible to include a Seurat wrapper as part of phateR instead?

Thanks!
Rahul

@satijalab satijalab closed this Mar 15, 2019
@scottgigante
Copy link
Contributor Author

Hi Rahul,

Thanks for getting back to me. I understand wanting to limit the domain of code that your group is responsible for maintaining. You put in a great deal of effort to provide working code for the single cell community, and I know countless people are grateful for that work as they depend on Seurat for their single cell analysis.

I would appreciate the opportunity to understand what we could do to help ensure that PHATE is available through Seurat, especially because similarly new methods like UMAP get this treatment. We are happy to do all the leg work, and with sufficient notice about API changes, can make sure that PHATE is ready whenever a new version of Seurat is released. Our goal is to make sure that our users have a seamless experience using our methods with Seurat.

Please let me know what you think about this. It might be helpful to set up a short 20 minute video conference with your devs to make sure that we're not adding to their workload.

Best,
Scott

@jpcartailler
Copy link

Hi everyone, I was about to post that PHATE had been dropped from Seurat3 but found this thread. Any updates on this? I suspect that after last week's NATURE publication, that many people will be asking about it.

@scottgigante
Copy link
Contributor Author

For anyone interested in using PHATE in Seurat, you can install Seurat with RunPHATE reimplemented from my fork with devtools::install_github("scottgigante/seurat", ref="patch/add-PHATE-again"). I will do my best to keep this branch up to date with the latest version, but be aware that this is not an official Seurat release.

The API is the same as for UMAP. Usage example:

# Install Seurat
devtools::install_github("scottgigante/seurat", ref="patch/add-PHATE-again")
# Load library and data
library(Seurat)
pbmc_small
# Run PHATE on 'RNA' assay
pbmc_small <- RunPHATE(object = pbmc_small)
# Plot results
DimPlot(object = pbmc_small, reduction = 'phate')

@DrLucyMac
Copy link

Hi, @scottgigante I installed your fork but I dont seen the function to RunPHATE()?? can you help please?

Cheers

@scottgigante
Copy link
Contributor Author

@lcymcdnld did you install from the patch/add-PHATE-again branch? The RunPHATE code is here: https://github.com/scottgigante/seurat/blob/patch/add-PHATE-again/R/dimensional_reduction.R#L1500

@kirushka
Copy link

@scottgigante @lcymcdnld I think the problem could be in the dependency 'SDMTools' which is not available.

@scottgigante
Copy link
Contributor Author

I've updated to branch from master, maybe try again?

@DrLucyMac
Copy link

Thanks so much @scottgigante!! Can you use integrated assay?

@scottgigante
Copy link
Contributor Author

@lcymcdnld I'm not sure what you mean. In theory, everything that works with UMAP should also work with PHATE -- but please let me know if it doesn't.

@DrLucyMac
Copy link

I was just asking because above in your code you commented - #Run PHATE on 'RNA' assay. Was just double checking...

@scottgigante
Copy link
Contributor Author

Oh, yes -- if you have any other assays in your Seurat object you can use those instead.

@sameetmehta
Copy link

Please add this to Seurat. It is incredibly useful.

@yaolutian
Copy link

Hi,

Thanks for this function, very useful.

I succeeded in making dimensional reduction using PHATE, but I have problem in showing gene expression using feature plot.

the plot are like these.

image
image

Thanks for helping with this.

Lutian

@scottgigante
Copy link
Contributor Author

@yaolutian this looks like a Seurat problem -- it is setting the axes at the wrong size. @satijalab should be able to help you fix it. In the meantime, you can probably fix the axis limits using ggplot (based on the limits that I see from your first plot):

p + xlim(-0.04, 0.04) + ylim(-0.03, 0.03)

where p is your existing plot object.

@yaolutian
Copy link

Thank you very much! This worked.

@sameetmehta
Copy link

If you try to plot with other goodies in Seurat like split.y, group.by, you will still run into the same issues. But what @scottgigante said is correct, the problem is with Seurat not setting the y_lim, and x_lim correctly.

@saeedfc
Copy link

saeedfc commented Sep 29, 2020

@scottgigante

Seurat wrapper functions are now available for many single cell methods. Would it be possible for you to make such a wrapper function as available for other methods as listed at the bottom of this link? It would be a great addition.

https://satijalab.org/seurat/vignettes.html

Thanks for all the work.
Kind regards,
Saeed

@mojaveazure
Copy link
Member

We would be happy to accept PHATE in our community-extension package SeuratWrappers if the developers are interested. The only extra thing needed would be a short tutorial using a publicly available dataset, preferably using one provided by SeuratData.

@hwelfley
Copy link

Any information on how to get RunPHATE() working for Seurat v4.04?

@scottgigante-immunai
Copy link

@hwelfley I merged 4.0.4 into my branch yesterday. Try reinstalling and let me know if you have issues.

@ssukumaran2
Copy link

@scottgigante I tried to run after installing with devtools (devtools::install_github("scottgigante/seurat", ref="patch/add-PHATE-again"), but got the following error.
Error in py_module_import(module, convert = convert) :
ModuleNotFoundError: No module named 'phate'
Error in py_module_import(module, convert = convert) :
ModuleNotFoundError: No module named 'phate'
Error: $ operator is invalid for atomic vectors
Thanks,
Sunil

@hwelfley I merged 4.0.4 into my branch yesterday. Try reinstalling and let me know if you have issues.

@scottgigante
Copy link
Contributor Author

@ssukumaran2 you will first need to upgrade phateR (install.packages("phateR") will do the job) and potentially phate (pip install -U phate from the terminal). Let me know if you're still having problems after that.

@ssukumaran2
Copy link

@scottgigante, works now- only needed a restart...
Sunil

@ssukumaran2
Copy link

@ssukumaran2 you will first need to upgrade phateR (install.packages("phateR") will do the job) and potentially phate (pip install -U phate from the terminal). Let me know if you're still having problems after that.

@scottgigante, This is incredibly useful for us. Any plans of updating it for the Seurat version 4.2?

@scottgigante
Copy link
Contributor Author

Just updated!

@sidrahmaryam-cyber
Copy link

Hello, I have been struggling with the same issue of trying to run RunPHATE, but no success. I installed the package as suggested, but still gets an error saying 'function not found'. Please help me in this, and suggest what could be the possible reason.
Thank you so much!

@Yanst86
Copy link

Yanst86 commented Nov 30, 2023

Hi, I wanted to say that PHATE is really cool and really useful for me, especially combined with trajectory analysis in which (at least in my data) you can clearly see biologically meaningful trajectories from central clusters toward the processes. From the comments in this thread, I see that I am not the only one that finds PHATE really helpful.

Seurat 5 has been recently released and I would really love having RunPHATE function as part of Seurat official release or wrappers. I see in this thread that there have been previous discussions between you and Satija lab about this and I wonder why it didn't work. If you can add PHATE to Seurat somehow I am sure this will be really helpful for many researchers, including myself.

Many thanks, Yan

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.