View source: R/marker_attach.R
| setMarkersFromMatrix | R Documentation |
A fast alternative to setMarkers() for prepared allele matrices. All pedigree
components share the same allele definitions and frequencies. Individuals not present
in the matrix receive missing genotypes. If no marker attributes are given (loci),
the observed alleles are assigned equal frequencies.
setMarkersFromMatrix(x, alleleMatrix = NULL, loci = NULL)
x |
A |
alleleMatrix |
A matrix with two allele columns per marker and row names
identifying individuals. If |
loci |
Optional list of locus attributes. Each element must contain |
The input pedigrees with markers attached.
x = list(nuclearPed(1), singleton("S"))
a = matrix(c("A", "B", "A", "A"), nrow = 2, byrow = TRUE,
dimnames = list(c("3", "S"), c("M1.1", "M1.2")))
# Without `loci`: Equal frequencies to observed alleles
y = setMarkersFromMatrix(x, a)
getGenotypes(y)
afreq(y[[1]], 1)
# Supply allele frequencies explicitly
loci = list(list(name = "M1", afreq = c(A = 0.8, B = 0.2)))
z = setMarkersFromMatrix(x, a, loci = loci)
afreq(z[[1]], 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.