profileSimIBD: Simulate markers on a given IBD pattern

Description Usage Arguments Details Value See Also Examples

View source: R/profileSimIBD.R

Description

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

Usage

1
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 or indices of markers attached to x.

seed

An integer seed for the random number generator.

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.

Value

An object similar to x. but with simulated genotypes.

See Also

ibdsim()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# 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)

ibdsim2 documentation built on Nov. 13, 2020, 5:06 p.m.