Description Usage Details Value Examples
Constructor function for a <geno_table
> object. Created
by the factory function make_genotype_sampler
.
1 | geno_table(conc, n, bin_size)
|
A function that takes a vector of DNA concentrations to draw n random genotypes based on observed genotype frequencies and randomly attributes DNA concentrations to these genotypes.
A <geno_table
> object with the slots:
"samples": table with the fields:
"genotype": The original genotype in format: “03:FYKD/04:ADCGE”.
"zygosity": One of ‘heterozygous’ or ‘homozygous’.
"conc": Randomly attributed DNA concentrations.
"bins": Intervals of DNA concentrations used to attribute concentration-dependent errors.
"idx": key; A running index.
"errors": table with the fields:
"genotype": The genotype after error injection.
"zygosity": The zygosity after error injection.
"idx": key; A running index.
and the attributes:
"penv": The enclosing environment of the <geno_table> constructor
containing memoised mapping and remapping functions created by
make_mapper
and a table of observed and expected genotype
frequencies generated by gtf_table
.
"breaks": The cut points used to slice up the DNA concentration.
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 | ## Not run:
data(dpb1)
dpb1.pl <- dpb1[provenance == "PL"]
## Generate a distribution of DNA concentrations
conc <- sample_dna_concentration(dpb1.pl, n = 1000, ncores = 8)
## Generate a sampling function
data(dpb1_eag1412)
geno_table <- make_genotype_sampler(dpb1.pl, dpb1_eag1412)
## Access mapping and remapping functions as well as genotype frequencies
mapper(geno_table)
remapper(geno_table)
gtf_table(genotable)
## Sample genotypes
n <- 10000
bin_size <- 3
ans <- geno_table(conc, n, bin_size)
ans
summary(ans)
samples(ans)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.