{"id":70087,"date":"2026-11-14T22:57:31","date_gmt":"2026-11-14T14:57:31","guid":{"rendered":"https:\/\/www.biocloudservice.com\/wordpress\/?p=70087"},"modified":"2026-11-14T22:57:31","modified_gmt":"2026-11-14T14:57:31","slug":"samtools-count-records-qname-overlapping-regions","status":"publish","type":"post","link":"https:\/\/www.biocloudservice.com\/wordpress\/samtools-count-records-qname-overlapping-regions\/","title":{"rendered":"SAMtools \u5b9e\u8dd1\uff5c\u540c\u4e00\u4efd BAM \u4e3a\u4ec0\u4e48\u80fd\u6570\u51fa 10 \u6761\u30017 \u6761\u548c 4 \u4e2a\u540d\u5b57\uff1f"},"content":{"rendered":"<div class=\"ysx-method-guide\" style=\"max-width:820px;min-width:0;margin:0 auto;color:#26374a;line-height:1.86;overflow-wrap:anywhere\">\n<p>\u540c\u4e8b\u8bf4\u4e00\u4efd\u6587\u4ef6\u91cc\u6709\u5341\u6761\uff0c\u6709\u4eba\u8fc7\u6ee4\u540e\u5269\u4e03\u6761\uff0c\u8fd8\u6709\u4eba\u6309\u540d\u5b57\u53bb\u91cd\u53ea\u770b\u5230\u56db\u4e2a\u3002\u6838\u67e5\u8986\u76d6\u4e4b\u524d\uff0c\u503c\u5f97\u5148\u95ee\u4e00\u53e5\uff0c\u6bcf\u4e2a\u4eba\u7a76\u7adf\u5728\u6570\u6bd4\u5bf9\u8bb0\u5f55\u3001\u5df2\u6bd4\u5bf9\u7684\u8bfb\u6bb5\u7aef\uff0c\u8fd8\u662f\u6d4b\u5e8f\u6a21\u677f\uff1f\u6211\u4eec\u51c6\u5907\u4e86\u53ea\u6709\u5341\u884c\u7684\u6bd4\u5bf9\u6587\u4ef6\uff0c\u8ba9\u7a0b\u5e8f\u9010\u884c\u7b5b\u9009\uff0c\u8fd8\u7528\u4e24\u4e2a\u91cd\u53e0\u7684\u533a\u95f4\u67e5\u4e86\u4e24\u6b21\u3002\u8fd9\u6837\uff0c\u8f93\u51fa\u91cc\u7684\u6bcf\u4e00\u4e2a\u5dee\u503c\u90fd\u53ef\u4ee5\u8ffd\u5230\u67d0\u4e2a\u6807\u5fd7\u4f4d\u6216\u67d0\u6761\u91cd\u590d\u8fd4\u56de\u7684\u8bb0\u5f55\uff0c\u8bfb\u8005\u53ef\u4ee5\u7167\u8fd9\u4e2a\u529e\u6cd5\u7ed9\u81ea\u5df1\u7684\u7ed3\u679c\u9009\u62e9\u5408\u9002\u7684\u5206\u6bcd\u3002<\/p>\n<h2 style=\"font-size:1.38em;line-height:1.5;margin:1.55em 0 .55em;color:#182d43\">\u4e00\u6761\u6d4b\u5e8f\u6a21\u677f\u53ef\u4ee5\u5728 BAM \u91cc\u5360\u51e0\u884c<\/h2>\n<p>\u53cc\u7aef\u6d4b\u5e8f\u901a\u5e38\u7ed9\u540c\u4e00\u4e2a\u6a21\u677f\u7684\u4e24\u4e2a\u7aef\u76f8\u540c\u7684\u67e5\u8be2\u540d\u79f0\uff0c\u7528\u6807\u5fd7\u4f4d\u533a\u5206\u7b2c\u4e00\u7aef\u548c\u7b2c\u4e8c\u7aef\u3002\u4e00\u4e2a\u7aef\u53ef\u80fd\u843d\u5728\u591a\u4e2a\u5019\u9009\u4f4d\u7f6e\uff0c\u9664\u4e3b\u8bb0\u5f55\u5916\u8fd8\u6709\u6b21\u8981\u8bb0\u5f55\u3002\u540c\u4e00\u4e2a\u7aef\u82e5\u5206\u6bb5\u6bd4\u5bf9\uff0c\u8fd8\u53ef\u80fd\u6709\u8865\u5145\u8bb0\u5f55\uff0c\u63cf\u8ff0\u540c\u4e00\u67e5\u8be2\u5728\u53e6\u4e00\u4e2a\u4f4d\u7f6e\u6216\u65b9\u5411\u7684\u90e8\u5206\u3002\u4e00\u884c\u5bf9\u5e94\u4e00\u4e2a\u6bd4\u5bf9\u8bb0\u5f55\u3002\u5b8c\u6574\u904d\u5386\u6587\u4ef6\u6570\u884c\u5f88\u5bb9\u6613\uff0c\u4f46\u8fd9\u4e00\u6570\u5b57\u65e2\u5305\u62ec\u5df2\u5b9a\u4f4d\u7684\u8bb0\u5f55\uff0c\u4e5f\u53ef\u80fd\u5305\u542b\u672a\u5b9a\u4f4d\u7684\u5360\u4f4d\u884c\u3002\u540c\u540d\u4e24\u884c\u6709\u65f6\u662f\u540c\u4e00\u6a21\u677f\u7684\u4e24\u7aef\uff0c\u6709\u65f6\u662f\u540c\u4e00\u7aef\u7684\u4e24\u4e2a\u4f4d\u7f6e\uff0c\u8fd9\u4e24\u79cd\u60c5\u5f62\u9700\u8981\u8bfb\u6807\u5fd7\u4f4d\u624d\u80fd\u533a\u5206\u3002<a style=\"color:#315489;text-decoration:underline;text-underline-offset:2px\" href=\"https:\/\/samtools.github.io\/hts-specs\/SAMv1.pdf\">SAM \u89c4\u8303\u5bf9\u6a21\u677f\u3001\u4e3b\u6b21\u4e0e\u8865\u5145\u6bd4\u5bf9\u7684\u5b9a\u4e49<\/a><\/p>\n<p>\u672c\u4f8b\u6709\u4e24\u4e2a\u53cc\u7aef\u6a21\u677f\uff0c\u5408\u8ba1\u56db\u884c\u3002\u53e6\u6709\u4e00\u4e2a\u5355\u7aef\u67e5\u8be2\u542b\u4e3b\u3001\u6b21\u4e24\u884c\uff0c\u4e00\u4e2a\u62c6\u5206\u67e5\u8be2\u542b\u4e3b\u3001\u8865\u5145\u4e24\u884c\uff0c\u4e00\u6761\u6807\u4e3a\u91cd\u590d\u7684\u5355\u7aef\u4e3b\u8bb0\u5f55\uff0c\u4ee5\u53ca\u4e00\u6761\u672a\u6bd4\u5bf9\u8bb0\u5f55\u3002\u6240\u6709\u540d\u5b57\u5728\u8fd9\u4efd\u6784\u9020\u6570\u636e\u4e2d\u5404\u6709\u660e\u786e\u5f52\u5c5e\uff0c\u6240\u6709\u8bb0\u5f55\u90fd\u901a\u8fc7\u5e73\u53f0\u8d28\u91cf\u6807\u8bb0\u3002\u7528 SAMtools 1.19.2 \u5bf9\u8fd9\u4efd\u8868\u6392\u5e8f\u3001\u5efa\u7d22\u5f15\uff0c\u518d\u5206\u522b\u67e5\u8be2\u3002\u5b9e\u9a8c\u7684\u8f93\u5165\u6807\u8bb0\u7531\u6211\u4eec\u8bbe\u5b9a\uff0c\u56e0\u6b64\u7ed3\u679c\u53ea\u80fd\u8bf4\u660e\u7b5b\u9009\u903b\u8f91\uff0c\u4e0d\u80fd\u7528\u6765\u8bc4\u4ef7\u67d0\u4e2a\u6bd4\u5bf9\u5668\u8bc6\u522b\u91cd\u590d\u6216\u65ad\u70b9\u7684\u51c6\u786e\u6027\u3002<\/p>\n<h2 style=\"font-size:1.38em;line-height:1.5;margin:1.55em 0 .55em;color:#182d43\">\u5b9e\u8dd1\u7ecf\u9a8c\uff5c\u6309\u987a\u5e8f\u52a0\u4e0a\u4e09\u4e2a\u6392\u9664\u6761\u4ef6<\/h2>\n<p>\u5148\u770b\u5b8c\u6574\u6587\u4ef6\uff0c\u5341\u6761\u8bb0\u5f55\u5bf9\u5e94\u516d\u4e2a\u4e0d\u540c\u7684\u67e5\u8be2\u540d\u3002\u53ea\u53bb\u6389\u672a\u6bd4\u5bf9\u8bb0\u5f55\u540e\uff0c\u5269\u4e0b\u4e5d\u6761\uff0c\u5bf9\u5e94\u4e94\u4e2a\u4e0d\u540c\u540d\u5b57\u3002\u518d\u6392\u9664\u6b21\u8981\u548c\u8865\u5145\u8bb0\u5f55\uff0c\u5269\u4e03\u6761\uff0c\u4ecd\u6709\u4e94\u4e2a\u540d\u5b57\u3002\u521a\u624d\u51cf\u6389\u7684\u4e24\u6761\u5404\u6709\u4e00\u6761\u540c\u540d\u4e3b\u8bb0\u5f55\uff0c\u6240\u4ee5\u884c\u6570\u51cf\u5c11\uff0c\u540d\u5b57\u6570\u4e0d\u53d8\u3002\u6700\u540e\u53bb\u6389\u6807\u4e3a\u91cd\u590d\u7684\u90a3\u6761\u5355\u7aef\u4e3b\u8bb0\u5f55\uff0c\u8fd8\u5269\u516d\u6761\uff0c\u5bf9\u5e94\u56db\u4e2a\u540d\u5b57\u3002\u5176\u4e2d\u4e24\u4e2a\u540d\u5b57\u662f\u6210\u5bf9\u7684\uff0c\u5404\u5360\u4e24\u884c\uff0c\u53e6\u5916\u4e24\u4e2a\u540d\u5b57\u5404\u5360\u4e00\u884c\u3002<\/p>\n<div class=\"guide-table\" style=\"max-width:100%;overflow-x:auto;margin:18px 0\">\n<table style=\"display:table;width:100%;max-width:100%;min-width:0;table-layout:fixed;border-collapse:collapse;font-size:.92em;line-height:1.6\">\n<thead>\n<tr>\n<th scope=\"col\" style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;background:#eef4ff;color:#1e293b;vertical-align:top;text-align:left;padding:6px;border:1px solid #c4cfdb\">SAMtools \u7b5b\u9009<\/th>\n<th scope=\"col\" style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;background:#eef4ff;color:#1e293b;vertical-align:top;text-align:right;padding:6px;border:1px solid #c4cfdb\">\u4fdd\u7559\u7684\u6bd4\u5bf9\u8bb0\u5f55<\/th>\n<th scope=\"col\" style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;background:#eef4ff;color:#1e293b;vertical-align:top;text-align:right;padding:6px;border:1px solid #c4cfdb\">\u4e0d\u540c\u67e5\u8be2\u540d<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb\">\u4e0d\u7b5b\u9009<\/td>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb;text-align:right\">10<\/td>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb;text-align:right\">6<\/td>\n<\/tr>\n<tr>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb\">\u6392\u9664\u672a\u6bd4\u5bf9\uff0c\u6807\u5fd7\u63a9\u7801 0x4<\/td>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb;text-align:right\">9<\/td>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb;text-align:right\">5<\/td>\n<\/tr>\n<tr>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb\">\u53ea\u8ba1\u5df2\u6bd4\u5bf9\u7684\u4e3b\u8bb0\u5f55\uff0c0x904<\/td>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb;text-align:right\">7<\/td>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb;text-align:right\">5<\/td>\n<\/tr>\n<tr>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb\">\u518d\u6392\u9664\u5df2\u6807\u8bb0\u91cd\u590d\uff0c0xD04<\/td>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb;text-align:right\">6<\/td>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb;text-align:right\">4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<figure class=\"guide-figure\" style=\"margin:24px 0 28px\"><img loading=\"lazy\" decoding=\"async\" src=\"\/wordpress\/wp-content\/uploads\/2026\/11\/samtools-count-records-qname-overlapping-regions-guide.png\" alt=\"\u5341\u884c BAM \u80fd\u6570\u51fa\u4ec0\u4e48\u3002\u4e24\u4e2a\u53cc\u7aef\u6a21\u677f\uff0c\u52a0\u4e0a\u6b21\u8981\u3001\u8865\u5145\u3001\u91cd\u590d\u53ca\u672a\u6bd4\u5bf9\u7684\u8bb0\u5f55\u3002\u5168\u6587\u4ef6\uff0c10 \u884c \/ 6 \u540d\uff0c\u8bb0\u5f55\u4f1a\u540c\u65f6\u5305\u542b\u8bfb\u6bb5\u4e24\u7aef\u548c\u9644\u52a0\u4f4d\u7f6e\u3002\u4e3b\u6bd4\u5bf9\uff0c7 \u884c \/ 5 \u540d\uff0c\u6392\u9664\u672a\u6bd4\u5bf9\u3001\u6b21\u8981\u4e0e\u8865\u5145\u8bb0\u5f55\u3002\u91cd\u53e0\u533a\u95f4\uff0c10 \u884c \u2192 6 \u884c\uff0c\u4e24\u4e2a\u533a\u95f4\u53d6\u5e76\u96c6\uff0c\u907f\u514d\u91cd\u590d\u8fd4\u56de\u8bb0\u5f55\u3002\" width=\"1200\" height=\"840\" style=\"display:block;width:100%;height:auto;border-radius:10px\"><figcaption style=\"font-size:14px;line-height:1.6;margin:9px 2px 0;color:#475569\">\u4e24\u4e2a\u53cc\u7aef\u6a21\u677f\uff0c\u52a0\u4e0a\u6b21\u8981\u3001\u8865\u5145\u3001\u91cd\u590d\u53ca\u672a\u6bd4\u5bf9\u7684\u8bb0\u5f55\u3002<\/figcaption><\/figure>\n<p>\u6807\u5fd7\u4f4d\u53ef\u4ee5\u5e76\u5b58\uff0c\u9002\u5408\u7528\u4f4d\u63a9\u7801\u68c0\u67e5\u3002\u6392\u9664\u63a9\u7801\u8868\u793a\u53ea\u8981\u8bb0\u5f55\u547d\u4e2d\u5176\u4e2d\u4efb\u4e00\u4f4d\u4fbf\u53bb\u6389\u3002\u5df2\u6bd4\u5bf9\u4e3b\u8bb0\u5f55\u7684\u63a9\u7801\u5408\u5e76\u672a\u6bd4\u5bf9\u3001\u6b21\u8981\u3001\u8865\u5145\u4e09\u4f4d\u3002\u518d\u52a0\u4e0a\u91cd\u590d\u4f4d\u5219\u5f97\u5230\u6700\u540e\u4e00\u884c\u3002\u6ca1\u6709\u6807\u4e3a\u91cd\u590d\u53ea\u8868\u793a\u8f93\u5165\u91cc\u76f8\u5e94\u4f4d\u672a\u88ab\u8bbe\u7f6e\u3002\u82e5\u4e0a\u6e38\u6839\u672c\u6ca1\u505a\u91cd\u590d\u6807\u8bb0\uff0c\u8fd9\u4e2a\u7b5b\u9009\u7167\u6837\u53ef\u4ee5\u6b63\u5e38\u6267\u884c\uff0c\u5374\u4e0d\u4f1a\u53bb\u6389\u4efb\u4f55\u8bb0\u5f55\u3002\u82e5\u5b9e\u9a8c\u4f7f\u7528\u5206\u5b50\u6807\u7b7e\uff0c\u6309\u67e5\u8be2\u540d\u7edf\u8ba1\u4e5f\u65e0\u6cd5\u76f4\u63a5\u5f97\u5230\u5206\u5b50\u6570\u3002\u5148\u8bfb\u6587\u4ef6\u5934\u4e2d\u4e0a\u6e38\u7a0b\u5e8f\u548c\u5b9e\u9a8c\u8bbe\u8ba1\uff0c\u518d\u51b3\u5b9a\u662f\u5426\u6709\u4f9d\u636e\u4f7f\u7528\u67d0\u4e2a\u6807\u8bb0\u3002<a style=\"color:#315489;text-decoration:underline;text-underline-offset:2px\" href=\"https:\/\/www.htslib.org\/doc\/1.19\/samtools-view.html\">SAMtools view \u7684\u6807\u5fd7\u4e0e\u8fc7\u6ee4\u9009\u9879<\/a><\/p>\n<pre style=\"max-width:100%;box-sizing:border-box;overflow-x:auto;margin:18px 0;padding:14px 16px;background:#f3f6fa;color:#1a293c;border:1px solid #d8e1ea;border-radius:8px;line-height:1.55;white-space:pre;overflow-wrap:normal;word-break:normal\"><code class=\"language-bash\">samtools sort -o sorted.bam fixture.sam\r\nsamtools index sorted.bam\r\nsamtools flagstat -O json sorted.bam\r\nsamtools view -c -F 0x904 sorted.bam\r\nsamtools view -F 0xD04 sorted.bam | cut -f1 | sort -u | wc -l\r\n<\/code><\/pre>\n<p>\u540c\u4e00\u6587\u4ef6\u7684\u6c47\u603b\u8868\u7ed9\u51fa\u5df2\u6bd4\u5bf9\u767e\u5206\u4e4b\u4e5d\u5341\uff0c\u5df2\u6bd4\u5bf9\u4e3b\u8bb0\u5f55\u767e\u5206\u4e4b\u516b\u5341\u4e03\u70b9\u4e94\u3002\u7b2c\u4e00\u9879\u7528\u4e5d\u9664\u4ee5\u5168\u90e8\u5341\u884c\uff0c\u7b2c\u4e8c\u9879\u7528\u4e03\u9664\u4ee5\u516b\u6761\u4e3b\u8bb0\u5f55\u3002\u672a\u6bd4\u5bf9\u90a3\u6761\u4e5f\u662f\u4e3b\u8bb0\u5f55\uff0c\u56e0\u4e3a\u5b83\u65e2\u6ca1\u6709\u6b21\u8981\u4f4d\uff0c\u4e5f\u6ca1\u6709\u8865\u5145\u4f4d\u3002\u4e24\u9879\u90fd\u6309\u5404\u81ea\u5206\u6bcd\u7b97\u5bf9\u4e86\u3002\u5982\u679c\u628a\u4e03\u9664\u4ee5\u5341\u540e\u62ff\u53bb\u4e0e\u7b2c\u4e8c\u9879\u5bf9\u8d26\uff0c\u6c38\u8fdc\u5dee\u5341\u4e03\u70b9\u4e94\u4e2a\u767e\u5206\u70b9\u3002\u53cc\u7aef\u90e8\u5206\u53e6\u62a5\u56db\u7aef\u5747\u6b63\u786e\u914d\u5bf9\uff0c\u6bd4\u4f8b\u767e\u5206\u4e4b\u767e\uff0c\u5b83\u53c8\u6709\u81ea\u5df1\u7684\u5206\u6bcd\uff0c\u4e0d\u5e94\u518d\u62ff\u5168\u6587\u4ef6\u5341\u884c\u53bb\u9664\u3002<a style=\"color:#315489;text-decoration:underline;text-underline-offset:2px\" href=\"https:\/\/www.htslib.org\/doc\/1.19\/samtools-flagstat.html\">SAMtools flagstat \u5bf9\u5404\u9879\u767e\u5206\u6bd4\u7684\u5b9a\u4e49<\/a><\/p>\n<p>\u8fd9\u4efd\u5c0f\u8868\u91cc\uff0c\u6c47\u603b\u663e\u793a\u8d28\u91cf\u672a\u901a\u8fc7\u7684\u4e00\u680f\u5168\u4e3a\u96f6\uff0c\u56e0\u6b64\u5df2\u6bd4\u5bf9\u5360\u6bd4\u6ca1\u6709\u6df7\u5165\u53e6\u4e00\u7ec4\u8bb0\u5f55\u3002\u9047\u5230\u771f\u5b9e\u6570\u636e\uff0c\u8be5\u5de5\u5177\u628a\u901a\u8fc7\u4e0e\u672a\u901a\u8fc7\u5e73\u53f0\u8d28\u91cf\u68c0\u67e5\u7684\u8bb0\u5f55\u5206\u680f\uff0c\u8bfb\u51fa\u4e24\u4e2a\u6570\u540e\uff0c\u5e94\u5148\u660e\u786e\u662f\u5426\u8ba1\u5212\u5408\u5e76\u3002\u82e5\u8981\u8ba1\u5165\u540e\u8005\uff0c\u4e5f\u8981\u8ba9\u76f8\u5e94\u5206\u6bcd\u4e00\u5e76\u6539\u53d8\u3002\u628a\u4e24\u680f\u7684\u5206\u5b50\u76f8\u52a0\uff0c\u5374\u6cbf\u7528\u5176\u4e2d\u4e00\u680f\u7684\u5206\u6bcd\uff0c\u5f97\u5230\u7684\u6bd4\u5bf9\u7387\u751a\u81f3\u53ef\u80fd\u8d85\u8fc7\u767e\u5206\u4e4b\u767e\u3002<\/p>\n<h2 style=\"font-size:1.38em;line-height:1.5;margin:1.55em 0 .55em;color:#182d43\">\u4e24\u4e2a\u63a2\u9488\u533a\u95f4\u76f8\u4ea4\uff0c\u8bb0\u5f55\u4f1a\u88ab\u8fd4\u56de\u51e0\u6b21<\/h2>\n<p>\u6211\u4eec\u67e5\u8be2\u4e00\u53f7\u5e8f\u5217\u4e0a\u4e00\u767e\u5230\u4e00\u767e\u4e09\u5341\uff0c\u4ee5\u53ca\u4e00\u767e\u4e00\u5341\u4e94\u5230\u4e00\u767e\u56db\u5341\u4e94\u4e24\u4e2a\u533a\u95f4\u3002\u628a\u4e24\u4e2a\u4f4d\u7f6e\u53c2\u6570\u76f4\u63a5\u4f20\u5165\u65f6\uff0c\u7a0b\u5e8f\u8fd4\u56de\u5341\u884c\u3002\u6539\u7528\u591a\u533a\u95f4\u8fed\u4ee3\u5668\u8bbf\u95ee\u5b83\u4eec\u7684\u5e76\u96c6\uff0c\u5b9e\u9645\u53ea\u6709\u516d\u6761\u4e0d\u540c\u7684\u6bd4\u5bf9\u8bb0\u5f55\uff0c\u5bf9\u5e94\u56db\u4e2a\u67e5\u8be2\u540d\u3002\u666e\u901a\u67e5\u8be2\u4e2d\u53e6\u56db\u884c\u6765\u81ea\u540c\u65f6\u4e0e\u4e24\u4e2a\u533a\u95f4\u76f8\u4ea4\u7684\u8bb0\u5f55\u3002\u5750\u6807\u6392\u5e8f\u548c\u7d22\u5f15\u80fd\u52a0\u5feb\u67e5\u627e\uff0c\u6ca1\u6709\u6d88\u9664\u4e0d\u540c\u67e5\u8be2\u533a\u95f4\u7684\u91cd\u53e0\u3002\u8fd9\u91cc\u7684\u91cd\u590d\u5c5e\u4e8e\u68c0\u7d22\u884c\u4e3a\uff0c\u548c\u54ea\u6761\u8bb0\u5f55\u5e26\u6709\u91cd\u590d\u6807\u5fd7\u662f\u4e24\u4e2a\u72ec\u7acb\u95ee\u9898\u3002<\/p>\n<pre style=\"max-width:100%;box-sizing:border-box;overflow-x:auto;margin:18px 0;padding:14px 16px;background:#f3f6fa;color:#1a293c;border:1px solid #d8e1ea;border-radius:8px;line-height:1.55;white-space:pre;overflow-wrap:normal;word-break:normal\"><code class=\"language-bash\">samtools view -c sorted.bam chr1:100-130 chr1:115-145\r\nsamtools view -c -M sorted.bam chr1:100-130 chr1:115-145\r\n<\/code><\/pre>\n<p>\u82e5\u60f3\u5206\u522b\u8bc4\u4ef7\u6bcf\u4e2a\u5916\u663e\u5b50\u80fd\u6355\u83b7\u591a\u5c11\u8bb0\u5f55\uff0c\u540c\u65f6\u4e0e\u4e24\u4e2a\u533a\u95f4\u76f8\u4ea4\u7684\u8bfb\u6bb5\u53ef\u4ee5\u5404\u8bb0\u4e00\u6b21\uff0c\u8f93\u51fa\u5e94\u4fdd\u7559\u533a\u95f4\u8eab\u4efd\u3002\u82e5\u60f3\u7ed9\u6574\u5957\u6355\u83b7\u9762\u677f\u62a5\u4e00\u6b21\u603b\u8bb0\u5f55\u6570\uff0c\u5c31\u5e94\u53d6\u533a\u95f4\u5e76\u96c6\uff0c\u5e76\u4fdd\u7559\u6240\u9700\u7684\u4e3b\u6b21\u8fc7\u6ee4\u6761\u4ef6\u3002\u82e5\u8fd8\u8981\u7edf\u8ba1\u4e24\u7aef\u90fd\u843d\u5728\u9762\u677f\u5185\u7684\u5b8c\u6574\u7247\u6bb5\uff0c\u4ec5\u5bf9\u67e5\u8be2\u540d\u53bb\u91cd\u4e0d\u80fd\u533a\u5206\u53e6\u4e00\u7aef\u843d\u5728\u9762\u677f\u5916\u3001\u672a\u6bd4\u5bf9\u6216\u88ab\u8fc7\u6ee4\uff0c\u8981\u56de\u5230\u6210\u5bf9\u8bb0\u5f55\u9010\u7aef\u68c0\u67e5\u3002\u547d\u4ee4\u884c\u533a\u95f4\u4f7f\u7528\u4e00\u57fa\u3001\u4e24\u7aef\u5305\u542b\u7684\u5750\u6807\uff0c\u4f7f\u7528 BED \u6587\u4ef6\u65f6\u8fd8\u8981\u6309\u5176\u96f6\u57fa\u3001\u53f3\u5f00\u683c\u5f0f\u51c6\u5907\u8fb9\u754c\uff0c\u5c24\u5176\u6ce8\u610f\u53ea\u8986\u76d6\u4e00\u4e2a\u78b1\u57fa\u7684\u63a2\u9488\u3002<\/p>\n<p>\u8de8\u6279\u6b21\u6bd4\u8f83\u524d\uff0c\u628a\u6bcf\u4e2a\u5206\u6bcd\u5199\u8fdb\u5217\u540d\u3002\u4f8b\u5982\u5206\u522b\u4fdd\u5b58\u603b\u8bb0\u5f55\u3001\u5df2\u6bd4\u5bf9\u4e3b\u8bb0\u5f55\u3001\u6392\u9664\u91cd\u590d\u540e\u7684\u4e3b\u8bb0\u5f55\uff0c\u4ee5\u53ca\u5bf9\u5e94\u7684\u4e0d\u540c\u67e5\u8be2\u540d\u6570\u3002\u518d\u7559\u4e00\u4efd\u5e26\u6709\u5168\u90e8\u6807\u5fd7\u7684\u624b\u6838\u5c0f\u6837\uff0c\u4e0d\u8981\u53ea\u4fdd\u5b58\u805a\u5408\u540e\u7684\u767e\u5206\u6bd4\u3002\u82e5\u5408\u5e76\u591a\u6761\u6cf3\u9053\u6216\u591a\u4e2a\u6837\u672c\uff0c\u5148\u6838\u67e5\u540d\u5b57\u5728\u4e0d\u540c\u8bfb\u7ec4\u4e4b\u95f4\u662f\u5426\u53ef\u80fd\u91cd\u7528\uff0c\u5fc5\u8981\u65f6\u4f7f\u7528\u8bfb\u7ec4\u548c\u540d\u5b57\u7684\u7ec4\u5408\u952e\u3002\u8fd9\u6837\u5728\u8986\u76d6\u5ea6\u7a81\u7136\u53d8\u5316\u65f6\uff0c\u53ef\u4ee5\u5148\u5b9a\u4f4d\u662f\u54ea\u4e00\u9053\u6761\u4ef6\u6539\u53d8\u4e86\u8fdb\u5165\u5206\u6790\u7684\u8bb0\u5f55\u3002<\/p>\n<p class=\"guide-end\" style=\"margin-top:1.6em;padding-top:1.0em;border-top:1px solid #d7e0e9\">\u56fa\u5b9a\u7edf\u8ba1\u53e3\u5f84\u540e\uff0c\u9700\u8981\u5728\u591a\u4e2a\u961f\u5217\u4e0a\u6279\u91cf\u6838\u5bf9\u8fd9\u4e9b\u6307\u6807\u65f6\uff0c\u53ef\u4f7f\u7528<a data-ysx-event=\"contact_click\" style=\"color:#315489;text-decoration:underline;text-underline-offset:2px\" href=\"https:\/\/www.biocloudservice.com\/wordpress\/compute-services\/shared-research-workspace\/\">\u4e91\u751f\u4fe1\u7684\u751f\u7269\u4fe1\u606f\u5206\u6790\u670d\u52a1\u5668<\/a>\u96c6\u4e2d\u5904\u7406 BAM \u4e0e\u7d22\u5f15\u6587\u4ef6\u3002<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u7528\u5341\u884c\u53ef\u624b\u7b97\u7684 SAM\/BAM \u67e5\u6e05\u67e5\u8be2\u540d\u3001\u4e3b\u6bd4\u5bf9\u3001\u914d\u5bf9\u767e\u5206\u6bd4\u53ca\u91cd\u53e0\u533a\u95f4\u8ba1\u6570\u3002<\/p>\n","protected":false},"author":1,"featured_media":70086,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[49],"tags":[294,964,965,530],"class_list":["post-70087","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-bam","tag-samtools","tag-965","tag-530"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/samtools-count-records-qname-overlapping-regions-guide.png?fit=1200%2C840&ssl=1","_links":{"self":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/70087","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/comments?post=70087"}],"version-history":[{"count":1,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/70087\/revisions"}],"predecessor-version":[{"id":70089,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/70087\/revisions\/70089"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media\/70086"}],"wp:attachment":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media?parent=70087"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/categories?post=70087"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/tags?post=70087"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}