Description Usage Arguments Value See Also Examples
View source: R/map-genotype-frequencies.r
Map observed/expected genotype frequencies to sampled genotypes
1 |
x |
Sample returned by |
A gtf_tbl
object that can be used as a training/test
data set with the slots:
"Class": Has an error been injected in the EAGs of a sample (“event”, E), or not, (“nonevent”, N).
"genotype": The genotype in format: “03:FYKD/04:ADCGE”.
"zygosity": One of ‘heterozygous’ or ‘homozygous’.
"conc": Randomly attributed DNA concentrations.
"pexp": The expected genotype frequency.
"pobs": The observed genotype frequency.
"log_pexp": The log of the expected genotype frequency.
"log_pobs": The log of the observed genotype frequency.
"log_fold_diff": The log-fold difference between observed and expected genotype frequency.
and the attributes:
"penv": The enclosing environment of the <geno_table> constructor containing
memoised mapping and remapping functions created by make_mapper
, as
well as genotype frequencies calculated by gtf
.
"breaks": The cut points used to slice up the DNA concentration.
Other simulation.functions: inject_errors
,
make_genotype_sampler
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.