getPotentialParents(
ped,
minSireAge = NULL,
minDamAge = NULL,
minParentAge = lifecycle::deprecated(),
maxGestationalPeriod = NULL,
gestationTable = NULL
)a list of list with each internal list being made up of an animal
id (id), a vector of possible sires (sires) and a vector of
possible dams (dams). The id must be defined while the
vectors sires and dams can be empty. A fourth element,
damBasis, is a single string saying where dams came from:
"provenBreeder" when the candidates are females who gave birth
near the time of the focal birth, "eligibleFemale" when there were
none and dams lists every female old enough and present at the
birth instead, and NA when dams is empty. In both tiers, a
female who delivered another offspring within maxGestationalPeriod
days of the focal birth is never listed. Candidates are listed only for
the parent that is missing: when an animal's dam is recorded its
dams is empty, and when its sire is recorded its sires is
empty. NULL (not a list) is returned when no animal has an unknown
parent with a candidate and when ped has no fromCenter
column.
the pedigree information in data.frame format. Pedigree
(req. fields: id, sire, dam, sex, birth, exit, fromCenter; the
species field is optional). The gen and population
fields are not used. This requires complete pedigree information.
numeric minimum age in years for a male to be proposed
as a potential sire. NULL (default) looks up the floor for each
candidate's species via getSpeciesMinBreedingAge (falling
back to 2 years when the species is missing or unknown); a supplied value
overrides that floor for all male candidates. Candidates with missing
birth dates are not considered.
numeric minimum age in years for a female to be proposed
as a potential dam. NULL (default) looks up the floor for each
candidate's species via getSpeciesMinBreedingAge (falling
back to 2 years when the species is missing or unknown); a supplied value
overrides that floor for all female candidates.
Deprecated scalar
minimum parent age. Supplying it sets both
minSireAge and
minDamAge; use those sex-specific parameters instead. Supplying
NULL disables the age check entirely.
integer maximum number of days between conception
and birth for the species being analyzed (a conservative upper bound, e.g.
210 for rhesus whose typical gestation is about 165 days). When NULL
(the default) the window is looked up per animal from the species
column of ped via getSpeciesGestation, falling back to
210 days for animals whose species is missing or unrecognized; supply an
explicit integer to use one fixed window for every animal. It is used two
ways: (1) a sire who exited the colony between conception
(birth - maxGestationalPeriod) and birth is still retained as a candidate;
and (2) a female who delivered another offspring within maxGestationalPeriod
days of the focal birth is excluded as a candidate dam, because a female
bears one offspring at a time. The sire check uses presence at conception
while the dam check uses presence at birth; this asymmetry is intentional --
a sire need only be present to conceive, whereas a dam must be present
through the pregnancy to give birth.
optional data.frame (columns species,
gestation) passed to getSpeciesGestation for the
per-animal lookup when maxGestationalPeriod is NULL. Defaults
to NULL, which uses the bundled speciesGestation table.
library(nprcgenekeepr)
ped <- nprcgenekeepr::rhesusPedigree
## getPotentialParents needs a logical fromCenter column flagging
## colony-born animals; add one if your pedigree lacks it.
ped$fromCenter <- TRUE
potentialParents <- getPotentialParents(
ped = ped, minSireAge = 2, minDamAge = 2, maxGestationalPeriod = 210L
)
## Each element pairs a focal id with candidate sires and dams.
potentialParents[[1L]]
Run the code above in your browser using DataLab