#toy example of an ihs scan
scan <- data.frame(CHR = "1", POSITION = c(2, 3, 6, 7, 8) * 10000, IHS = c(-4, 0.5, 1, 6, NA))
scan
#candidate regions with default window size
calc_candidate_regions(scan, threshold = 2)
#with smaller window size
calc_candidate_regions(scan, threshold = 2, window_size = 20000)
#add negative threshold
calc_candidate_regions(scan, threshold = 2, negativeThreshold = -2, window_size = 20000)
#ignoring sign yields the same
calc_candidate_regions(scan, threshold = 2, ignore_sign = TRUE, window_size = 20000)
#'#use overlapping windows
calc_candidate_regions(scan, threshold = 2, ignore_sign = TRUE, window_size = 20000,
overlap = 10000)
#do not join windows with extreme values
calc_candidate_regions(scan, threshold = 2, ignore_sign = TRUE, window_size = 20000,
overlap = 10000, join_neighbors = FALSE)
#include windows without extreme values by 'min_n_extr_mrk = 0'
calc_candidate_regions(scan, threshold = 2, ignore_sign = TRUE, window_size = 20000,
overlap = 10000, join_neighbors = FALSE, min_n_extr_mrk = 0)
#include markers without score by 'keepNA = TRUE'
calc_candidate_regions(scan, threshold = 2, ignore_sign = TRUE, window_size = 20000,
overlap = 10000, join_neighbors = FALSE, min_n_extr_mrk = 0, keepNA = TRUE)
#include windows without markers by 'min_n_mrk = 0'
calc_candidate_regions(scan, threshold = 2, ignore_sign = TRUE, window_size = 20000,
overlap = 10000, join_neighbors = FALSE, min_n_mrk = 0, min_n_extr_mrk = 0, keepNA = TRUE)
Run the code above in your browser using DataLab