insert_C_l_matrices: insert the matrix C_l into each element of the list of X_l...

View source: R/genotypes_and_error.R

insert_C_l_matricesR Documentation

insert the matrix C_l into each element of the list of X_l matrices

Description

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.

Usage

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")
mh_cl_example <- insert_C_l_matrices(
    mh_example,
    ge_mod_assumed = ge_model_microhap1,
    ge_mod_true = ge_model_microhap1
)

eriqande/CKMRsim documentation built on Aug. 2, 2024, 7:23 a.m.