不积小流 , 无以成江海 !分享 http://blog.sciencenet.cn/u/xiongchaoliang

博文

如何将多个Bed文件进行合并?

已有 9170 次阅读 2014-11-29 23:54 |个人分类:【技术-脚本】|系统分类:科研笔记

假如有1.bed, 2.bed, 3.bed,如何对这三个bed文件进行合并,去掉冗余的条目,得到一个并集all.bed?

答案是bedtools的mergeBed
[noncode@gnode105 script]$ mergeBed -h
Tool: bedtools merge (aka mergeBed)
Version: v2.16.2
Summary: Merges overlapping BED/GFF/VCF entries into a single interval.

Usage: bedtools merge [OPTIONS] -i <bed/gff/vcf>
Options:
-s Force strandedness. That is, only merge features
that are the same strand.
- By default, merging is done without respect to strand.

-n Report the number of BED entries that were merged.
- Note: "1" is reported if no merging occurred.

-d Maximum distance between features allowed for features
to be merged.
- Def. 0. That is, overlapping & book-ended features are merged.
- (INTEGER)

-nms Report the names of the merged features separated by semicolons.

-scores Report the scores of the merged features. Specify one of
the following options for reporting scores:
sum, min, max,
mean, median, mode, antimode,
collapse (i.e., print a semicolon-separated list),
- (INTEGER)

Notes:
(1) All output, regardless of input type (e.g., GFF or VCF)
will in BED format with zero-based starts
(2) The input file (-i) file must be sorted by chrom, then start.[/mw_shl_code]




https://wap.sciencenet.cn/blog-1509670-847318.html

上一篇:测序中的duplicate是什么?
下一篇:RNA-seq转录本拼接与重构的探讨
收藏 IP: 159.226.43.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-23 19:47

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部