dviSim {dvir}R Documentation

Simulate genotypes in a DVI dataset

Description

Simulates genotypes for the references and missing persons in each AM family, transfers to the PM singletons according to the indicated matching. Remaining victims are simulated as unrelated.

Usage

dviSim(
  dvi,
  N = 1,
  refs = typedMembers(dvi$am),
  truth = NULL,
  seed = NULL,
  conditional = FALSE,
  simplify1 = TRUE,
  verbose = FALSE
)

Arguments

dvi

A dviData object.

N

The number of complete simulations to be performed.

refs

A character indicating reference individuals. By default, the typed members of the input. If conditional = TRUE, the refs should be a subset of the typed members, and the simulations are conditional on these.

truth

A named vector of the format c(vic1 = mis1, vic2 = mis2, ...).

seed

An integer seed for the random number generator.

conditional

A logical, by default FALSE. If TRUE, references are kept unchanged, while the missing persons are simulated conditional on these.

simplify1

A logical, by default TRUE, removing the outer list layer when N = 1. See Value.

verbose

A logical.

Value

If N = 1, a dviData object similar to the input, but with new genotypes for the pm samples. If N > 1, a list of dviData objects.

See Also

forrel::profileSim().

Examples


# Simulate refs and missing once and plot:
ex = dviSim(example2, N = 1, truth = c(V1 = "M1", V2 = "M2", V3 = "M3"))
plotDVI(ex, marker = 1)

# Two simulations and plot for the first
ex = dviSim(example2, N = 2, truth = c(V1 = "M1", V2 = "M2", V3 = "M3"),
            seed = 1729)
plotDVI(ex[[1]], marker = 1)



[Package dvir version 3.3.0 Index]