oneMarkerDistribution {pedprobr} | R Documentation |
Genotype distribution for a single marker
Description
Computes the genotype probability distribution of one or several pedigree members, possibly conditional on known genotypes for the marker.
Usage
oneMarkerDistribution(
x,
ids,
partialmarker,
loopBreakers = NULL,
eliminate = 0,
grid.subset = NULL,
verbose = TRUE
)
Arguments
x |
A |
ids |
A vector of ID labels of one or more members of |
partialmarker |
Either a |
loopBreakers |
(Only relevant if the pedigree has loops). A vector with
ID labels of individuals to be used as loop breakers. If NULL (default)
loop breakers are selected automatically. See |
eliminate |
Deprecated, not used. |
grid.subset |
(Optional; not relevant for most users.) A numeric matrix
describing a subset of all marker genotype combinations for the |
verbose |
A logical. |
Value
A named k
-dimensional array, where k = length(ids)
, with the
joint genotype distribution for the ids
individuals. The probabilities
are conditional on the known genotypes and the allele frequencies of
partialmarker
.
Author(s)
Magnus Dehli Vigeland
See Also
Examples
# Trivial example giving Hardy-Weinberg probabilities
s = singleton(id = 1)
m = marker(s, alleles = 1:2) # equifrequent SNP
oneMarkerDistribution(s, ids = 1, partialmarker = m)
# Conditioning on a partial genotype
genotype(m, id = 1) = "1/-"
oneMarkerDistribution(s, ids = 1, partialmarker = m)
# Genotype distribution for a child of heterozygous parents
trio = nuclearPed(father = "fa", mother = "mo", child = "ch")
m1 = marker(trio, fa = "1/2", mo = "1/2")
oneMarkerDistribution(trio, ids = "ch", partialmarker = m1)
# Joint distribution of the parents, given that the child is heterozygous
m2 = marker(trio, ch = "1/2", afreq = c("1" = 0.5, "2" = 0.5))
oneMarkerDistribution(trio, ids = c("fa", "mo"), partialmarker = m2)
# A different example: The genotype distribution of an individual (id = 8)
# whose half cousin (id = 9) is homozygous for a rare allele.
y = halfCousinPed(degree = 1) |>
addMarker("9" = "a/a", afreq = c(a = 0.01, b = 0.99))
oneMarkerDistribution(y, ids = 8, partialmarker = 1)