{"id":54849,"date":"2024-06-16T14:30:35","date_gmt":"2024-06-16T06:30:35","guid":{"rendered":"http:\/\/www.biocloudservice.com\/wordpress\/?p=54849"},"modified":"2024-06-16T14:30:35","modified_gmt":"2024-06-16T06:30:35","slug":"bed%e6%96%87%e4%bb%b6%e5%a4%84%e7%90%86%e5%b7%a5%e5%85%b7%e4%b9%8b-bedtools-2","status":"publish","type":"post","link":"http:\/\/www.biocloudservice.com\/wordpress\/?p=54849","title":{"rendered":"bed\u6587\u4ef6\u5904\u7406\u5de5\u5177\u4e4b\u2014\u2014bedtools"},"content":{"rendered":"<p><html><br \/>\n<head><br \/>\n<title><\/title><br \/>\n<meta charset=\"utf-8\"><br \/>\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0,viewport-fit=cover\"><\/p>\n<style>\n*{margin:0;padding:0}html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;line-height:1.6}img{z-index:999;position:relative;max-width:100%;margin:10px 0;}body{letter-spacing:.034em}h1,h2,h3,h4,h5,h6{font-weight:400;font-size:16px}a{color:#576b95;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}td,th{word-wrap:break-word;padding:5px 10px;border:1px solid #DDD;}table{margin-bottom:10px;border-collapse:collapse;display:table;width:100%!important;}.appmsg_skin_default .rich_media_area_primary{background-color:#fff}.appmsg_skin_default .rich_media_area_primary .weui-loadmore_line .weui-loadmore__tips{background-color:#fff}.rich_media_area_primary{padding:20px 16px 12px;background-color:#fafafa}@media (max-width:375px){.rich_media_area_primary{padding:20px 60px 15px 60px}.rich_media_area_extra{padding:0 60px 21px 60px}}@media (min-width:1024px){.rich_media_area_primary_inner,.rich_media_area_extra_inner,body{max-width:677px;margin-left:auto;margin-right:auto}.rich_media_area_primary{padding-top:32px}}.rich_media{padding:20px;overflow:hidden;}.appmsg_skin_default .rich_media_area_primary{background-color:#fff}.appmsg_skin_default .rich_media_area_primary .weui-loadmore_line .weui-loadmore__tips{background-color:#fff}@media screen and (min-width:1024px){.rich_media_area_primary_inner,.rich_media_area_extra_inner{max-width:677px;margin-left:auto;margin-right:auto}.rich_media_area_primary{padding-top:32px}}.rich_media_content{overflow:hidden;color:#333;font-size:17px;word-wrap:break-word;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;text-align:justify;position:relative;z-index:0}.rich_media_content *{max-width:100%!important;box-sizing:border-box!important;-webkit-box-sizing:border-box!important;word-wrap:break-word!important}.rich_media_content p{clear:both;min-height:1em}.rich_media_content em{font-style:italic}.rich_media_content fieldset{min-width:0}.rich_media_content .list-paddingleft-1,.rich_media_content .list-paddingleft-2,.rich_media_content .list-paddingleft-3{padding-left:2.2em}.rich_media_content .list-paddingleft-1 .list-paddingleft-2,.rich_media_content .list-paddingleft-2 .list-paddingleft-2,.rich_media_content .list-paddingleft-3 .list-paddingleft-2{padding-left:30px}.rich_media_content .list-paddingleft-1{padding-left:1.2em}.rich_media_content .list-paddingleft-3{padding-left:3.2em}.rich_media_content .code-snippet,.rich_media_content .code-snippet__fix{max-width:1000%!important}.rich_media_content .code-snippet *,.rich_media_content .code-snippet__fix *{max-width:1000%!important}.rich_media_title{font-size:22px;line-height:1.4;margin-bottom:13px;padding-bottom:13px;border-bottom:1px solid #e7e7eb;}@supports(-webkit-overflow-scrolling:touch){.rich_media_title{font-weight:700}}.rich_media_meta{display:inline-block;vertical-align:middle;padding:0 0 10px 0;font-size:15px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.rich_media_meta.icon_appmsg_tag{margin-right:0px}.rich_media_meta.meta_tag_text{margin-right:0}.rich_media_meta_list em{font-style:normal}.rich_media_meta_text{color:#a5a5a5;}p{margin:0;}.msgBox{margin-top:20px;padding-top:20px;padding-left:50px;overflow:hidden;border-top:2px dashed #09a2ff;}.msg{padding-top:7px;clear:both;}.msgBody{float:right;width:100%;margin-left:55px;padding-bottom:15px;border-bottom:1px dashed #e0e0e0;}.userHeadImg{float:left;margin-left:-50px;}.userHeadImg img{width:40px;height:40px;margin-right:10px;border-radius:3px;}.userName{color:#888888;line-height:24px;font-size:14px;margin:5px 0 5px 0;height:24px;}.replyBody,.autherBody{color:#565656;font-size:15px;}.replyIcon{border-left:4px solid #33ab01;margin-right:5px;}.ad{text-decoration:none;color:#d6d4d4;font-size:12px;}.msgBodyReply{padding-top:5px;}.userName span{float:right;color:#afafaf;font-size:14px;}code{text-align:left;font-size:14px;display:block;white-space:pre;display:-webkit-box;display:-webkit-flex;display:flex;position:relative;}.code-snippet__fix{font-size:14px;margin:10px 0;display:block;color:#333;position:relative;background-color:rgba(0,0,0,0.03);border:1px solid #f0f0f0;border-radius:2px;display:-webkit-box;display:-webkit-flex;display:flex;padding-left:25px;line-height:26px}.code-snippet__fix code{text-align:left;font-size:14px;display:block;white-space:pre;display:-webkit-box;display:-webkit-flex;display:flex;position:relative;font-family:Consolas,\"Liberation Mono\",Menlo,Courier,monospace}.code-snippet__comment,.code-snippet__quote{color:#afafaf;font-style:italic}.code-snippet__keyword,.code-snippet__selector-tag,.code-snippet__subst{color:#ca7d37}.code-snippet__number,.code-snippet__literal,.code-snippet__variable,.code-snippet__template-variable,.code-snippet__tag .code-snippet__attr{color:#0e9ce5}.code-snippet__string,.code-snippet__doctag{color:#d14}.code-snippet__title,.code-snippet__section,.code-snippet__selector-id{color:#d14}.code-snippet__subst{font-weight:normal}.code-snippet__type,.code-snippet__class .code-snippet__title{color:#0e9ce5}.code-snippet__tag,.code-snippet__name,.code-snippet__attribute{color:#0e9ce5;font-weight:normal}.code-snippet__regexp,.code-snippet__link{color:#ca7d37}.code-snippet__symbol,.code-snippet__bullet{color:#d14}.code-snippet__built_in,.code-snippet__builtin-name{color:#ca7d37}.code-snippet__meta{color:#afafaf}.code-snippet__deletion{background:#fdd}.code-snippet__addition{background:#dfd}.code-snippet__emphasis{font-style:italic}.code-snippet__strong{font-weight:bold}.account_avatar{width:40px;height:40px;padding:0;}.account_info{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;padding:20px 0;align-items:center}.flex_bd{padding-left:14px;}.account_nickname{display:inline-block;vertical-align:middle;line-height:1.2;color:#576b95;font-size:14px}.account_desc{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;color:rgba(0,0,0,0.3);font-size:14px;line-height:1.2;padding-top:.4em}.msg_source_url{text-align:left;word-break:break-all;margin-top:20px;}.msg_source_url a{padding-right:10px;}.msg_source_url .url_text{color:#a8a8a8;}.video-desc{font-size:14px;margin-top:15px;color:#6c6c6c;}.msg_source_url{text-align:left;}.original_primary_card_tips{color:rgba(0,0,0,0.3);line-height:1.4;font-size:15px;}.weui-flex__item{margin-bottom:20px;padding:20px 16px;margin-top:16px;line-height:1.4;align-items:center;background-color:#f7f7f7;border-radius:8px;position:relative;}.original_primary_desc{color:rgba(0,0,0,0.5);font-size:14px;padding-top:4px;width:auto;overflow:hidden;text-overflow:ellipsis;}.msgBodyReplyList{border-top:1px solid #e1e1e1;margin-top:10px;}.msgBodyReplyListTop{border-top:0;}.reply_like_num{float:right;font-size:14px;color:#c7c7c7;}.msgData{margin-top:20px;color:#626262;}.msgData span{font-size:14px;padding-right:15px;}.msgData .likes{float:right;padding-right:0;}.js_text_content p{font-size:18px;}.rich_media_meta_link{font-size:15px;}blockquote {padding-left: 10px;border-left: 3px solid #dbdbdb;color: rgba(0,0,0,0.5);font-size: 15px;padding-top: 4px;margin: 1em 0;}.video_iframe{width:500px;height:400px;}.blockquote_info{color:#b5b5b5;margin-top:10px;}#copyright_logo{color:#bdbdbd;}.rich_media_meta_list{margin-bottom:10px;}.reprint{background:#efefef;border-radius:5px;padding:8px;color:#1f1f1f;}.reprint a{word-break:break-all;}.topic{color:#8e8e8e;background:#f7f7f7;border-radius:5px;padding:10px 8px;}.topic a{padding-right:5px;}.topic p{margin-bottom:5px;}\n<\/style>\n<link href=\"https:\/\/www.juyifx.cn\/config\/css\/wxArticle.css\" rel=\"stylesheet\"\/>\n<\/head><script>\nvar data={\"mp\":\"\u751f\u4fe1\u679c\",\"title\":\"bed\u6587\u4ef6\u5904\u7406\u5de5\u5177\u4e4b\u2014\u2014bedtools\",\"time\":\"2023-11-01 19:00:27\",\"timeStamp\":\"1698836427\"};\n<\/script><br \/>\n<body><\/p>\n<div class=\"rich_media\">\n<h1 class=\"rich_media_title\" id=\"activity-name\"><a href=\"http:\/\/mp.weixin.qq.com\/s?__biz=Mzg3OTg3MjQyNg==&#038;mid=2247494941&#038;idx=1&#038;sn=4c19f641bb8af12483a1d3af1ff1887b&#038;chksm=cf7f7dd8f808f4cee7c1af5853c6f0f0a204b2102f467dd32dbd229a81e1caaf9ba3bc4a56b5#rd\" target=\"_blank\" rel=\"noopener\">bed\u6587\u4ef6\u5904\u7406\u5de5\u5177\u4e4b\u2014\u2014bedtools<\/a><\/h1>\n<div id=\"meta_content\" class=\"rich_media_meta_list\"><span id=\"copyright_logo\" class=\"wx_tap_link js_wx_tap_highlight rich_media_meta icon_appmsg_tag appmsg_title_tag weui-wa-hotarea\">\u539f\u521b&nbsp;&nbsp;<\/span><span class=\"rich_media_meta rich_media_meta_text\">\u5c0f\u679c&nbsp;&nbsp;<\/span><span class=\"rich_media_meta rich_media_meta_nickname\" id=\"profileBt\"><a href=\"javascript:void(0);\" class=\"wx_tap_link js_wx_tap_highlight weui-wa-hotarea\" id=\"js_name\">\u751f\u4fe1\u679c&nbsp;&nbsp;<\/a><\/span><em id=\"publish_time\" class=\"rich_media_meta rich_media_meta_text\">2023-11-01 19:00:27<\/em><\/div>\n<p><content><\/p>\n<div class=\"topic\">\n<p>\u6536\u5f55\u4e8e\u8bdd\u9898<\/p>\n<p><a href=\"https:\/\/mp.weixin.qq.com\/mp\/appmsgalbum?__biz=Mzg3OTg3MjQyNg==&#038;action=getalbum&#038;album_id=3138206666342268940#wechat_redirect\" title=\"\u751f\u4fe1\u5c0f\u767d\u76f8\u5173\" target=\"_blank\" rel=\"noopener\">#\u751f\u4fe1\u5c0f\u767d\u76f8\u5173<\/a><a href=\"https:\/\/mp.weixin.qq.com\/mp\/appmsgalbum?__biz=Mzg3OTg3MjQyNg==&#038;action=getalbum&#038;album_id=2664545260517294084#wechat_redirect\" title=\"\u751f\u4fe1\u5b9e\u64cd\" target=\"_blank\" rel=\"noopener\">#\u751f\u4fe1\u5b9e\u64cd<\/a><\/p>\n<\/div>\n<p style=\"text-align: center;\" data-mpa-powered-by=\"yiban.io\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-galleryid=\"\" data-ratio=\"0.2216796875\" data-s=\"300,640\" src=\"\u56fe\u7247\/\u751f\u4fe1\u679c_2023-11-01_bed\u6587\u4ef6\u5904\u7406\u5de5\u5177\u4e4b\u2014\u2014bedtools\/1_snVaia0ia8A5L1rXZ1xVtIEYJhRYwg.jpg\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_jpg\/zcicibWZessAyOD23lzsibR9jQXL7ibIszDztr50BBOLhoBOyv5vjbFzPuGOYiasnVaia0ia8A5L1rXZ1xVtIEYJhRYwg\/640?wx_fmt=jpeg'\" data-type=\"jpeg\" data-w=\"1024\" style=\"\"><\/p>\n<h1><span style=\"font-size: 14px;letter-spacing: 0.034em;\">\u5927\u5bb6\u597d\uff01\u5c0f\u679c\u6211\u5440\uff0c\u4eca\u5929\u6211\u8981\u7ed9\u5927\u5bb6\u63a8\u8350\u4e00\u4e2a\u8d85\u597d\u7528\u7684\u751f\u4fe1\u5c0f\u5de5\u5177\u2014\u2014bedtools\uff01<br  \/><\/span><\/h1>\n<p><span style=\"font-size: 14px;\">bedtools\u662f\u4e00\u4e2a\u5904\u7406\u57fa\u56e0\u7ec4bed\u6587\u4ef6\u7684\u8f6f\u4ef6\u5305\uff0c\u5b83\u53ef\u4ee5\u5b9e\u73b0\u5404\u79cd\u57fa\u56e0\u7ec4\u5206\u6790\uff0c\u6bd4\u5982\u5bfb\u627e\u91cd\u53e0\u533a\u57df\u3001\u8ba1\u7b97\u8986\u76d6\u5ea6\u3001\u5408\u5e76\u6216\u5207\u5206\u533a\u95f4\u7b49\u7b49\u3002bedtools\u7684\u7279\u70b9\u662f\u5b83\u652f\u6301\u591a\u79cd\u6587\u4ef6\u683c\u5f0f\uff0c\u6bd4\u5982BED\u3001GFF\u3001VCF\u7b49\uff0c\u800c\u4e14\u5b83\u7684\u64cd\u4f5c\u4e5f\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u51e0\u4e2a\u547d\u4ee4\u5c31\u53ef\u4ee5\u5b8c\u6210\u590d\u6742\u7684\u4efb\u52a1\u3002bedtools\u8fd8\u53ef\u4ee5\u548c\u5176\u4ed6\u5de5\u5177\u914d\u5408\u4f7f\u7528\uff0c\u6bd4\u5982samtools\u3001bowtie2\u3001bwa\u7b49\uff0c\u4ece\u800c\u5b9e\u73b0\u66f4\u591a\u7684\u529f\u80fd\u3002bedtools\u662f\u4e00\u4e2a\u975e\u5e38\u5b9e\u7528\u7684\u5de5\u5177\uff0c\u5f3a\u70c8\u63a8\u8350\u5927\u5bb6\u5b66\u4e60\u548c\u4f7f\u7528\u5b83\u3002<\/span><\/p>\n<p><strong><span style=\"font-size: 14px;\">\u90a3\u4e48\uff0c\u600e\u4e48\u5b89\u88c5\u548c\u4f7f\u7528bedtools\u5462\uff1f\u5176\u5b9e\u5f88\u7b80\u5355\uff0c\u53ea\u9700\u8981\u4e09\u6b65\u5c31\u53ef\u4ee5\u4e86\u3002<\/span><\/strong><\/p>\n<p><span style=\"font-size: 14px;\">\u7b2c\u4e00\u6b65\uff0c\u4e0b\u8f7dbedtools\u7684\u6e90\u7801\u5305\uff0c\u53ef\u4ee5\u4ece\u5b98\u7f51\u6216\u8005GitHub\uff08<\/span><span style=\"font-size: 14px;\">https:\/\/github.com\/arq5x\/bedtools2<\/span><span style=\"font-size: 14px;\"> \uff09\u4e0a\u83b7\u53d6\u3002<\/span><\/p>\n<p><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.6268518518518519\" src=\"http:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/2_oZbfGbhVTibswrg3PbQrssrCRQzN7Q.png\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/zcicibWZessAxITbWibFrR6nRVnutEeqghH695V9LZmSENncaZluA9IDlfy9oZbfGbhVTibswrg3PbQrssrCRQzN7Q\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"1080\" style=\"height: auto !important;\"  \/><\/p>\n<p><span style=\"font-size: 14px;letter-spacing: 0.034em;\">\u7b2c\u4e8c\u6b65\uff0c\u89e3\u538b\u6e90\u7801\u5305\uff0c\u5e76\u5728\u7ec8\u7aef\u4e2d\u8fdb\u5165\u89e3\u538b\u540e\u7684\u6587\u4ef6\u5939\u3002<br  \/><\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"properties\"><code><span class=\"code-snippet_outer\"><span style=\"font-size: 14px;\">unzip bedtools2-master.zip<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span style=\"font-size: 14px;\">cd bedtools2-master\/<\/span><\/span><\/code><\/pre>\n<\/section>\n<p><span style=\"font-size: 14px;\">\u7b2c\u4e09\u6b65\uff0c\u8f93\u5165make\u547d\u4ee4\uff0c\u7f16\u8bd1\u548c\u5b89\u88c5bedtools\u3002\u8fd9\u6837\u5c31\u5b8c\u6210\u4e86bedtools\u7684\u5b89\u88c5\u5566\uff01\u975e\u5e38\u65b9\u4fbf\u5427\uff1f<\/span><\/p>\n<p><span style=\"font-size: 14px;\">\u63a5\u4e0b\u6765\uff0c\u7ed9\u5927\u5bb6\u6f14\u793a\u4e00\u4e0bbedtools\u7684\u57fa\u672c\u7528\u6cd5\u3002<\/span><\/p>\n<p><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1.222767419038273\" data-type=\"png\" data-w=\"1019\" style=\"height: auto !important;\" src=\"\u56fe\u7247\/\u751f\u4fe1\u679c_2023-11-01_bed\u6587\u4ef6\u5904\u7406\u5de5\u5177\u4e4b\u2014\u2014bedtools\/3_zm5oQghWEPydv0okE6H8YkJnP0rXQg.png\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/zcicibWZessAxITbWibFrR6nRVnutEeqghH6JMibxveXrOIvzH2aA99cOaNxzm5oQghWEPydv0okE6H8YkJnP0rXQg\/640?wx_fmt=png'\"  \/><\/p>\n<p><span style=\"font-size: 14px;\">\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u51c6\u5907\u4e00\u4e9b\u8f93\u5165\u6587\u4ef6\uff0c\u6bd4\u5982\u4e24\u4e2aBED\u6587\u4ef6\uff08\u6b64\u4f8b\u5b50\u4e2d\u7684bed\u6587\u4ef6\u6765\u81eabedtools\u81ea\u5e26\u7684\/test\/ \u6587\u4ef6\u5939\uff09\uff0c\u5206\u522b\u8868\u793a\u4e24\u7ec4\u57fa\u56e0\u7ec4\u533a\u57df\u3002\u6211\u4eec\u53ef\u4ee5\u7528cat\u547d\u4ee4\u67e5\u770b\u4e00\u4e0b\u8fd9\u4e24\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\uff1a<\/span><br  \/><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"properties\"><code><span class=\"code-snippet_outer\">$ cat A.bed<\/span><\/code><code><span class=\"code-snippet_outer\">chr1  10  20  a1  1  +<\/span><\/code><code><span class=\"code-snippet_outer\">chr1  100  200  a2  2  -<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">$ cat B.bed<\/span><\/code><code><span class=\"code-snippet_outer\">chr1  20  30  b1  1  +<\/span><\/code><code><span class=\"code-snippet_outer\">chr1  90  101  b2  2  -<\/span><\/code><code><span class=\"code-snippet_outer\">chr1  100  110  b3  3  +<\/span><\/code><code><span class=\"code-snippet_outer\">chr1  200  210  b4  4  +<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">samtools view test.bam<\/span><\/code><code><span class=\"code-snippet_outer\">@HD     VN:1.0  GO:none SO:coordinate<\/span><\/code><code><span class=\"code-snippet_outer\">@SQ     SN:chr1 LN:249250621<\/span><\/code><code><span class=\"code-snippet_outer\">paired-1  1  chr1  1  40  30M  *  0  0  AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA  DDDDDDDDDDDDDDDDDDDDDDDDDDDDDD  MD:Z:50<\/span><\/code><code><span class=\"code-snippet_outer\">paired-1  1  chr1  1  100  30M  *  0  0  GGGGGGGGGGGGGGGGGGGGGGGGGGGGGG  EEEEEEEEEEEEEEEEEEEEEEEEEEEEEE  MD:Z:50<\/span><\/code><code><span class=\"code-snippet_outer\">unpaired  1  chr1  1  100  30M  *  0  0  GAAGGCCACCGCCGCGGTTATTTTCCTTCA  CCCDDB?=FJIIJIGFJIJHIJJJJJJJJI  MD:Z:50<\/span><\/code><code><span class=\"code-snippet_outer\">paired-2  1  chr1  1  40  30M  *  0  0  TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT  FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF  MD:Z:50<\/span><\/code><\/pre>\n<\/section>\n<p><span style=\"color: rgb(2, 30, 170);font-size: 16px;\"><strong>1. Bedtools\u4e4bintersect\uff1a\u5bfb\u627e\u8fd9\u4e24\u4e2a\u6587\u4ef6\u7684\u91cd\u53e0\u533a\u57df\u3002<\/strong><\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"http\"><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">Usage: bedtools intersect [OPTIONS] -a &lt;bed\/gff\/vcf\/bam&gt; -b &lt;bed\/gff\/vcf\/bam&gt;<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">$ bedtools intersect -a a.bed -b b.bed<\/span><\/code><code><span class=\"code-snippet_outer\">chr1  100  101  a2  2  -chr1  100  110  a2  2  -<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">\u8fd9\u6837\u5c31\u5f97\u5230\u4e86\u91cd\u53e0\u533a\u57df\u7684\u5750\u6807\uff0c\u975e\u5e38\u5feb\u901f\u548c\u51c6\u786e\u3002\u6211\u4eec\u8fd8\u53ef\u4ee5\u7528-wa\u548c-wb\u9009\u9879\u6765\u8f93\u51fa\u5b8c\u6574\u7684\u91cd\u53e0\u533a\u57df\u4fe1\u606f\uff1a<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">$ bedtools intersect -a A.bed -b B.bed -wa -wb<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">A<\/span><\/code><code><span class=\"code-snippet_outer\">B<\/span><\/code><code><span class=\"code-snippet_outer\">chr1  100  200  a2  2  -  chr1  90  101  b2  2  -<\/span><\/code><code><span class=\"code-snippet_outer\">chr1  100  200  a2  2  -  chr1  100  110  b3  3  +<\/span><\/code><code><span class=\"code-snippet_outer\">\u8fd9\u6837\u5c31\u53ef\u4ee5\u770b\u5230\u6bcf\u4e2a\u91cd\u53e0\u533a\u57df\u5206\u522b\u5c5e\u4e8e\u54ea\u4e24\u4e2a\u8f93\u5165\u6587\u4ef6\u3002\u6211\u4eec\u8fd8\u53ef\u4ee5\u7528-loj\u9009\u9879\u6765\u8f93\u51fa\u5de6\u8fde\u63a5\u7684\u7ed3\u679c\uff0c\u5373\u8f93\u51fa\u6240\u6709A\u6587\u4ef6\u4e2d\u7684\u533a\u57df\uff0c\u4ee5\u53ca\u4e0e\u4e4b\u91cd\u53e0\u6216\u8005\u4e0d\u91cd\u53e0\u7684B\u6587\u4ef6\u4e2d\u7684\u533a\u57df\uff1a<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">$ bedtools intersect -a A.bed -b B.bed -loj<\/span><\/code><code><span class=\"code-snippet_outer\">chr1  10  20  a1  1  +  .  -1  -1  .  -1  .<\/span><\/code><code><span class=\"code-snippet_outer\">chr1  100  200  a2  2  -  chr1  90  101  b2  2  -<\/span><\/code><code><span class=\"code-snippet_outer\">chr1  100  200  a2  2  -  chr1  100  110  b3  3  +<\/span><\/code><\/pre>\n<\/section>\n<p><span style=\"font-size: 15px;\"><strong><span style=\"font-size: 15px;color: rgb(2, 30, 170);\">2. Bedtools\u4e4bmerge\uff1a\u53ef\u4ee5\u5c06\u4e00\u4e2aBED\u6587\u4ef6\u4e2d\u6240\u6709\u7684\u91cd\u53e0\u533a\u57df\u548c\u76f8\u90bbmerge\u4e3a\u4e00\u4e2a\u5927\u7684\u533a\u57df\u3002\u547d\u4ee4\u5982\u4e0b\uff1a<\/span><\/strong><\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"properties\"><code><span class=\"code-snippet_outer\">$bedtools merge -i B.bed<\/span><\/code><code><span class=\"code-snippet_outer\">chr1    20      30<\/span><\/code><code><span class=\"code-snippet_outer\">chr1    90      110<\/span><\/code><code><span class=\"code-snippet_outer\">chr1    200     210<\/span><\/code><code><span class=\"code-snippet_outer\">\u8f93\u51fa\u7684\u4e09\u5217\u4e3a\uff1a\u67d3\u8272\u4f53\u3001\u5408\u5e76\u533a\u95f4\u7684\u8d77\u59cb\u4f4d\u7f6e\u548c\u7ed3\u675f\u4f4d\u7f6e\u3002<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">B<\/span><\/code><code><span class=\"code-snippet_outer\">\u6ce8\u610f\uff1a\u4f7f\u7528 merge \u547d\u4ee4\u4e4b\u524d\uff0c\u9700\u8981\u786e\u4fdd\u8f93\u5165\u6587\u4ef6\u5df2\u7ecf\u6309\u7167\u67d3\u8272\u4f53\u987a\u5e8f\u6392\u5e8f\uff0c\u8fd9\u6837\u53ef\u4ee5\u52a0\u5feb\u5904\u7406\u901f\u5ea6\u5e76\u51cf\u5c11\u5185\u5b58\u5360\u7528\u3002\u5982\u679c\u8f93\u5165\u6587\u4ef6\u6ca1\u6709\u6392\u5e8f\uff0cbedtools merge \u53ef\u80fd\u4f1a\u8fd0\u884c\u51fa\u9519\u3002<\/span><\/code><\/pre>\n<\/section>\n<p><strong><span style=\"color: rgb(2, 30, 170);font-size: 15px;\">3. bedtools\u4e4b\u683c\u5f0f\u8f6c\u6362<\/span><\/strong><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"properties\"><code><span class=\"code-snippet_outer\">bedtools\u53ef\u4ee5\u505a\u4ee5\u4e0b\u51e0\u79cd\u683c\u5f0f\u8f6c\u6362\uff1abamtobed\u3001bedtobam\u3001bamtofastq\u3001bedpetobam\u3001bed12tobed6\uff0c\u8fd9\u91cc\u5c31\u4ee5bamtobed\u4e3a\u4f8b\u7ed9\u5927\u5bb6\u6f14\u793a\u4ee5\u4e0b\u5427\u3002<\/span><\/code><code><span class=\"code-snippet_outer\">$ bedtools bamtobed -i test.bam<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">chr1    0       30      paired-1        40      +<\/span><\/code><code><span class=\"code-snippet_outer\">chr1    0       30      paired-1        100     +<\/span><\/code><code><span class=\"code-snippet_outer\">chr1    0       30      unpaired        100     +<\/span><\/code><code><span class=\"code-snippet_outer\">chr1    0       30      paired-2        40      +<\/span><\/code><\/pre>\n<\/section>\n<p><strong><span style=\"font-size: 15px;\">4. Bedtools\u4e4bcoverage\uff1a\u8ba1\u7b97\u6df1\u5ea6\u548c\u5e7f\u5ea6\u3002<\/span><\/strong><\/p>\n<p><span style=\"font-size: 14px;\">Bedtools coverage\u53ef\u4ee5\u8ba1\u7b97BED\u6587\u4ef6B\u5728A\u6587\u4ef6\u4e0a\u7684\u8986\u76d6\u6df1\u5ea6\u548c\u5e7f\u5ea6\u3002\u547d\u4ee4\u5982\u4e0b\uff1a<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"shell\"><code><span class=\"code-snippet_outer\">$ bedtools coverage -a A.bed -b B.bed<\/span><\/code><\/pre>\n<\/section>\n<p><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.04555555555555556\" data-type=\"png\" data-w=\"900\" style=\"height: auto !important;\" src=\"http:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/4_sfg4jcNkL41qsgUPFu2KKuDS0npf0A.png\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/zcicibWZessAxITbWibFrR6nRVnutEeqghHVg0oMZm4Ual80mHojKCyY2lusfg4jcNkL41qsgUPFu2KKuDS0npf0A\/640?wx_fmt=png'\"  \/><\/p>\n<p><span style=\"color: rgb(2, 30, 170);\"><strong><span style=\"font-size: 15px;\">5. bedtools\u4e4bmap<\/span><\/strong><\/span><span style=\"font-size: 14px;\"><br  \/>bedtools map \u7684\u529f\u80fd\u662f\u5c06\u4e00\u4e2a\u6587\u4ef6\u4e2d\u7684\u533a\u57df\uff08\u4f8b\u5982\u57fa\u56e0\u6216\u8f6c\u5f55\u672c\uff09\u6620\u5c04\u5230\u53e6\u4e00\u4e2a\u6587\u4ef6\u4e2d\u7684\u533a\u57df\uff08\u4f8b\u5982\u6d4b\u5e8f\u8bfb\u53d6\u6216\u5cf0\u503c\uff09\uff0c\u5e76\u8ba1\u7b97\u6bcf\u4e2a\u533a\u57df\u7684\u8986\u76d6\u5ea6\u6216\u5176\u4ed6\u7edf\u8ba1\u91cf\u3002\u8fd9\u4e2a\u5de5\u5177\u53ef\u4ee5\u7528\u6765\u5206\u6790\u4e0d\u540c\u6837\u672c\u4e4b\u95f4\u7684\u533a\u57df\u91cd\u53e0\u60c5\u51b5\uff0c\u6216\u8005\u8bc4\u4f30\u67d0\u4e9b\u7279\u5f81\uff08\u4f8b\u5982\u7532\u57fa\u5316\u6216\u7ec4\u86cb\u767d\u4fee\u9970\uff09\u5728\u7279\u5b9a\u533a\u57df\u7684\u5206\u5e03\u60c5\u51b5\u3002bedtools map \u7684\u4f7f\u7528\u65b9\u6cd5\u5982\u4e0b\uff1a<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"shell\"><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__meta\">$<\/span> bedtools map -a A.bed -b B.bed<\/span><\/code><\/pre>\n<\/section>\n<p><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.0734094616639478\" data-type=\"png\" data-w=\"613\" style=\"height: auto !important;\" src=\"http:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/5_SRwMnpevxkw93bUkWCzYqGuoPAncxQ.png\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/zcicibWZessAxITbWibFrR6nRVnutEeqghHznySWicHN2UC9dygJicuxTEk3xSRwMnpevxkw93bUkWCzYqGuoPAncxQ\/640?wx_fmt=png'\"  \/><\/p>\n<p><span style=\"font-size: 14px;\">\u5f53\u7136\uff0cbedtools\u8fd8\u6709\u5f88\u591a\u5176\u4ed6\u7684\u547d\u4ee4\u548c\u9009\u9879\uff0c\u6bd4\u5982complement\u3001subtract\u3001sort\u3001shuffle\u7b49\u7b49\uff0c\u6211\u5c31\u4e0d\u4e00\u4e00\u4ecb\u7ecd\u4e86\uff0c<strong>\u5927\u5bb6\u53ef\u4ee5\u81ea\u5df1\u53bb\u63a2\u7d22\u548c\u5c1d\u8bd5\u54e6\uff01<\/strong><\/span><\/p>\n<p><span style=\"font-size: 14px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=Mzg3OTg3MjQyNg==&amp;mid=2247493633&amp;idx=1&amp;sn=2263dfe7572c0bcf6816c2c1a37d79de&amp;chksm=cf7f78c4f808f1d2209321d6ace39fde5fa60c0691b56f88eac21916f5a2872ce8ee345f1d5f&amp;scene=21#wechat_redirect\" textvalue=\"\u4f60\u5df2\u9009\u4e2d\u4e86\u6dfb\u52a0\u94fe\u63a5\u7684\u5185\u5bb9\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"1\" rel=\"noopener\"><span class=\"js_jump_icon h5_image_link\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.4255555555555556\" data-w=\"900\" style=\"height: auto !important;\" src=\"http:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/6_3enDMf2LD6pjia3zQolKXIfTwuh6AA-9.jpg\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_jpg\/zcicibWZessAxweqRKIWbRUBSWSGID9aog3q3QVgsHZplb1JyboXh8CPz6b3enDMf2LD6pjia3zQolKXIfTwuh6AA\/640?wx_fmt=jpeg&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1'\"  \/><\/span><\/a><\/span><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.38981481481481484\" data-s=\"300,640\" data-type=\"png\" data-w=\"1080\" style=\"font-size: var(--articleFontsize);letter-spacing: 0.034em;height: auto !important;\" src=\"http:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/7_FbEg9fibwQicL8l2ExKOZZTmAHXabQ-1.png\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/zcicibWZessAx3HetBkB7aOGibFWKqibqIATyC4zFibzCgdrxFwRep6cDMLIbA0FbEg9fibwQicL8l2ExKOZZTmAHXabQ\/640?wx_fmt=png'\"  \/><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.38981481481481484\" data-s=\"300,640\" data-type=\"png\" data-w=\"1080\" style=\"font-size: var(--articleFontsize);letter-spacing: 0.034em;height: auto !important;\" src=\"http:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/8_IWicymEetCc6Enf2BkUE4Yz1Ya5e5w.png\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/zcicibWZessAyuYsqlJnQUJvnS2iciaDibtfbdV0VmHlriaSjYwjFPLp1BLjokHIWicymEetCc6Enf2BkUE4Yz1Ya5e5w\/640?wx_fmt=png'\"  \/><\/p>\n<p style=\"display: none;\"><mp-style-type data-value=\"3\"><\/mp-style-type><\/p>\n<p><\/content>\n<\/div>\n<p><\/body><br \/>\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>bed\u6587\u4ef6\u5904\u7406\u5de5\u5177\u4e4b\u2014\u2014bedtools \u539f\u521b&nbsp;&nbsp;\u5c0f\u679c&nbsp;&nbsp;\u751f\u4fe1\u679c&#038;nb [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":""},"categories":[1],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/54849"}],"collection":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=54849"}],"version-history":[{"count":1,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/54849\/revisions"}],"predecessor-version":[{"id":54859,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/54849\/revisions\/54859"}],"wp:attachment":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=54849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=54849"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=54849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}