
The pedigree of one maternal line and the sires of its young
Source:R/getMaternalLinePedigree.R
getMaternalLinePedigree.RdReturns the rows of a pedigree that draw one maternal line of
makeColonyOverview: every animal of the line plus the sires
of those animals. Pass the rows to makePedigreeMatingLayout
and drawPedigreeDiagram to draw the line, as the Pedigree
Browser's colony overview does when a line is clicked.
Arguments
- ped
a pedigree data frame with
id,sireanddamcolumns, such asqcStudbookreturns. To draw the rows, it also needs thesexandgencolumnsmakePedigreeMatingLayoutreads.- line
the id of the line's founding dam: one of the
linevalues ofmakeColonyOverview. A line of any size may be given, not only a drawn one.
Details
An animal's maternal line is found as makeColonyOverview
finds it: its dams are followed back to the earliest one in the pedigree,
the founding dam, whose id names the line. A sire is added when he
has a row in the pedigree, generated unknown-parent ids (see
addUIds) included; dams outside the line are not added.
The rows are kept in the pedigree's order and numbered afresh. A
sire or dam that is not among them is set to NA, so
the rows stand alone as a pedigree. Every other column, gen
included, is kept as it is.
Examples
library(nprcgenekeepr)
ped <- nprcgenekeepr::examplePedigree
overview <- makeColonyOverview(ped)
rows <- getMaternalLinePedigree(ped, overview$lines$line[[1L]])
nrow(rows)
#> [1] 49
layout <- makePedigreeMatingLayout(rows)
drawPedigreeDiagram(layout)