make_genotype_sampler: Generate a genotype resampling function.

Description Usage Arguments Value Note See Also Examples

Description

Generate a genotype resampling function.

Usage

1

Arguments

x

A <HLA> object.

eag

An <eag_table> object.

Value

A constructor function for <geno_table> objects.

Note

The next step is to inject errors in the sampled genotypes: inject_errors.

See Also

Other simulation.functions: inject_errors, map_genotype_frequencies

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## 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")

## Sample a distribution of DNA concentrations
concentration <- sample_dna_concentration(dpb1.de, n = 24000, ncores = 8)

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

## Sample genotypes
n <- 10000
bin_size <- 3
rs <- sample_dpb1_de(concentration, n, bin_size)
rs

## End(Not run)

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