# NOT RUN {
x = linkdat(toyped)
x = removeMarkers(x,1) # removing the only marker of x.
x
# Creating a SNP with alleles 'a' and 'b', for which individual 1 is heterozygous,
# 2 and 4 are homozygous for the 'b' allele, and missing genotype for individual 3:
m1 = marker(x, 1, c('a','b'), c(2,4), c('b','b'))
x = addMarker(x, m1)
# A rare SNP for which all individuals are homozygous for the common allele.
# The 'alleles' argument must be specified since only one allele is present.
m2 = marker(x, 1:4, 1, alleles=1:2, afreq=c(0.99, 0.01))
x = addMarker(x, m2)
# Creating a Mendelian error in the first marker
x = modifyMarker(x, marker=1, ids=3, genotype='a')
# Making the second marker triallelic, with heterozygous parents.
x = modifyMarker(x, marker=2, ids=1:2, genotype=1:2, alleles=1:3)
# Testing mendelianCheck
err_index = mendelianCheck(x, remove=FALSE)
stopifnot(err_index==1)
xnew = mendelianCheck(x, remove=TRUE)
stopifnot(all.equal(xnew, removeMarkers(x, 1)))
### Testing transferMarkerdata
x0 = list(singleton(id=5), nuclearPed(noffs=2))
x = markerSim(x0, N=5, alleles=1:5, verbose=FALSE, available=4:5)
y0 = nuclearPed(noffs=3)
y = transferMarkerdata(x, y0)
stopifnot(all.equal(x[[1]], branch(y,5)))
stopifnot(all.equal(x[[2]], subset(y,1:4)))
# }
Run the code above in your browser using DataLab