dot-simulateHalfsib: Simulate Half-Sibling Genotypes

.simulateHalfsibR Documentation

Simulate Half-Sibling Genotypes

Description

This function simulates genotypes for a set of half-siblings based on specified parameters, including the number of individuals, the number of SNPs, recombination boundaries, and the type of data to return. It generates a sire genotype, maternal half-sib genotypes, and combines these to simulate offspring genotypes, optionally returning phased genotypes based on recombination events.

Usage

.simulateHalfsib(
  numInd = 40,
  numSNP = 10000,
  recbound = 0:6,
  type = "genotype"
)

Arguments

numInd

Integer, the number of half-siblings to simulate.

numSNP

Integer, the number of SNPs to simulate for each individual.

recbound

Numeric vector, specifying the range of possible recombination events to simulate.

type

Character string, specifying the type of data to return: "genotype" for genotypic data or any other string for phased genotypic data.

Value

Depending on the type parameter, this function returns a matrix of simulated genotypic data for half-siblings. If type is "genotype", it returns unphased genotypic data; otherwise, it returns phased genotypic data.

Examples

sim_genotypes <- .simulateHalfsib(numInd = 40, numSNP = 10000, recbound = 0:6, type = "genotype")
dim(sim_genotypes) # Should return 40 rows (individuals) and 100 columns (SNPs)


hsphase documentation built on May 29, 2024, 2:20 a.m.