gprob_sim_ind: Simulate genotype log-likelihoods from a population by...

View source: R/RcppExports.R

gprob_sim_indR Documentation

Simulate genotype log-likelihoods from a population by individual

Description

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

Usage

gprob_sim_ind(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 individual, the genotype for any simulated individual is the result of a single random draw from the genotypes of all individuals in the collection. Gene copies and loci are therefore not independent.

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 an individual's genotype from the reference collection of interest. Selection at the locus and gene copy level are not independent, and missing data is included in selection.

Examples

example(tcf2param_list)
sim_colls <- sample(ale_par_list$C, 1070, replace = TRUE)
ale_sim_gprobs_ind <- gprob_sim_ind(ale_par_list, sim_colls)

benmoran11/rubias documentation built on Feb. 1, 2024, 10:52 p.m.