sim_generate_donor_hap: This function generates the diploid donor haplotypes of...

View source: R/sim_generate_donor_hap.R

sim_generate_donor_hapR Documentation

This function generates the diploid donor haplotypes of length num_snps with only heterozygous sites

Description

This function generates the diploid donor haplotypes by first generating a single haplotype using a uniform distribution to pick the reference (a 0) or the alternate (a 1) allele for each position for num_snps positions. Then for the second donor haplotype we assume that each of these SNP positions are heterozygous and just invert the bits of the first haplotypes to make this so.

Usage

sim_generate_donor_hap(num_snps)

Arguments

num_snps

an integer, the number of SNP positions for which we want to generate data

Value

donor_haps a data frame with the truth phased diploid donor haplotypes with two columns donor1 and donor2


mccoy-lab/rhapsodi documentation built on July 27, 2022, 3:56 a.m.