After you have gotten the X_l matrices using long_markers_to_X_l_list you can add to the component for each locus the matrix C_l which has, as its (s,t)-th entry, the probability that the genotype t is observed given that the true genotype is s. I am going to a add a lot more parameters to this as soon as I figure out how to pass in genotyping error models and their associated parameters. I would like to do that in a way that easily let's people define their own functions. But for now it just does the microhaplotype error model with default parameters. This creates and inserts the C_l_true matrix and also the C_l matrix. C_l_true is the "true" genotyping error model results and C_l is what gets applied in the likelihood calculations.

insert_C_l_matrices(
  XL,
  ge_mod_assumed,
  ge_mod_true,
  ge_mod_assumed_pars_list = NULL,
  ge_mod_true_pars_list = NULL
)

Arguments

XL

a list of the loci like that created using long_markers_to_X_l_list. The key thing that each list component needs is the named vector freqs of the allele frequencies. The functions that compute genotyping error use the names of the allele to compute the probabilities of the observed genotype given the true genotype.

ge_mod_assumed

The genotyping error model assumed for the analysis.

ge_mod_true

The actual, "true" genotyping error model for the simulation.

ge_mod_assumed_pars_list

a named list of extra arguments (besides L) to be passed to the ge_mod_assumed function. Set it to NULL to use the default values for the genotyping error model.

ge_mod_true_pars_list

a named list of extra arguments (besides L) to be passed to the ge_mod_true function. Set to NULL to use defaults.

Examples

example(long_markers_to_X_l_list, package = "CKMRsim")
#> 
#> l___X_> data(kappas)
#> 
#> l___X_> lm_example <- long_markers_to_X_l_list(long_markers[1:18,], kappa_matrix = kappas)
#> 
#> l___X_> mh_example <- long_markers_to_X_l_list(microhaps, kappa_matrix = kappas)
mh_cl_example <- insert_C_l_matrices(
    mh_example,
    ge_mod_assumed = ge_model_microhap1,
    ge_mod_true = ge_model_microhap1
)