sortGenotypes {pedtools} | R Documentation |
Sort the alleles in each genotype
Description
Ensure that all genotypes are sorted internally. For example, if a marker
attached to x
has alleles 1 and 2, then running this function will replace
all genotypes "2/1" by "1/2".
Usage
sortGenotypes(x)
Arguments
x |
A |
Value
An object identical to x
except that the all genotypes are sorted.
Examples
x = singleton(1)
# Various markers with misordered genotypes
m1 = marker(x, `1` = "2/1")
m2 = marker(x, `1` = "b/a")
m3 = marker(x, `1` = "100.3/99.1")
x = setMarkers(x, list(m1, m2, m3))
x
# Sort all genotypes
y = sortGenotypes(x)
y
# Also works when input is a list of peds
sortGenotypes(list(x, x))
[Package pedtools version 2.7.0 Index]