joint_spectrum | R Documentation |
Estimate joint allele frequency spectrum
joint_spectrum(afs)
afs |
A matrix or data frame of allele frequencies |
A data frame with columns pattern
and proportion
## Not run:
dat = plink_to_afs('/my/plink/file', pops = c('pop1', 'pop2', 'pop3', 'pop4', 'pop5'))
# Spectrum across all SNPs
joint_spectrum(dat$afs)
# Stratify by allele frequency in one population
dat$afs %>% as_tibble %>% select(1:4) %>%
group_by(grp = cut(pop1, 10)) %>%
group_modify(joint_spectrum) %>%
ungroup
# Stratify by mutation class
dat$afs %>% as_tibble %>% select(1:4) %>%
mutate(mut = paste(dat$snpfile$A1, dat$snpfile$A2)) %>%
group_by(mut) %>%
group_modify(joint_spectrum) %>%
ungroup
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.