Learn R Programming

AlphaSimR (version 2.1.0)

mendelianSampling: Calculate Mendelian sampling

Description

Calculate Mendelian sampling

Usage

mendelianSampling(
  pop,
  parents = NULL,
  mothers = NULL,
  fathers = NULL,
  use = "gv",
  simParam = NULL
)

Value

a matrix of Mendelian samplings with dimensions nInd by nTraits

Arguments

pop

Pop-class with individuals whose parent average will be calculated

parents

Pop-class with mothers and fathers of individuals in pop; if NULL must provide mothers and fathers

mothers

Pop-class with mothers of individuals in pop; if NULL must provide parents

fathers

Pop-class with fathers of individuals in pop; if NULL must provide parents

use

character, calculate using "gv", "bv", "ebv", or "pheno"

simParam

SimParam object

Examples

Run this code
#Create founder haplotypes
founderPop = quickHaplo(nInd=10, nChr=1, segSites=10)

#Set simulation parameters
SP = SimParam$new(founderPop)
SP$addTraitAD(10, meanDD=0.5)
SP$setVarE(h2=0.5)
SP$nThreads = 1L

#Create population
pop = newPop(founderPop, simParam=SP)
pop2 = randCross(pop, nCrosses=10, nProgeny=2)
mendelianSampling(pop2, parents = pop)
mendelianSampling(pop2, mothers = pop, fathers = pop)

Run the code above in your browser using DataLab