rankProfiles {forrel} | R Documentation |
Find the most likely profiles of a pedigree member
Description
Identify and rank the most likely DNA profiles of a pedigree member. For each marker, the possible genotypes of the indicated person are ranked by likelihood.
Usage
rankProfiles(x, id, markers = NULL, maxPerMarker = Inf, verbose = FALSE)
Arguments
x |
A |
id |
The name of a single (typically untyped) pedigree member. |
markers |
Names or indices of the markers to be included. Default: all. |
maxPerMarker |
A single number, limiting the number of top genotypes
considered for each marker. Default: |
verbose |
A logical, by default FALSE. |
Details
Note that this function assumes that all markers are independent.
If the marker data includes mutation models, it may be wise to try first with
maxPerMarker = 1
to limit computation time.
Value
A list with the following components (N
denotes the number of
markers):
-
profiles
: A data frame withN+1
columns, containing the possible profiles, ranked by likelihood. -
marginal1
: A numeric of lengthN
, giving the marginal probability of the most likely genotype for each marker. -
marginal2
: A numeric of lengthN
, with marginals for the second most likely genotype for each marker, orNA
if there is no second. -
best
: A character of lengthN
containing the most likely profile. This is the same asnames(marginal1)
, and also asprofiles[1, 1:N]
.
Examples
x = nuclearPed(nch = 4) |>
markerSim(N = 4, alleles = c("a", "b", "c"), seed = 1, verbose = FALSE)
x
# Remove data for father
y = setAlleles(x, ids = 1, alleles = 0)
# Most likely profiles of father
rankProfiles(y, id = 1)
# Compare with truth
getGenotypes(x, ids = 1)
# Same example with mutations allowed
z = setMutmod(y, model = "equal", rate = 0.01)
rankProfiles(z, id = 1)