#Create founder haplotypes
founderPop = quickHaplo(nInd=2, nChr=1, segSites=20)
#Set simulation parameters
SP = SimParam$new(founderPop)
SP$nThreads = 1L
SP$addTraitA(10)
SP$setVarE(h2=0.5)
SP$addSnpChip(10)
#Create population
pop = newPop(founderPop, simParam=SP)
#Run GS model and set EBV
ans = RRBLUP_SCA(pop, simParam=SP)
pop = setEBV(pop, ans, simParam=SP)
#Evaluate accuracy
cor(gv(pop), ebv(pop))
Run the code above in your browser using DataLab