Description Usage Arguments Value Examples
Take output from MIDAS script midas_merge.py and perform a McDonald-Kreitman test between two groups.
1 2 3 4 5 6 7 8 9 | midas_mktest(
midas_dir,
map,
map_file,
genes = NULL,
depth_thres = 1,
freq_thres = 0.5,
focal_group = NA
)
|
midas_dir |
Directory where the output from midas_merge.py is located. It must include files: 'snps_info.txt', 'snps_depth.txt' and 'snps_freq.txt'. |
map |
Either a file path or a tibble. If a path, it mos point to a mapping file associating samples in the MIDAS otput to groups. It must have an 'ID' and a 'Group' column. If a tibble. It must have columns 'sample' and 'Group'. |
map_file |
Same as map. Present for backwards compatibility. |
genes |
The list of genes that are to be tested. Must correspond to entries in the 'genes_id' column of the 'snps_info.txt' file. If NULL, all genes will be tested. |
depth_thres |
The minimum number of reads at a position in a given sample for that position in that sample to be included. |
freq_thres |
Frequency cuttoff for minor vs major allele. The value represents the distance from 0 or 1, for a site to be assigned to the major or minor allele respectively. It must be a value in [0,1]. |
focal_group |
A string indicating the group that should be compared to everything else. If different from NA, all values in the 'Group' column of the mapping file will be converted to "non.<focal_group>", ensuring a dichotomous grouping. |
A data table containing the McDonald-Kreitman contingency table per gene.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | library(HMVAR)
# Get paths
midas_dir <- system.file("toy_example/merged.snps/", package = "HMVAR")
map_file <- system.file("toy_example/map.txt", package = "HMVAR")
# Process map yourself
map <- readr::read_tsv(map_file,
col_types = readr::cols(.default = readr::col_character())) %>%
dplyr::select(sample = ID, Group)
midas_mktest(midas_dir = midas_dir,
map = map)
# Give a map file path to midas_mktest
midas_mktest(midas_dir = midas_dir,
map = map_file)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.