Pedigree loops are usually handled (by pedtools and related packages) under
the hood - using the functions described here - without need for explicit
action from end users. When a ped object x
is created, an internal routine
detects if the pedigree contains loops, in which case x$UNBROKEN_LOOPS
is
set to TRUE.
In cases with complex inbreeding, it can be instructive to plot the pedigree
after breaking the loops. Duplicated individuals are plotted with appropriate
labels (see examples).
The function findLoopBreakers
identifies a set of individuals breaking all
inbreeding loops, but not marriage loops. These require more machinery for
efficient detection, and pedtools does this is a separate function,
findLoopBreakers2
, utilizing methods from the igraph
package. Since this
is rarely needed for most users, igraph
is not imported when loading
pedtools, only when findLoopBreakers2
is called.
In practice, breakLoops
first calls findLoopBreakers
and breaks at the
returned individuals. If the resulting ped object still has loops,
findLoopBreakers2
is called to break any marriage loops.