Create simple pedigrees
Utility functions for creating some common pedigree structures.
nuclearPed(nch = 1, sex = 1, father = "1", mother = "2", children = NULL) halfSibPed( nch1 = 1, nch2 = 1, sex1 = 1, sex2 = 1, type = c("paternal", "maternal") ) linearPed(n, sex = 1) cousinPed(degree, removal = 0, side = c("right", "left"), child = FALSE) halfCousinPed(degree, removal = 0, side = c("right", "left"), child = FALSE) ancestralPed(g) selfingPed(s, sex = 1)
nch |
The number of children, by default 1. If |
sex |
A vector with integer gender codes (0=unknown, 1=male, 2=female).
In |
father |
The label of the father. Default: "1". |
mother |
The label of the mother. Default: "2". |
children |
A character with labels of the children. Default: "3", "4", ... |
nch1, nch2 |
The number of children in each sibship. |
sex1, sex2 |
Vectors of gender codes for the children in each sibship.
Recycled (if necessary) to lengths |
type |
Either "paternal" or "maternal". |
n |
The number of generations, not including the initial founders. |
degree |
A non-negative integer: 0=siblings, 1=first cousins; 2=second cousins, a.s.o. |
removal |
A non-negative integer. See Details and Examples. |
side |
Either "right" or "left"; the side on which removals should be added. |
child |
A logical: Should an inbred child be added to the two cousins? |
g |
A nonnegative integer indicating the number of ancestral generations
to include. The resulting pedigree has |
s |
A nonnegative integer indicating the number of consecutive selfings.
The case |
halfSibPed(nch1, nch2)
produces a pedigree containing two sibships (of
sizes nch1
and nch2
) with the same father, but different mothers. If
maternal half sibs are wanted instead, add type = "maternal"
.
cousinPed(degree = n, removal = k)
creates a pedigree with two n
'th
cousins, k
times removed. By default, removals are added on the right side,
but this can be changed by adding side = left
. (Similarly for
halfCousinPed
.)
ancestralPed(g)
returns the family tree of a single individual, including
all ancestors g
generations back.
selfingPed(s)
returns a line of s
consecutive selfings.
A ped
object.
# A nuclear family with 2 boys and 3 girls nuclearPed(5, sex = c(1, 1, 2, 2, 2)) # A straight line of females linearPed(3, sex = 2) # Paternal half brothers halfSibPed() # Maternal half sisters halfSibPed(sex1 = 2, sex2 = 2, type = "maternal") # Larger half sibships: boy and girl on one side; 3 girls on the other halfSibPed(nch1 = 2, sex = 1:2, nch2 = 3, sex2 = 2) # Grand aunt: cousinPed(degree = 0, removal = 2) # Second cousins once removed. cousinPed(degree = 2, removal = 1) # Same, but with the 'removal' on the left side. cousinPed(2, 1, side = "left") # A child of half first cousins. halfCousinPed(degree = 1, child = TRUE) # The 'family tree' of a person ancestralPed(g = 2)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.