gprob_sim_gc: Simulate genotype log-likelihoods from a population by gene...

Description Usage Arguments Details Value Examples

View source: R/RcppExports.R

Description

Takes a list of parameters from a genetic dataset, and returns a genotype log-likelihood matrix for individuals simulated by gene copy from the specified collections

Usage

1
gprob_sim_gc(par_list, sim_colls)

Arguments

par_list

genetic data converted to the param_list format by tcf2param_list

sim_colls

a vector of indices for the collections desired for simulation; each element of the list corresponds to an individual

Details

In simulation by gene copy, the genotype at a locus for any individual is the result of two random draws from the allele count matrix of that locus. Draws within an individual are performed without replacement, but allele counts are replaced between individuals.

Value

gprob_sim returns a matrix of the summed log-likelihoods for all loci of a simulated population mixture; columns represent individuals, with each row containing their log-likelihood of belonging to the collection of the same index, given the selection of two independent gene copies from the desired collection of origin's reference allele frequencies

Examples

1
2
3
example(tcf2param_list)
sim_colls <- sample(ale_par_list$C, 1070, replace = TRUE)
ale_sim_gprobs_gc <- gprob_sim_gc(ale_par_list, sim_colls)

rubias documentation built on Feb. 10, 2022, 1:06 a.m.