Skip to content
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

counts of gene g at spot s from cell c? #26

Open
gorkemkose opened this issue May 25, 2021 · 2 comments
Open

counts of gene g at spot s from cell c? #26

gorkemkose opened this issue May 25, 2021 · 2 comments

Comments

@gorkemkose
Copy link

Hi!

Thank you for developing such a nice tool!

I guess the fit_sc_data function returns the parameters that are obtained from SC data's negative binomial distribution. Is this the same thing as r_zg, rate parameter for cell type z and gene g introduced in the paper? Since the method computes counts of gene g at spot s using x_sgc, is there a way we obtain the values of x_sgc, counts of gene g at spot s from cell c as a matrix as well?

Thanks for your time,
Görkem

@almaan
Copy link
Owner

almaan commented May 25, 2021

Hello @gorkemkose, I'm glad that you found stereoscope useful!

You are correct in your assumption that the R.*tsv files contain the rates corresponding to the r_zg parameter in the paper. Currently, there is no way to obtain the counts that originates from a specific cell type for a given spot in the stereoscope implementation.

However, there might be a solution, what you could do is to compute the expected value for the spots (see: https://en.wikipedia.org/wiki/Negative_binomial_distribution), which would figure as an estimate of the actual x_sgc value. In order to do this, you would need the unadjusted proportions; i.e., the values that are normalized in fit.py (lin 227), code : W = W / W.sum(axis = 1).reshape(-1,1). Now, I still want to raise a cautionary word, that this is not something I've tested and thoroughly validated, but theoretically it should give you the information you are looking for.

My suggestion would be for you to either : (1) fork stereoscope and add a step where the unadjusted proportions are saved, or (2) if you are very keen on getting these values, I could - when time permits - create a branch for you where said information is saved in addition to the true proportions.

Hope this answered your questions, and lmk how you plan to proceed with this!

Best
/A

@gorkemkose
Copy link
Author

Hello again!

Sorry for the late reply, I've drowned in the finals and had a short break for the research! This seems exciting, let me try to add the step you have mentioned first. If I can't, will definitely contact you so that maybe you could add this feature when the time permits!

Thanks for the support!
Görkem

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

No branches or pull requests

2 participants