addAllele {pedtools} | R Documentation |
Add allele
Description
Extends the allele set of a marker attached to a pedigree, by adding a single allele.
Usage
addAllele(x, marker, allele, freq = 0.001, adjust = c("previous", "all"))
Arguments
x |
A |
marker |
The name or index of a marker attached to |
allele |
The name of the new allele. |
freq |
The frequency of the new allele, by default 0.001. |
adjust |
Either "previous" or "all", indicating how the frequencies
should be adjusted so that they sum to 1. If "previous" (default), the
frequencies of the original alleles are multiplied with |
Value
A copy of x
with modified marker attributes.
Examples
## Ped input
x = nuclearPed() |>
addMarker(geno = c(NA, NA, "b/c"), afreq = c(b = 0.5, c = 0.5))
y = addAllele(x, marker = 1, allele = "a")
afreq(y, 1)
z = addAllele(y, marker = 1, allele = "d", freq = 0.1, adjust = "all")
afreq(z, 1)
## Database input
db = list(M1 = c(a = .2, b = .3, c = .5),
M2 = c("7" = .9, "8.3" = .1))
addAllele(db, marker = "M2", allele = "8")
[Package pedtools version 2.7.0 Index]