data(toyped)
x = linkdat(toyped)
x
x = removeMarkers(x,1) # removing the only marker of 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'))
m1
x = addMarker(x, m1)
# a rare SNP for which all individuals are homozygous for the common allele.
m2 = marker(x, 1:4, 1, alleles=1:2, afreq=c(0.99, 0.01)) # the 'alleles' argument is important since only one allele is present.
m2
x = addMarker(x, m2)
x
x = modifyMarker(x, marker=1, ids=3, genotype='a') # this is a Mendelian error!
x = modifyMarker(x, marker=2, ids=1:2, genotype=1:2, alleles=1:3) # making the second marker triallelic, with heterozygous parents.
x
plot(x, marker=1)
err = mendelianCheck(x)
stopifnot(err==1)
x = removeMarkers(x, err)
Run the code above in your browser using DataLab