deeptools intersect -wa 结果竟然有重复
2019-05-07 本文已影响7人
JeremyL
![](https://img.haomeiwen.com/i7493830/00a449c693c076c9.png)
此记录完全是由一次不仔细阅读软件参数导致的踩坑记录
#需要的两个Bed格式文件
- A.bed B.bed
$ cat A.bed
chr1 10 20
chr1 30 40
$ cat B.bed
chr1 15 21
chr1 17 25
#bedtools intersect 默认工作模式
- 返回具有overlap的一对region的overlap 区域
$ bedtools intersect -a A.bed -b B.bed
chr1 15 20
chr1 17 20
#bedtools intersect -wa
bedtools intersect -wa 竟然会保留chr1 10 20
两次, 这是因为chr1 10 20 与 B.bed中两个区域都存在overlap;但其实,这并不是我想要的结果,保留一次足以。
$ bedtools intersect -a A.bed -b B.bed -wa
chr1 10 20
chr1 10 20
使用linux命令过滤一下重复region
$ bedtools intersect -a A.bed -b B.bed -wa | sort | uniq
chr1 10 20
后面我又去阅读了一下bedtools intersect参数,竟然有个参数可以解决这个问题-u
$ bedtools intersect -a A.bed -b B.bed -wa -u
chr1 10 20