Learn R Programming

ibdsim2 (version 1.2)

profileSimIBD: Simulate markers on a given IBD pattern

Description

This function simulates genotypes for a set of markers, conditional on a specific underlying IBD pattern.

Usage

profileSimIBD(x, ibdpattern, ids = NULL, markers = NULL, seed = NULL)

Arguments

x

A ped object.

ibdpattern

A genomeSim() object, typically created by ibdsim(). (See Examples).

ids

A vector of ID labels. If NULL, all members of x are included.

markers

A vector with names of indices of markers attached to x.

seed

An integer seed for the random number generator.

Value

An object similar to x. but with simulated genotypes.

Details

It should be noted that the only random part of this function is the selection of founder alleles for each marker. Given those, all other genotypes in the pedigree are determined by the underlying IBD pattern.

See Also

ibdsim()

Examples

Run this code
# NOT RUN {
# A pedigree with two siblings
x = nuclearPed(2)

# Attach 3 linked markers on chromosome 1
pos = c(20, 50, 70)   # marker positions in megabases
mlist = lapply(pos, function(i)
  marker(x, alleles = letters[1:10], chrom = 1, posMb = i))
x = setMarkers(x, mlist)

# Simulate the underlying IBD pattern in the pedigree
s = ibdsim(x, 1, map = uniformMap(M = 1, chrom = 1), seed = 123)[[1]]

# Simulate genotypes for the sibs conditional on the given IBD pattern
profileSimIBD(x, s, ids = 3:4, seed = 123)

# With a different seed
profileSimIBD(x, s, ids = 3:4, seed = 124)

# }

Run the code above in your browser using DataLab