magic.sim: Simulate populations based on the MAGIC design.

View source: R/magic_sim.R

magic.simR Documentation

Simulate populations based on the MAGIC design.

Description

This function takes the crossing plans (xplan) and simulates populations based on the crossing plans. Simulation is done using AlphaSimR. The founder genotypes in the RILs from each simulation are summarized. By default, the simulated marker data is not kept. If the simulated marker data is really required, please set n.sim to 1 or any small value as the output object can be large.

Usage

magic.sim(
  xplan,
  inbred = TRUE,
  marker.dist = 0.01,
  chr.len = c(1, 2),
  n.sim = 1,
  hap.int = 0.05,
  n.hap = 1,
  keep = FALSE
)

Arguments

xplan

a list of crossing plans (xplan).

inbred

a logical indicator of whether the founders are inbred.

marker.dist

a numerical value of marker distance in Morgan.

chr.len

a vector of chromosome lengths in Morgan.

n.sim

an integer of number of simulations.

hap.int

a numerical value of marker interval for evaluating haplotypes.

n.hap

an integer of 1 or 2 haploid marker data of each RIL are used.

keep

a logical indicator of whether to keep the marker data.

Value

a list of simulation summary.

Examples


mpop <- magic.partial(n=8, m=1, balanced=TRUE)
mpop <- magic.sim(xplan=mpop$xplan)



cjyang-sruc/magicdesign documentation built on March 19, 2022, 9:34 a.m.