Atkinson-Lab / Tractor

Scripts for implementing the Tractor pipeline
MIT License
44 stars 5 forks source link

Possibility of outputting SNP effect variance in Tractor output #23

Closed nick338 closed 9 months ago

nick338 commented 9 months ago

Hi,

Based on what I can see from the tractor output, there is no error term output for the SNP effect. I was wondering if there is some option I can set in the program so that the error term for each ancestral effect estimate is outputted?

Thanks for any help you can offer.

JasonTan-code commented 9 months ago

Tractor uses logistic/linear regression internally, and you can compute the standard error and confidence interval according to the effect sizes and p values. Here is a general formula in R:

# beta = Geff_anc0 
# pval = Gpval_anc0

chi2 = qchisq(pval, df = 1, lower.tail = F)
z = sqrt(chi2)
se = beta/z
CI_97.5 = beta + 1.96 * se
CI_2.5 = beta - 1.96 * se

We are thinking about incorporating s.e. as part of the summary statistics in the future. But for now, you may use the above code for s.e. and C.I.