View source: R/tag_mendelian_incompatibilities.R
tag_mendelian_incompatibilities | R Documentation |
This is a handy function for taking parent-offspring pairs, typically identified using CKMRsim, and then tagging the loci at which the observed/recorded genotypes are not compatible with Mendelian inheritance. This version is currently very simple and merely looks at pairs of individuals. (i.e., it does not attempt to identify Mendelian incompatible loci on the basis of pa-ma-kid trios.) Noetheless, it should be useful for identifying poor-performing loci.
tag_mendelian_incompatibilities(po, geno)
po |
a tibble of the parent-offspring pairs. This will typically be obtained
by filtering the output for |
geno |
a long format data frame / tibble of genotype data for both the candidate
offspring and the candidate parents. Typically this is what you get if you use
|
Note that if you want to count up the relative frequency (across all pairs) of Mendelian incompatibilities at each locus you can do like this:
tag_mendelian_incompatibilities(po, geno) %>% group_by(Locus) %>% summarise(mean_incompat = mean(is_MI, na.rm = TRUE)) %>% arrange(desc(mean_incompat))
This returns a tibble with the columns:
D2_indiv
: the ID of the D2_indiv
D1_indiv
: the ID of the D1_indiv
logl_ratio
: the log-likelihood ratio for parent-offspring for the pair
Locus
: the name of the locus
D1a_1, D1a_2, D2a_1, D2a_2
: D1_indiv's allelic type of gene copy 1 and 2, and then
D2_indiv's allelic type of gene copy 1 and 2, respectively
is_MI
: logical vector. TRUE if the pair is Mendelian incompatible at the Locus. Otherwise
FALSE (or NA if either member of pair was NA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.