mccoy-lab / hgv_modules

Teaching modules for Human Genome Variation Lab.
https://mccoy-lab.github.io/hgv_modules/
Creative Commons Attribution 4.0 International
19 stars 3 forks source link

Query regarding D' formula in "4.9 Measuring LD with D'" #7

Closed wwliao closed 1 year ago

wwliao commented 1 year ago

Thank you for sharing this wonderful resource!

I have a small query about the formula for the D' in the "4.9 Measuring LD with D'" section. It's currently shown as:

$$ D' = \frac{D}{\mathrm{max}(-p_1 (1-p_1), -q_1 (1-q_1))}, \mathrm{for\ } D < 0 $$

$$ D' = \frac{D}{\mathrm{min}(p_1 (1-p_1), q_1 (1-q_1))}, \mathrm{for\ } D > 0 $$

However, I think it might be:

$$ D' = \frac{D}{\mathrm{max}(-p_1 q_1, -(1-p_1) (1-q_1))}, \mathrm{for\ } D < 0 $$

$$ D' = \frac{D}{\mathrm{min}(p_1 (1-q_1), (1-p_1) q_1)}, \mathrm{for\ } D > 0 $$

Could you kindly verify this?

Thank you for your time and dedication.

stephaniemyan commented 1 year ago

Thanks for the catch! I must have mistyped the formula at first and propagated it throughout the module. Just fixed it - and now the LDlink and hand-calculated D' values match almost perfectly, which is a good sanity check.