simul.pedigree: Simulation of pedigree structure

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/simul.pedigree.r

Description

This function can be used to simulate a pedigree for a given number of generations and individuals. Function assumes random mating within generations. Inbred individuals may be generated by chance.

Usage

1
simul.pedigree(generations = 2, ids = 4, animals=FALSE,familySize=1)

Arguments

generations

integer. Number of generations to simulate

ids

integer or vector of integers. Number of genotypes in each generation. If length equal one, the same number will be replicated and used for each generation.

animals

logical. Should a pedigree for animals be simulated (no inbreeding)? See 'Details'.

familySize

numeric. Number of individuals in each full-sib family in the last generation.

Details

If animals=FALSE, the parents for the current generation will be randomly chosen out of the genotypes in the last generation. If Par1 = Par2, an inbreed is generated. If animal=TRUE, each ID is either sire or dam. Each ID is progeny of one sire and one dam.

Value

An object of class pedigree with N=sum(ids) genotypes.

Author(s)

Valentin Wimmer

See Also

simul.phenotype, create.pedigree, plot.pedigree

Examples

1
2
3
4
5
6
# example for plants
ped <- simul.pedigree(gener=4,ids=c(3,5,8,8))
plot(ped)
#example for animals
peda <- simul.pedigree(gener=4,ids=c(3,5,8,8),animals=TRUE)
plot(peda)

Example output

IGRAPH b2ffb17 DN-- 24 42 -- 
+ attr: name (v/c), Par1 (v/c), Par2 (v/c), gener (v/n), sex (v/l)
+ edges from b2ffb17 (vertex names):
 [1] ID1 ->ID4  ID3 ->ID5  ID2 ->ID6  ID3 ->ID7  ID2 ->ID8  ID8 ->ID9 
 [7] ID7 ->ID10 ID5 ->ID11 ID8 ->ID12 ID7 ->ID13 ID5 ->ID14 ID5 ->ID15
[13] ID7 ->ID16 ID13->ID17 ID10->ID18 ID9 ->ID19 ID11->ID20 ID14->ID21
[19] ID11->ID22 ID13->ID23 ID15->ID24 ID2 ->ID4  ID1 ->ID5  ID3 ->ID6 
[25] ID3 ->ID7  ID2 ->ID8  ID7 ->ID9  ID5 ->ID10 ID5 ->ID11 ID7 ->ID12
[31] ID5 ->ID13 ID6 ->ID14 ID4 ->ID15 ID4 ->ID16 ID9 ->ID17 ID13->ID18
[37] ID14->ID19 ID13->ID20 ID14->ID21 ID12->ID22 ID10->ID23 ID11->ID24
IGRAPH b516e17 DN-- 24 42 -- 
+ attr: name (v/c), Par1 (v/c), Par2 (v/c), gener (v/n), sex (v/n)
+ edges from b516e17 (vertex names):
 [1] ID2 ->ID4  ID2 ->ID5  ID2 ->ID6  ID3 ->ID7  ID2 ->ID8  ID8 ->ID9 
 [7] ID8 ->ID10 ID4 ->ID11 ID4 ->ID12 ID8 ->ID13 ID4 ->ID14 ID8 ->ID15
[13] ID4 ->ID16 ID15->ID17 ID10->ID18 ID13->ID19 ID10->ID20 ID13->ID21
[19] ID13->ID22 ID13->ID23 ID10->ID24 ID2 ->ID4  ID1 ->ID5  ID1 ->ID6 
[25] ID2 ->ID7  ID1 ->ID8  ID6 ->ID9  ID6 ->ID10 ID6 ->ID11 ID5 ->ID12
[31] ID7 ->ID13 ID7 ->ID14 ID7 ->ID15 ID7 ->ID16 ID12->ID17 ID16->ID18
[37] ID12->ID19 ID16->ID20 ID12->ID21 ID16->ID22 ID11->ID23 ID14->ID24

synbreed documentation built on March 19, 2018, 3 p.m.