
Last chance! 50% off unlimited learning
Sale ends in
Creates an initial Pop-class
from an object of
MapPop-class
or NamedMapPop-class
.
The function is intended for use with output from functions such
as runMacs
, newMapPop
, or
quickHaplo
.
newPop(rawPop, simParam = NULL, ...)
Returns an object of Pop-class
an object of MapPop-class
or
NamedMapPop-class
an object of SimParam
additional arguments used internally
Note that newPop
takes genomes from the
rawPop
and uses them without recombination! Hence, if you
call newPop(rawPop = founderGenomes)
twice, you will get
two sets of individuals with different id but the same genomes.
To get genetically different sets of individuals you can subset the
rawPop
input, say first half for one set and the second half
for the other set.
#Create founder haplotypes
founderPop = quickHaplo(nInd=2, nChr=1, segSites=10)
#Set simulation parameters
SP = SimParam$new(founderPop)
SP$addTraitA(10)
#Create population
pop = newPop(founderPop, simParam=SP)
isPop(pop)
#Misc
pop@misc$tmp1 = rnorm(n=2)
pop@misc$tmp2 = rnorm(n=2)
#MiscPop
pop@miscPop$tmp1 = sum(pop@misc$tmp1)
pop@miscPop$tmp2 = sum(pop@misc$tmp2)
Run the code above in your browser using DataLab