2020-10-12
cr.cgu <- calc_candidate_regions(wgscan.ihs,threshold = -1,window_size = 50000,overlap = 20000,min_n_mrk = 10, min_n_extr_mrk = 1, min_perc_extr_mrk = 0,join_neighbors = FALSE)
错误: 'overlap' has to be zero or an integer factor of 'window_size'.
在使用滑动窗口计算IHS值的时候,我想把窗口设置为50KB,步长设置为20KB,我选择了rehh包里面的calc_candidate_regions函数,这个是比较简单的方法来计算,因为我现在还不太会写脚本。
但是我发现按照上述命令输入会报错,在谷歌或者百度上面根本找不到答案,所以我就不停的试窗口大小和步长,最后发现一个规律--------步长必须被窗口整除才不会报错,正好和报错的内容相对应
所以当我运行下面的命令
cr.cgu <- calc_candidate_regions(wgscan.ihs,threshold = -1,window_size = 60000,overlap = 20000,min_n_mrk = 10, min_n_extr_mrk = 1, min_perc_extr_mrk = 0,join_neighbors = FALSE)
cr.cgu <- calc_candidate_regions(wgscan.ihs,threshold = -1,window_size = 50000,overlap = 25000,min_n_mrk = 10, min_n_extr_mrk = 1, min_perc_extr_mrk = 0,join_neighbors = FALSE)
都运行成功
希望我写的这些能帮助到用这个R包calc_candidate_regions函数的你