ds.exactHWE: Hardy-Weinberg Equilibrium testing

View source: R/ds.exactHWE.R

ds.exactHWER Documentation

Hardy-Weinberg Equilibrium testing

Description

This 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.

Usage

ds.exactHWE(
  genoData,
  chromosome = "all",
  geno.counts = TRUE,
  block.size = 5000,
  permute = FALSE,
  controls_column = NULL,
  datasources = NULL
)

Arguments

genoData

character Name of the GenotypeData object on the server

chromosome

character Chromosome to study. "all" to study all available chromosomes. Use ds.getChromosomeNames(genoData) to retrieve the name encodings of the chromosomes.

geno.counts

bool (default TRUE) if TRUE, genotype counts are returned in the output data.frame

block.size

numeric (default 5000) number of SNPs to read in at once

permute

bool (default FALSE) logical indicator for whether to permute alleles before calculations

controls_column

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

datasources

a list of DSConnection-class objects obtained after login.

Details

(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.

Value

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).


isglobal-brge/dsOmicsClient documentation built on March 20, 2023, 3:52 p.m.