Description Usage Arguments Value Examples
Calculates the four entries (Dn, Ds, Pn, Ps) in the McDonald-Kreitman contingency table.
1 | mkvalues(info)
|
info |
A data table corresponding to the MIDAS snps_info.txt output file. Must have been processed with determine_snp_effect and determine_snp_dist, and so it must contain columns 'snp_effect' and 'distribution' |
A tibble with one column with the count of each substitution type.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | library(HMVAR)
# Get file paths
midas_dir <- system.file("toy_example/merged.snps/", package = "HMVAR")
map <- readr::read_tsv(system.file("toy_example/map.txt", package = "HMVAR"),
col_types = readr::cols(.default = readr::col_character())) %>%
dplyr::select(sample = ID, Group)
# Read data
midas_data <- read_midas_data(midas_dir = midas_dir, map = map, cds_only = TRUE)
info <- determine_snp_effect(midas_data$info) %>%
determine_snp_dist(freq = midas_data$freq,
depth = midas_data$depth, map = map,
depth_thres = 1, freq_thres = 0.5)
info
mktable <- info %>%
split(.$gene_id) %>%
purrr::map_dfr(mkvalues,
.id = "gene_id")
mktable
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.