The main content of pedprobr is an implementation of the Elston-Stewart algorithm for pedigree likelihoods. It is a reboot of the implementation in paramlink which is no longer actively developed.
pedprobr is part of the ped suite, a collection of packages for pedigree analysis in R, based on pedtools for basic handling of pedigrees and marker data. In particular, pedprobr does much of the hard work in the forrel package for relatedness analysis and forensic pedigree analysis.
The workhorse of the pedprobr package is the likelihood()
function, which works in a variety of situations:
To get the current official version of pedprobr
, install from CRAN as follows:
Alternatively, you can obtain the latest development version from GitHub:
# install.packages("devtools") # install devtools if needed
devtools::install_github("magnusdv/pedprobr")
To set up a simple example, we first use pedtools
utilities to create a pedigree and attach to it a marker object. The marker has alleles 1
and 2
, with frequencies 0.2 and 0.8 respectively, and both brothers are heterozygous.
x = nuclearPed(nch = 2)
m = marker(x, '3' = 1:2, '4' = 1:2, alleles = 1:2, afreq = c(0.2, 0.8))
x = addMarkers(x, m) # attach the marker
x
#> id fid mid sex <1>
#> 1 * * 1 -/-
#> 2 * * 2 -/-
#> 3 1 2 1 1/2
#> 4 1 2 1 1/2
The pedigree likelihood, i,.e., the probability of observing these genotypes given the pedigree, may now be obtained as follows:
Besides likelihood()
the most important functions in pedprobr are:
oneMarkerDistribution()
: for a subset of family members, compute their joint genotype distribution at a single markertwoMarkerDistribution()
: for a single family member, compute the joint genotype distribution at two linked markersIn both cases, the distributions are computed conditionally on any known genotypes at the markers in question.
For an illustration of oneMarkerDistribution()
we may continue our example from above, and answer the following question: Conditional on the two heterozygous children, what is the joint distribution for the parents?
The answer is easily found as follows: