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

how to calculate variance in summary data.frame ? #1

Open
czlcaltech opened this issue Sep 21, 2020 · 1 comment
Open

how to calculate variance in summary data.frame ? #1

czlcaltech opened this issue Sep 21, 2020 · 1 comment

Comments

@czlcaltech
Copy link

czlcaltech commented Sep 21, 2020

Hello, iDEA team:

Thanks for your iDEA packages. I read your iDEA paper published in NC, and I want to apply your package to analysis my data. However, when following the tutorial, I don't quite understand what is the variance (which is the second column in input summary data) refers to and how to calculate it, since the findmarkers function in Seurat and the data.frame returned from MAST do not include "variance". And due to my poor statistical knowledge, I cannot understand your explanations in the original paper. Could you please specify how the variance is calculated? Thanks.

Best,
Zhangliang

@YingMa0107
Copy link
Contributor

YingMa0107 commented May 24, 2021

Hi Zhangliang (@czlcaltech),

Sorry about the late reply. Here is an example to calculate the variance

# Assume you have obtained the MAST's results from Seurat, res_mast, which contains the column Pr(>Chisq) or LogFC. 
pvalue <- res_mast$`Pr(>Chisq)` #### the pvalue column
zscore <- qnorm(pvalue/2.0, lower.tail=FALSE) #### convert the pvalue to z-score
beta <- res_mast$LogFC ## effect size
se_beta <- beta/zscore ## to approximate the standard error of beta
var_beta = se_beta^2  ### square 

Hope this helps!

Best,
Ying

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