ds.exactHWE.RdThis function performs exact Hardy-Weinberg Equilibrium testing (using Fisher's Test) over a selection of SNPs. It also counts genotype, calculates allele frequencies, and calculates inbreeding coefficients.
ds.exactHWE(
genoData,
chromosome = "all",
geno.counts = TRUE,
block.size = 5000,
permute = FALSE,
controls_column = NULL,
datasources = NULL
)character Name of the GenotypeData object on the server
character Chromosome to study. "all" to study all available chromosomes. Use
ds.getChromosomeNames(genoData) to retrieve the name encodings of the chromosomes.
bool (default TRUE) if TRUE, genotype counts are returned in the output data.frame
numeric (default 5000) number of SNPs to read in at once
bool (default FALSE) logical indicator for whether to permute alleles before calculations
character (default NULL) If specified, the control individuals found on this column
(specified by the encoding 1) will be excluded when calculating the HWE.
used to create the GenotypeData object. Only used if controls = TRUE
a list of DSConnection-class objects obtained after login.
A data frame with the following columns:
- snpID: the snpIDs
- chr: chromosome SNPs are on
If geno.counts=TRUE:
- nAA: number of AA genotypes in samples
- nAB: number of AB genotypes in samples
- nBB: number of BB genotypes in samples
- MAF: minor allele frequency
- minor.allele: which allele ("A" or "B") is the minor allele
- f: the inbreeding coefficient
- pval: exact Hardy-Weinberg Equilibrium (using Fisher's Test) p-value.
pval will be NA for monomorphic SNPs (MAF=0).
(from exactHEW documentation): HWE calculations are performed with the HWExact function in the GWASExactHW package. For the X chromosome, only female samples will be used in all calculations (since males are excluded from HWE testing on this chromosome). The X chromosome may not be included in a block with SNPs from other chromosomes. If the SNP selection includes the X chromosome, the scan annotation of genoData should include a "sex" column.
Y and M and chromsome SNPs are not permitted in the SNP selection, since the HWE test is not valid for these SNPs.
If permute=TRUE, alleles will be randomly shuffled before the HWE calculations. Running permutation can yield the expected distribution of p-values and corresponding confidence intervals.