Description Usage Arguments Value Examples
Takes two data.frames or tibbles representing site x sample allele frequencies (freq) and sequence coverage (depth), and used gather to convert them into a tibble with one line per site per sample. It combines both sources of info into one table, it filters out positions below a sequencing depth threshold, and if another data table with metadata (info) about the sites is passed, it also joins that information into the sites that passed the threshold.
1 2 3 4 5 6 7 8 | match_freq_and_depth(
freq,
depth,
info = NULL,
map = NULL,
depth_thres = 1,
verbose = TRUE
)
|
freq |
A site by sample data frame or tibble. Must contain a column named "site_id". |
depth |
A site by sample data frame or tibble. Must containa a column named "site_id". |
info |
A site by variable data frame or tibble. Must contain a column named "site_id". |
map |
A sample by variable data frame or tibble. Must conatin a colum named "sample". |
depth_thres |
Minimum sequence coverage (depth) for a site to be kept in the final output. |
verbose |
logical indicating whether progress messages should be printed. |
A data frame or tibble with columns site_id, freq, depth, and one column per column in info and map.
1 2 3 4 5 6 7 | freq <- tibble::tibble(site_id = paste('snv' , 1:4, sep = ""),
sample1 = c(1,1,0,1), sample2 = c(1,1,1,1),
sample3=c(0,0,0,1))
depth <- tibble::tibble(site_id = paste('snv' , 1:4, sep = ""),
sample1 = c(1,0,1,1), sample2 = c(4,1,1,0),
sample3=c(0,0,0,1))
match_freq_and_depth(freq, depth, depth_thres = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.