-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stereoscope implementation #851
Comments
Hi @giovp, Thanks for your comment 👍 We are actually working on a v1.0 version of scvi-tools, in which we will feature this reimplementation of stereoscope. The front end won't probably change but we are doing more work on the backend (@adamgayoso and @galenxing are working on the interaction with pytorch-lightning). Ideally, it would even be more straighforward to implement other models in the codebase. For the specific case of stereoscope, I expect this feature will be merged to master in a month or so? @adamgayoso what do you think? |
Yeah a month sounds about right, though an official release might take a bit longer. Excited to have this method in the codebase! |
Hi, this is great! For the lesser mortals who have lots of CPU and time but no access to GPU, is there a way to run this without it? I somehow thought that by adding At the moment I have tried to run this step:
But get the following error:
|
Hi! Thanks for pointing this out. We are working through API changes that are pretty foundational for the back-end. I will address this in the next couple of weeks once Adam and Galen first merged these back-end changes (PyTorch ligthning!). Happy that you're interested in using this 👍 It'll come out soon with the CPU version! Best, |
If you really want to run this, Google Colab should work perfectly though :) |
This is super exciting, thank you! |
Some more progress on this, I have found that adding a per-cell scaling factor on the deconvolution model gives better performance on simulations (25 % improvement on MSE for predicting cell type proportion) AND speeds up the convergence rate (between 5x and 10x to achieve the local minimum of the objective function). These results are on a remote local branch, but we will have to discuss whether we want to provide the vanilla version or my slight modification on the codebase. |
Interesting, I also see improvement in accuracy of estimating cell proportions on simulated data when adding a per-location scaling factor (in cell2location). However, it breaks inference of absolute cell abundance on simulated data (which cell2location does as well as proportions, Fig 1E, https://www.biorxiv.org/content/10.1101/2020.11.15.378125v1.full), and on real data too. So I would be concerned with over-normalising by adding that parameter and breaking the mapping for some cell types. |
That's interesting! thanks for mentioning that! I did not actually consider estimating the absolute cell abundance. |
I think it is not possible to do without informative priors because per-gene and per-location scaling factors are non-identifiable with the cell type abundance parameters. We also see a minor improvement when using absolute cell abundance as a predictor for detecting presence-absence of cell types (Fig 1C-type analysis, area 0.83 -> 0.84). But more importantly, you can do the downstream analysis on the estimates directly without usual challenges with proportional data. |
Hi Adam
One question about this implementation - is the inference amortized with
encode NN? Sorry want able to determine this from code. Maybe you could
mention in the documentation.
Thanks!
…On Tue, 19 Jan 2021, 21:17 Adam Gayoso, ***@***.***> wrote:
Closed #851 <#851> via #852
<#852>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#851 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFMFTV3L62L4GIFKOXICVQLS2XZHLANCNFSM4TQ5KQPA>
.
|
No it is not, this is an almost line-by-line reimplementation of stereoscope. Only differs a couple of minor points that we will detail in the docs. Thanks for pointing this out. |
Thanks for clarifying! It is quite easy to use so thank you for reimplementation! |
thanks @vitkl -- we might end up changing a few things to make it a tiny bit more user-friendly before official release. |
Hi @romain-lopez ,
following almaan/stereoscope#18, I finally got time to check out your implementation of stereoscope in
romain/spatial
branch. Don't have much to comment, it's great!I really like the decoupling between scmodel and spatial model, making it super convenient to fit one model for e.g. an atlas and reuse it multiple times for visium slides.
In terms of default
n_epochs
, they made a lot of sense also for the data I tried it on. Maybe I would be more relaxed with the spatial model (I increased it to 7k) but of course arg very dependent to data/settings.Do you still plan to merge it to master? I'm sure many would use it.
Thank you again! 🎉
The text was updated successfully, but these errors were encountered: