问题:有两个平行测序样本,分别得到1.vcf和2.vcf两个文件,想知道这两个文件有多少个重合点。
[wangjq@mgmt CHG029194]$ cat t1 chr1 10 10 chr1 11 11 [wangjq@mgmt CHG029194]$ cat t2 chr1 10 10 [wangjq@mgmt CHG029194]$ /online/software/bedtools-2.25.0/bin/bedtools intersect -a t1 -b t2 chr1 10 10 chr1 11 11
[wangjq@mgmt CHG029194]$ cat t1 chr1 10 10 chr1 11 11 chr1 12 12 [wangjq@mgmt CHG029194]$ cat t2 chr1 10 10 [wangjq@mgmt CHG029194]$ /online/software/bedtools-2.25.0/bin/bedtools intersect -a t1 -b t2 chr1 10 10 chr1 11 11
从上面两个例子可以得出,bedtools的bed文件的start和end至少会有1 base距离,没有的话,它会自动添加。
换一种解决方法:R的merge函数。