pedCreate {paramlink} | R Documentation |
Create simple pedigrees
Description
These are utility functions for creating some common pedigree structures as
linkdat
objects.
Usage
nuclearPed(noffs, sex)
cousinsPed(degree, removal = 0, degree2 = NULL, child = FALSE)
halfCousinsPed(degree, removal = 0, degree2 = NULL, child = FALSE)
doubleCousins(degree1, degree2, removal1 = 0, removal2 = 0, child = FALSE)
doubleFirstCousins()
quadHalfFirstCousins()
fullSibMating(generations)
halfSibStack(generations)
cousinPed(degree)
halfCousinPed(degree)
Arguments
noffs |
A positive integer, the number of offspring in the nuclear family. |
sex |
A vector of length |
degree , degree1 , degree2 |
Non-negative integers, indicating the degree of cousin-like relationships: 0=siblings, 1=first cousins; 2=second cousins, a.s.o. See Details and Examples. |
removal , removal1 , removal2 |
Non-negative integers, indicating removals of cousin-like relationships. See Details and Examples. |
child |
A logical: Should an inbred child be added to the two cousins? |
generations |
A positive integer indicating the number of crossings. |
Details
All individuals are created as unaffected. Use swapAff
to edit
this (see Examples). Use swapSex
to change gender of pedigree
members.
The call cousinsPed(degree=n, removal=k)
creates a pedigree with two
n'th cousins, k times removed. By default, removals are added on the right
side. To override this, the parameter degree2
can be used to indicate
explicitly the number of generations on the right side of the pedigree. When
degree2
is given removal
is ignored. (Similarly for
halfCousinsPed
.)
The function doubleCousins
creates two individuals whose fathers are
cousins (degree1
, removal1
) as well as their mothers
(degree2
, removal2
). For simplicity, a wrapper
doubleFirstCousins
is provided for the most common case, double first
cousins. Finally quadHalfFirstCousins
produces a pedigree with
quadruple half first cousins.
fullSibMating
crosses full sibs continuously for the indicated number
of generations.
halfSibStack
produces a breeding scheme where the two individuals in
the final generation are simultaneously half siblings and half n'th cousins,
where n=1,...,generations
.
cousinPed
and halfCousinPed
(written without the 's') are
depreciated functions kept for backwards compatibility. They create cousin
pedigrees, but without possibility for removals, and with a different
ordering than their replacements cousinsPed
and halfCousinsPed
.
Value
A linkdat
object.
See Also
swapAff
, swapSex
,
removeIndividuals
, addOffspring
,
relabel
Examples
# A nuclear family with 2 boys and 3 girls,
# where the father and the two boys are affected.
x = nuclearPed(noffs=5, sex=c(1,1,2,2,2))
x = swapAff(x, ids=c(1,3,4))
# Half sibs:
halfCousinsPed(degree=0)
# Grand aunt:
cousinsPed(degree=0, removal=2)
# Second cousins once removed.
cousinsPed(degree=2, removal=1)
# Again second cousins once removed,
# but with the 'removal' on the left side.
cousinsPed(degree=3, degree2=2)
# A child of first cousin parents.
cousinsPed(degree=1, child=TRUE)
# Consecutive brother-sister matings.
fullSibMating(3)
# Simultaneous half siblings and half first cousins
halfSibStack(2)
# Double first cousins
doubleFirstCousins()
# Quadruple half first cousins
# Weird plotting behaviour for this pedigree.
x = quadHalfFirstCousins()
#plot(x)