HapSim: a simulation tool for generating haplotype data with pre-specified allele frequencies and LD coefficients. We have developed a simulation tool HapSim for the generation of haplotype data. The simulated haplotypes are such that their allele frequencies and linkage disequilibrium coefficients match exactly those estimated in a real sample. Availability: The program is available as an R package and can be downloaded from https://cran.r-project.org/web/packages/hapsim/index.html