rankProfiles: Find the most likely profiles of a pedigree member

View source: R/rankProfiles.R

rankProfilesR 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 ped object with attached markers.

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: Inf (no restriction).

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 with N+1 columns, containing the possible profiles, ranked by likelihood.

  • marginal1: A numeric of length N, giving the marginal probability of the most likely genotype for each marker.

  • marginal2: A numeric of length N, with marginals for the second most likely genotype for each marker, or NA if there is no second.

  • best: A character of length N containing the most likely profile. This is the same as names(marginal1), and also as profiles[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)


forrel documentation built on June 8, 2025, 10:15 a.m.