View source: R/mendelianCheck.R
mendelianCheck | R Documentation |
Check marker data for Mendelian inconsistencies
mendelianCheck(x, remove = FALSE, verbose = !remove)
x |
a |
remove |
a logical. If FALSE, the function returns the indices of
markers found to incorrect. If TRUE, a new |
verbose |
a logical. If TRUE, details of the markers failing the tests are shown. |
A numeric containing the indices of the markers that did not pass the
tests, or (if remove=TRUE
) a new linkdat
object where the
failing markers are removed.
x = nuclearPed(3) # Adding a SNP with a mendelian error: # Individual 3 has an allele 'c' not carried by either parents m1 = marker(x, 1, c('a','a'), 2, c('a','b'), 3, c('a','c')) # Another erroneous marker: The siblings carry more than 4 different alleles. m2 = marker(x, 3, c(1,2), 4, c(3,4), 5, c(1,5)) # Another marker with incosistent genotypes among the siblings: m3 = marker(x, 3, c(1,1), 4, c(2,2), 5, c(3,3)) # Another marker with incosistent genotypes among the siblings: m4 = marker(x, 3, c(1,1), 4, c(2,3), 5, c(1,4)) # A correct marker (all homozygous for allele 'A') m5 = marker(x, 1:5, 'A') # An empty marker m6 = marker(x) x = setMarkers(x, list(m1,m2,m3,m4,m5,m6)) # Finding the errors err_index = mendelianCheck(x, remove=FALSE) stopifnot(all.equal(err_index, 1:4)) x_remove = mendelianCheck(x, remove=TRUE) stopifnot(x_remove$nMark == 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.