R/utils_fQC.R
check.snp.hwe.chi2.RdThis function identifies SNP markers whose Hardy-Weinberg equilibrium (HWE) chi-square p-values
indicate significant deviation beyond a specified threshold. It uses the p-values computed by
get.hwe.chi2 on the input summary data frame.
check.snp.hwe.chi2(snp.summary, max.dev)A data frame or matrix containing summary statistics for SNP markers.
The row names should correspond to SNP identifiers. It must be compatible with
the function get.hwe.chi2.
A numeric value specifying the maximum acceptable p-value threshold. SNPs with p-values below this threshold are considered as deviating from HWE.
A character vector of SNP identifiers (rownames) that fail the HWE test (p-value < max.dev).
If no SNPs fail, an empty vector is returned.
Any SNP with missing p-value (NA) is treated as not failing (returned as FALSE).
# Example usage (assuming snp.summary is precomputed and get.hwe.chi2 is defined)
# snps_failed <- check.snp.hwe.chi2(snp.summary, max.dev = 0.05)