transferMarkers {pedtools} | R Documentation |
Transfer marker data
Description
Transfer marker data between pedigrees. Any markers attached to the target are overwritten.
Usage
transferMarkers(
from,
to,
ids = NULL,
idsFrom = ids,
idsTo = ids,
erase = TRUE,
matchNames = TRUE,
checkSex = FALSE,
checkAttrs = TRUE
)
Arguments
from |
A |
to |
A |
ids |
A vector of ID labels. This should be used only if the individuals
have the same name in both pedigrees; otherwise use |
idsFrom , idsTo |
Vectors of equal length, denoting source individuals (in
the |
erase |
A logical. If |
matchNames |
A logical, only relevant if |
checkSex |
A logical. If TRUE, it is checked that |
checkAttrs |
A logical. If TRUE, and |
Details
By default, genotypes are transferred between all individuals present in both pedigrees.
Value
A ped
object (or a list of such) similar to to
, but where all
individuals also present in from
have marker genotypes copied over. Any
previous marker data is erased.
Examples
x = nuclearPed(fa = "A", mo = "B", child = "C")
x = addMarker(x, A = "1/2", B = "1/1", C = "1/2", name = "M1")
y = list(singleton("A"), nuclearPed(fa = "D", mo = "B", child = "C"))
# By default all common individuals are transferred
transferMarkers(x, y)
# Transfer data for the boy only
transferMarkers(x, y, ids = "C")
# Transfer without first erasing the target markers
z = nuclearPed(fa = "A", mo = "B", child = "C")
z = addMarker(z, A = "1/1", alleles = 1:2, name = "M1")
transferMarkers(x, z, ids = "C", erase = FALSE)
transferMarkers(x, z, ids = "C", erase = TRUE) # note the difference