The Haplin framework includes different modules for assessing genetic effects: haplin
,
haplinStrat
and haplinSlide
. hapPowerAsymp
computes the asymptotic power for these analyses, which enables power calculations of fetal effects, maternal effects and/or parent-of-origin effects. Various family designs, i.e., triads, case-control, the hybrid design, and all intermediate designs, are possible.
It also allows power calculation of gene-environment interaction effects and effects on X-chromosome markers.
hapPower
computes power through "brute force" simulations using hapRun
. This is a robust way of checking software implementations, asymptotic approximations
and attained significance level. However, both power and the corresponding sample size calculations can be performed much more efficiently using asymptotic approximations.
The asymptotic power is calculated applying the non-centrality parameter of the Wald tests, which use the asymptotic normal distribution of the log-scale parameter. The function hapCovar
(used by hapPowerAsymp
) computes the variance-covariance matrix
by applying the log-linear model combined with the EM algorithm.
Specifying haplotype risks:
The number of haplotypes used in the simulations is determined by the nall
argument, since prod(nall)
different haplotypes can be made from the specified number of markers, length(nall)
. The arguments haplo.freq
, RR
, RRcm
, RRcf
, RRstar
, RR.mat
, and RRstar.mat
are all lists where each element represents a stratum. Within each stratum, the arguments are vectors of length equal to the number of haplotypes, specifying the relative risk etc. associated with each haplotype.
The stratum specific arguments may be simplified if the number of strata is one, or if the arguments are equal across all strata.
The haplotypes are determined by creating all possible haplotypes from the given markers, in a sequence where the first marker varies mostly quickly. For instance, if nall = c(3,2)
, the first marker has 3 alleles, the second has 2, and 6 haplotypes are possible. Taken in order, the haplotypes are 1-1, 2-1, 3-1, 1-2, 2-2, and 3-2. When specifying, say, RR = c(1,2,1,1,1,1)
the haplotype 2-1 has a double risk compared to the rest. With, for instance, two strata, the specification RR = list(c(1,2,1,1,1,1), c(1,1,1,1,1,1))
would mean that the risk associated with 2-1 is elevated only in the first stratum, not the second.
The simplest example would be with nall = c(2)
and RR = c(1,2)
, which would simulate a single SNP where the second allele has a double risk.
Specifying genetic effects:
Standard fetal effects are specified by the arguments RR
and RRstar
, whereas parent-of-origin effects are addressed by the arguments RRcm
, RRcf
and RRstar
. Maternal effects are included by the additional arguments RRmat
and RRstar.mat
.