Last chance! 50% off unlimited learning
Sale ends in
Transfer marker data between pedigrees. Any markers attached to the target are overwritten.
transferMarkers(
from,
to,
ids = NULL,
idsFrom = ids,
idsTo = ids,
erase = TRUE,
matchNames = TRUE,
checkSex = FALSE
)
A ped
or singleton
object, or a list of such objects.
A ped
or singleton
object, or a list of such objects.
A vector of ID labels. This should be used only if the individuals
have the same name in both pedigrees; otherwise use idsFrom
and idsTo
instead.
Vectors of equal length, denoting source individuals (in
the from
pedigree) and target individuals (in the to
pedigree),
respectively.
A logical. If TRUE
(default), all markers attached to to
are
erased prior to transfer, and new marker objects are created with the same
attributes as in from
. If FALSE
no new marker objects are attached to
to
. Only the genotypes of the ids
individuals are modified, while
genotypes for other pedigree members - and marker attributes - remain
untouched.
A logical, only relevant if erase = FALSE
. If matchNames = TRUE
(default) marker names are used to ensure genotypes are transferred
into the right markers, The output contains only markers present in from
,
in the same order. (An error is raised if the markers are not named.)
A logical. If TRUE, it is checked that fromIds
and toIds
have the same sex. Default: FALSE.
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.
By default, genotypes are transferred between all individuals present in both pedigrees.
# NOT RUN {
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
# }
Run the code above in your browser using DataLab