【bioinfo】bedtools之intersect命令参数

bedtools工具包:https://bedtools.readthedocs.io/en/latest/index.html

bedtools工具之intersect参数,help信息:(这是v2.17.0版,最新是v2.30.0版)

Tool:    bedtools intersect (aka intersectBed)
Version: v2.17.0
Summary: Report overlaps between two feature files.

Usage:   bedtools intersect [OPTIONS] -a <bed/gff/vcf> -b <bed/gff/vcf>

参数:

参数说明
-abamThe A input file is in BAM format. Output will be BAM as well.
-ubamWrite uncompressed BAM output. Default writes compressed BAM.
-bedWhen using BAM input (-abam), write output as BED.
The default is to write output in BAM when using -abam.
-waWrite the original entry in A for each overlap.
-wbWrite the original entry in B for each overlap.
  - Useful for knowing what A overlaps. Restricted by -f and -r.
-lojPerform a “left outer join”. That is, for each feature in A report each overlap
with B. If no overlaps are found, report a NULL feature for B.
-woWrite the original A and B entries plus the number of base pairs of overlap
between the two features.
  - Overlaps restricted by -f and -r.
  - Only A features with overlap are reported.
-waoWrite the original A and B entries plus the number of base pairs of overlap
between the two features.
  - Overlapping features restricted by -f and -r.
  However, A features w/o overlap are also reported with a NULL B
feature and overlap = 0.
-uWrite the original A entry once if any overlaps found in B.
  - In other words, just report the fact >=1 hit was found.
  - Overlaps restricted by -f and -r.
-cFor each entry in A, report the number of overlaps with B.
  - Reports 0 for A entries that have no overlap with B.
  - Overlaps restricted by -f and -r.
-vOnly report those entries in A that have no overlaps with B.
  - Similar to “grep -v” (an homage).
-fMinimum overlap required as a fraction of A.
  - Default is 1E-9 (i.e., 1bp).
  - FLOAT (e.g. 0.50)
-rRequire that the fraction overlap be reciprocal for A and B.
  - In other words, if -f is 0.90 and -r is used, this requires that B overlap
90% of A and A _also_ overlaps 90% of B.
-sRequire same strandedness. That is, only report hits in B that overlap A
on the same strand.
  - By default, overlaps are reported without respect to strand.
-SRequire different strandedness. That is, only report hits in B that overlap A
on the _opposite_ strand.
  - By default, overlaps are reported without respect to strand.
-splitTreat “split” BAM or BED12 entries as distinct BED intervals.
-sortedUse the “chromsweep” algorithm for sorted (-k1,1 -k2,2n) input
-headerPrint the header from the A file prior to results.

Notes:
(1) When a BAM file is used for the A file, the alignment is retained if overlaps exist,
and exlcuded if an overlap cannot be found. If multiple overlaps exist, they are not
reported, as we are only testing for one or more overlaps.

bedtoolsintersect

使用intersect命令,对两个基因组位置信息文件取交集。

bedtools intersect [OPTIONS] -a <bed/gff/vcf> -b <bed/gff/vcf>

参数:

参数说明
-a输入文件a,文件格式可以是: bed/gff/vcf
-b输入文件b,文件格式可以是: bed/gff/vcf
-abam输入的a文件是bam文件时,使用该参数指定,输出则默认为压缩的bam文件
-ubam指定该参数时,默认输出非压缩的bam文件,默认使用压缩的
-bed输出bed格式,如果输入是bam格式,默认输出bam格式,可用该命令输出bed
-wa输出的文件格式同输入的a文件
-wb输出的文件格式同输入的b文件
-loj“left outer join”,输出a文件与b文件的交集, 与b文件没有交集的标记为NULL,
例如:“.”(点)、“-1”
-wo输出a和b文件的交集,且保留它们的原始格式,并增加一列重叠次数
-waowo基础上,输出a文件中与b没有交集区域信息,无交集时重叠次数列为0。
注:- 没有交集对应信息输出其他符号信息,比如:“.”(点)、“-1”
  - waoloj类似,但loj没有重叠次数列
-u输出a的原格式,fact>=1 【?】,交集限制条件由-f-r设定
-c输出在a格式基础上增加一列与b的重叠次数,0表示与b无重叠
-v按a格式,输出与b没有交集的信息,类似grep -v
-f设定a文件中区域最小重叠长度,默认是1E-9(就是1bp);浮点数,例如:0.05
-ra和b重叠的比例?如果-f参数是0.90并使用了-r参数,就是说,
要求b与a的90%区域重叠,且a也与b区域的90%重叠
-s要求a和b相同的链方向,就是说,输出a与b的交集时,要求相同的链方向。
默认不考虑链方向
-S要求a和b不同的链方向,就是说,输出a与b的交集时,要求相反的链方向。
默认不考虑链方向
-split【?】
-sorted使用按染色体排序作为输入?sort -k1,1 -k2,2n
-header输出表头,有限使用a文件的表头

详细的官方示例:https://bedtools.readthedocs.io/en/latest/content/tools/intersect.html

更多其他命令:https://bedtools.readthedocs.io/en/latest/content/bedtools-suite.html

  • 3
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值