View source: R/genotypes_and_error.R
long_markers_to_X_l_list | R Documentation |
Given a data frame D in the format of long_markers, this function creates the matrix X_l for
each locus, given all the values of kappa supplied as rows in a matrix like that in
kappas
. The rows and columns refer to genotypes that are in
the order given in the
function index_ab
.
long_markers_to_X_l_list(D, kappa_matrix, allele_separator = " / ")
D |
a data frame in the format of |
kappa_matrix |
A matrix like that in the supplied data |
allele_separator |
This string is used to separate allele names in the names of genotypes. By default it is " / ". This should not get confused by any elements in actual allele names, as long as the allele names don't have any spaces in them. This gets used to parse the genotype names down the road. |
This returns a named list. The names of the components are the Chrom.Locus.Pos of the marker in D. The contents of each list component is a list that includes the allele frequencies (as a vector named with the Allele names), and also another list of matrices with nA * (nA+1) / 2 rows and columns. The rows and columns of this matrix are named by the genotypes.
data(kappas)
lm_example <- long_markers_to_X_l_list(long_markers[1:18,], kappa_matrix = kappas)
mh_example <- long_markers_to_X_l_list(microhaps, kappa_matrix = kappas)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.