Skip to content

Fix HWEzscore sign in snpSummary - #124

Open
chenyangsu wants to merge 1 commit into
Bioconductor:develfrom
chenyangsu:fix/hwe-zscore-sign
Open

chenyangsu wants to merge 1 commit into
Bioconductor:develfrom
chenyangsu:fix/hwe-zscore-sign

Conversation

@chenyangsu

Copy link
Copy Markdown

On row 2 (20:17330_T/A, counts 2/1/0) of extdata/ex2.vcf, snpSummary() returns HWEzscore = -0.3464 though observed heterozygotes (1) exceed the HWE expectation 2*N*a0*a1 = 0.8333; for 0/2/0 it returns HWEzscore = 0 and HWEpvalue = 1. In .HWEzscore(), expt[, 2] already holds the expected count, so * rowSums(genoCounts) scales it by N again.

Drop * rowSums(genoCounts) in zsign and add tests for heterozygote excess, deficit, and equilibrium. Happy to move the synthetic VCF check to a separate test if you prefer.

Testing: RUnit (11 core test files including test_snpSummary.R) -> 72 test functions, 0 errors, 0 failures.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant