nb.causal
, p.protect
, h2
and prev
should be vectors of length corresponding to the number of groups to simulate. If they are of size 1, values will be duplicated.
All monomorphic variants and variants with a MAF higher than max.maf.causal
will have a weight of 0. Causal variants are sampled among variants having weights greater than 0. Causal variants in each group of individuals are indicated in x@ped$Causal
.
A liability model is built on haplotypes' burden computed on sampled causal variants using each variant's weights
, and adjusted on the desired h2
. Thresholds from this liability are then chosen to respect the given prev
(from a standard normal distribution if normal.approx=TRUE
, or using a distribution from 1e6 sampled burdens if normal.approx=FALSE
). Please be carreful when using the normal approximation with high h2
values or low prev
values.
Haplotypes' probabilities in each group of individuals are then computed and two haplotypes are then sampled for each individual based on these probabilities.
To simulate a group of controls, prev
needs to be set at 1, regardless of the other arguments.
N replicates
will be performed, and to gain in computation time, the same causal variants can be used for multiple replicates as different haplotypes will be sampled for each individual. rep.by.causal
indicates the number of replicates to perform for each set of causal variants.
To ensure a variability in the simulations, we yet recommend to resample causal variants a few times when many replicates are to be performed.
For example, if 1000 replicates are to be performed, we recommend to resample causal variants 20 times.
The phenotype will be stored in @ped$pheno
, and the simulation number is @snps$genomic.region
.