Description Usage Arguments Value Examples
Constructor for <gtf_tbl
> objects. Calculates observed
and expected genotype frequencies.
1 2 | ## S3 method for class 'HLA'
gtf_table(x)
|
x |
A < |
A table with the fields:
"genotype": Key. The genotype in the format "A1/A2".
"pexp": Expected genotype frequencies.
"pobs": Observed genotype frequencies.
"log_pexp": Log of expected genotype frequenciies.
"log_pobs": Log of expected genotype frequenciies.
"nexp": Expected number of samples for a genotype.
"nobs": Observed number of samples for a genotype.
"chisq": χ^2-value describing the difference between expected and observed genotype frequency.
"log_fold_diff": Log-fold diffence between expected and observed genotype frequency.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## 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"]
## Remove low-resolution four-digit codes
dpb1.de <- dpb1.de[allele1 %ni% dpb1_four_digit_codes | allele2 %ni% dpb1_four_digit_codes]
## Remove cases of unknown alleles
dpb1.de <- dpb1.de[field2(allele1) != "XXX" | field2(allele2) != "XXX"]
dpb1.de <- dpb1.de[toupper(allele1) != "NEW" | toupper(allele2) != "NEW"]
## Calculate observed and expected genotype frequencies
gtf_table(dpb1.de)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.