map_genotype_frequencies: Map observed/expected genotype frequencies to sampled...

Description Usage Arguments Value See Also Examples

Description

Map observed/expected genotype frequencies to sampled genotypes

Usage

1

Arguments

x

Sample returned by inject_errors.

Value

A gtf_tbl object that can be used as a training/test data set with the slots:

and the attributes:

See Also

Other simulation.functions: inject_errors, make_genotype_sampler

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Not run: 
## Extract HLA-DPB1 genotype frequencies
dpb1 <- HLA("DPB1", "01/01/2014", "23/03/2015")

## Restrict the data to the German sample
dpb1.de <- dpb1[provenance == "DE"]

## Generate an EAG table
dpb1_eag1412 <- eag_table(gene = "DPB1", nextype_basis_id = "1412")

## Generate a distribution of DNA concentrations
conc <- sample_dna_concentration(dpb1.de, n = 1000, ncores = 8)

## Generate a sampling function
sample_dpb1_de <- make_genotype_sampler(dpb1.de, dpb1_eag1412)

## Load precomputed DNA-concentration-dependent error distribution for HLA-A
data(cdfA)

## Sample genotypes
n <- 10000
bin_size <- 3
perr <- 0.01
odds <- 0.25
ans <- sample_dpb1_de(conc, n, bin_size) %>%
  inject_errors(cdfA, perr, odds) %>%
  map_genotype_frequencies()
ans

## End(Not run)

gschofl/HLAsim documentation built on May 17, 2019, 8:51 a.m.