Description Usage Arguments Value Examples
View source: R/gamete_genotypes.R
Taking a string input of genotype of an individual, function finds the gamete types possible and its probability in a random meiosis event.
1 |
x |
A character vector of length 4 indicating allelic composition of the locus in the tetraploid genotype |
A tbl
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | require(tidyverse)
gamete_genotypes(c("a+", "a+", "a", "a")) %>%
# since a+a and aa+ are indistinguishible in phenotype, these two classes can be merged
mutate(v_comb = fct_recode(v_comb, "aa+" = "a+a")) %>%
group_by(v_comb) %>%
summarise_at(c("n", "prop_n"), sum)
## Not run:
# notice how quickly homolog permutation increases as ploidy level increase
# with just 8 homologues there are ~40k permutations,
combinat::permn(c("a+", "a+", "a", "a", "a", "a+", "a+", "a+"), c)
# but note that unique combinations are far less: 56
combinat::permn(c("a+", "a+", "a", "a", "a", "a+", "a+", "a+"), c)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.