In a newly simulated population, each individual only knows its father and children. Using this information, this function builds pedigrees. This makes it easier to e.g. population haplotypes, find path between two individuals (if they are not in the same pedigree, they are not connected).

build_pedigrees(population, progress = TRUE)

Arguments

population

Population generated by sample_geneology() or sample_geneology_varying_size().

progress

Show progress.

Value

An object with class malan_pedigreelist (an internal list of external pointers to pedigrees).

See also

sample_geneology() and sample_geneology_varying_size() for simulating populations.

Examples

sim <- sample_geneology(100, 10) str(sim, 1)
#> List of 7 #> $ population :Classes 'malan_population', 'externalptr' <externalptr> #> $ generations : num 10 #> $ founders : int 19 #> $ growth_type : chr "ConstantPopulationSize" #> $ sdo_type : chr "StandardWF" #> $ end_generation_individuals:List of 100 #> $ individuals_generations :List of 212 #> - attr(*, "class")= chr [1:2] "malan_simulation" "list"
sim$population
#> Population with 384 individuals
peds <- build_pedigrees(sim$population) peds
#> List of 19 pedigrees (of size 57, 41, 33, 30, 28, 22, ...)