#the following pedigree has the id of the individual followed by possible parents
#if 0 is unknown
#the possible parents are filled from left to right
#in the pedigree data frame examples:
#id 1,2,3,4 have unknown parents and are assumed unrelated
#id 5 has three possible parents (1,2,3)
#id 6 has three possible parents (2,3,4)
#id 7 has two parents (deterministic case here, the parents are 3 and 4)
#id 8 has four possible parents (5,6,7,1)
pedigree = data.frame(id=1:8,
parent1 = c(0,0,0,0,1,2,3,5),
parent2 = c(0,0,0,0,2,3,4,6),
parent3 = c(0,0,0,0,3,4,0,7),
parent4 = c(0,0,0,0,0,0,0,1),
parent5 = 0)
print(pedigree)
AmatrixPolyCross(pedigree)
#when polyCross is set to be true:
#id 5 is offspring of parent 1 in a deterministic way and two other possible parents (2,3)
#id 6 is offspring of parent 2 in a deterministic way and two other possible parents (3,4)
#id 7 has two parents (deterministic case here, the parents are 3 and 4); as before
#id 8 is offspring of parent 5 in a deterministic way and has three other possible parents (6,7,1)
AmatrixPolyCross(pedigree,fixedParent=TRUE)
Run the code above in your browser using DataLab