{"id":68643,"date":"2026-12-04T09:01:21","date_gmt":"2026-12-04T01:01:21","guid":{"rendered":"https:\/\/www.biocloudservice.com\/wordpress\/?p=68643"},"modified":"2026-12-04T09:01:21","modified_gmt":"2026-12-04T01:01:21","slug":"r-guide-rsubread-practice","status":"publish","type":"post","link":"https:\/\/www.biocloudservice.com\/wordpress\/r-guide-rsubread-practice\/","title":{"rendered":"Rsubread \u7684 featureCounts \u672a\u5206\u914d\u6bd4\u4f8b\u9ad8\uff0c\u600e\u6837\u4ece\u4e00\u4efd BAM \u627e\u5230\u539f\u56e0\uff1f"},"content":{"rendered":"<div class=\"ysx-r-practice\" id=\"ysx-r-rsubread\" style=\"max-width:820px;margin:0 auto;color:#203449;font-size:17px;line-height:1.88;overflow-wrap:break-word;\">\n<p style=\"margin:.5em 0 1em\">\u7528\u540c\u4e00\u4e2a BAM \u505a featureCounts\uff0c\u4e24\u6b21\u5206\u914d\u7387\u5dee\u4e00\u5927\u622a\uff0c\u5148\u67e5\u603b\u6570\u4ee5\u8bfb\u6bb5\u8fd8\u662f\u7247\u6bb5\u8ba1\u3002\u4e4b\u540e\u6309\u672a\u5206\u914d\u7c7b\u522b\u5206\u522b\u8ffd\u8e2a\u94fe\u65b9\u5411\u3001\u6ce8\u91ca\u53ca\u91cd\u53e0\u6b67\u4e49\u3002\u4e0b\u9762\u7528\u4e09\u4e2a\u5df2\u77e5\u5750\u6807\u7684\u6bd4\u5bf9\u6784\u9020\u4e00\u4efd\u8089\u773c\u80fd\u9a8c\u7b97\u7684\u8f93\u5165\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">Rsubread \u7684\u8f93\u5165\u548c\u5206\u6790\u5bf9\u8c61<\/h2>\n<p style=\"margin:.5em 0 1em\">bam \u4e3a\u5750\u6807\u548c\u6ce8\u91ca\u76f8\u7b26\u7684\u53cc\u7aef BAM \u6587\u4ef6\uff0cgtf \u4e3a\u540c\u7ec4\u88c5\u5e26 gene_id \u7684 GTF\u3002\u793a\u4f8b strandSpecific=0 \u53ea\u9002\u7528\u4e8e\u65e0\u94fe\u7279\u5f02\u6587\u5e93\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728\u4f7f\u7528 featureCounts \u5bf9\u53cc\u7aef BAM \u6587\u4ef6\u8fdb\u884c\u57fa\u56e0\u7247\u6bb5\u8ba1\u6570\u65f6\uff0c\u82e5\u53d1\u73b0\u672a\u5206\u914d\u6bd4\u4f8b\u8fc7\u9ad8\uff0c\u9700\u8981\u4ece BAM \u6587\u4ef6\u4e2d\u67e5\u627e\u53ef\u80fd\u539f\u56e0\u3002\u8be5\u95ee\u9898\u901a\u5e38\u51fa\u73b0\u5728\u6bd4\u5bf9\u7ed3\u679c\u4e0e\u6ce8\u91ca\u6587\u4ef6\u4e0d\u4e00\u81f4\u3001\u94fe\u7279\u5f02\u6027\u8bbe\u7f6e\u9519\u8bef\u6216\u8bfb\u6bb5\u6807\u8bb0\u4e0d\u5339\u914d\u7b49\u60c5\u5f62\u3002\u8f93\u5165\u7684 BAM \u6587\u4ef6\u5e94\u4e3a\u5df2\u6839\u636e\u53c2\u8003\u57fa\u56e0\u7ec4\u5750\u6807\u6392\u5e8f\u7684\u53cc\u7aef\u6bd4\u5bf9\u7ed3\u679c\uff0c\u5176\u8bfb\u6bb5\u6807\u8bb0\u3001\u67d3\u8272\u4f53\u547d\u540d\u65b9\u5f0f\u9700\u4e0e\u6ce8\u91ca\u6587\u4ef6 GTF \u4fdd\u6301\u4e00\u81f4\u3002GTF \u6587\u4ef6\u5e94\u5305\u542b\u6807\u51c6\u7684 gene_id \u5b57\u6bb5\uff0c\u4ee5\u786e\u4fdd featureCounts \u80fd\u6b63\u786e\u8bc6\u522b\u57fa\u56e0\u533a\u57df\u3002\u8fd9\u4e9b\u8f93\u5165\u6587\u4ef6\u7684\u5339\u914d\u6027\u76f4\u63a5\u5f71\u54cd\u5206\u914d\u7ed3\u679c\u7684\u51c6\u786e\u6027\uff0c\u56e0\u6b64\u5fc5\u987b\u5728\u5206\u6790\u524d\u786e\u8ba4\u5176\u4e00\u81f4\u6027\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">featureCounts \u7684\u6838\u5fc3\u529f\u80fd\u662f\u5c06\u6bd4\u5bf9\u8bfb\u6bb5\u5206\u914d\u5230\u57fa\u56e0\u6216\u8f6c\u5f55\u672c\u533a\u57df\uff0c\u5176\u8f93\u51fa\u5305\u542b\u5206\u914d\u7edf\u8ba1\u8868\u548c\u8ba1\u6570\u77e9\u9635\u3002\u5728\u5904\u7406\u53cc\u7aef\u6570\u636e\u65f6\uff0c\u82e5\u672a\u6b63\u786e\u8bbe\u7f6e isPairedEnd \u548c countReadPairs \u53c2\u6570\uff0c\u53ef\u80fd\u5bfc\u81f4\u8bfb\u6bb5\u5206\u914d\u9519\u8bef\u3002\u4f8b\u5982\uff0c\u82e5 BAM \u6587\u4ef6\u4e3a\u53cc\u7aef\u6570\u636e\uff0c\u4f46\u8bbe\u7f6e\u4e3a\u5355\u7aef\u6a21\u5f0f\uff0c\u5c06\u5bfc\u81f4\u8bfb\u6bb5\u8ba1\u6570\u9519\u8bef\uff0c\u4ece\u800c\u5f71\u54cd\u672a\u5206\u914d\u6bd4\u4f8b\u3002\u82e5\u6587\u5e93\u6784\u5efa\u672a\u6d89\u53ca\u94fe\u7279\u5f02\u6027\uff0c\u5e94\u8bbe\u7f6e\u4e3a 0\uff0c\u4ee5\u907f\u514d\u56e0\u94fe\u65b9\u5411\u4e0d\u4e00\u81f4\u5bfc\u81f4\u7684\u5206\u914d\u5931\u8d25\u3002\u8fd9\u4e9b\u53c2\u6570\u7684\u8bbe\u7f6e\u5fc5\u987b\u4e0e\u6587\u5e93\u5b9e\u9645\u6784\u5efa\u65b9\u5f0f\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u5f15\u5165\u4eba\u4e3a\u8bef\u5dee\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5206\u914d\u7387\u7684\u8ba1\u7b97\u65b9\u5f0f\u51b3\u5b9a\u4e86\u7ed3\u679c\u7684\u89e3\u91ca\u65b9\u5411\u3002\u5728\u53cc\u7aef\u6570\u636e\u4e2d\uff0c\u4e00\u4e2a\u5b8c\u6574\u7247\u6bb5\u5305\u542b\u4e24\u4e2a\u8bfb\u6bb5\uff0c\u56e0\u6b64\u82e5\u4ee5\u7247\u6bb5\u6570\u4e3a\u5206\u6bcd\u8ba1\u7b97\u5206\u914d\u7387\uff0c\u5e94\u4f7f\u7528\u7247\u6bb5\u603b\u6570\u800c\u975e\u8bfb\u6bb5\u603b\u6570\u3002\u82e5\u8bef\u7528\u8bfb\u6bb5\u603b\u6570\u4f5c\u4e3a\u5206\u6bcd\uff0c\u5c06\u5bfc\u81f4\u5206\u914d\u7387\u88ab\u4eba\u4e3a\u51cf\u534a\u3002\u4f8b\u5982\uff0c\u82e5\u603b\u7247\u6bb5\u6570\u4e3a 100\uff0c\u5176\u4e2d 75 \u4e2a\u7247\u6bb5\u88ab\u5206\u914d\uff0c\u5206\u914d\u7387\u4e3a 75%\u3002\u82e5\u4ee5 200 \u4e2a\u8bfb\u6bb5\u4e3a\u5206\u6bcd\uff0c\u8ba1\u7b97\u51fa\u7684\u5206\u914d\u7387\u4ec5\u4e3a 37.5%\uff0c\u8fd9\u4f1a\u8bef\u5bfc\u5bf9\u94fe\u65b9\u5411\u6216\u6587\u5e93\u6c61\u67d3\u7684\u5224\u65ad\u3002\u56e0\u6b64\uff0c\u660e\u786e\u5206\u914d\u7387\u7684\u5206\u6bcd\u5b9a\u4e49\uff0c\u662f\u51c6\u786e\u89e3\u91ca featureCounts \u7ed3\u679c\u7684\u524d\u63d0\u3002\u8fd9\u79cd\u8ba1\u7b97\u65b9\u5f0f\u7684\u5dee\u5f02\u53ef\u80fd\u4f7f\u7814\u7a76\u8005\u8bef\u5224\u5b9e\u9a8c\u8d28\u91cf\uff0c\u56e0\u6b64\u5728\u5206\u6790\u524d\u5fc5\u987b\u6e05\u695a\u5176\u8ba1\u7b97\u903b\u8f91\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u7528 <code>featureCounts()<\/code> \u4f20\u5165 BAM \u4e0e\u5bf9\u5e94 GTF\uff0c\u660e\u786e\u94fe\u7279\u5f02\u6027\u3001\u5355\u7aef\u6216\u53cc\u7aef\u53ca\u662f\u5426\u6309\u7247\u6bb5\u8ba1\u6570\uff0c\u67e5\u770b\u5206\u914d\u7edf\u8ba1\u8868\u3002 <a href=\"https:\/\/bioconductor.org\/packages\/release\/bioc\/vignettes\/Rsubread\/inst\/doc\/SubreadUsersGuide.pdf\" style=\"color:#185CB7;text-decoration:underline;\">Rsubread \u5b98\u65b9\u6559\u7a0b<\/a><\/p>\n<pre style=\"white-space:pre;overflow:auto;max-width:100%;padding:14px;background:#F0F7FF;border:1px solid #D1E7FF;border-radius:8px;color:#183551;font-size:14px;line-height:1.6;box-sizing:border-box;\"><code class=\"language-r\" style=\"font-family:Consolas,monospace;white-space:pre;overflow-wrap:normal;word-break:normal;\">f &lt;- Rsubread::featureCounts(files=bam, annot.ext=gtf, isGTFAnnotationFile=TRUE, isPairedEnd=TRUE, countReadPairs=TRUE, strandSpecific=0)\nf$stat\ndim(f$counts)\n<\/code><\/pre>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u5b8c\u6574\u914d\u5bf9\u4e0b\u8bfb\u6bb5\u4e0e\u7247\u6bb5\u4e0d\u662f\u540c\u4e00\u5206\u6bcd<\/h2>\n<p style=\"margin:.5em 0 1em\">\u4e00\u767e\u4e2a\u5b8c\u6574\u53cc\u7aef\u7247\u6bb5\u5bf9\u5e94\u4e24\u767e\u4e2a\u8bfb\u6bb5\uff0c\u82e5\u4e03\u5341\u4e94\u4e2a\u7247\u6bb5\u5206\u914d\uff0c\u7247\u6bb5\u5206\u914d\u7387\u4e3a\u767e\u5206\u4e4b\u4e03\u5341\u4e94\u3002\u7528\u4e24\u767e\u4f5c\u5206\u6bcd\u4f1a\u4eba\u4e3a\u51cf\u534a\uff0c\u4e0d\u80fd\u4ece\u6b64\u63a8\u65ad\u94fe\u65b9\u5411\u9519\u8bef\u6216\u6709\u4e00\u534a\u6587\u5e93\u6c61\u67d3\u3002<\/p>\n<pre style=\"white-space:pre;overflow:auto;max-width:100%;padding:14px;background:#F0F7FF;border:1px solid #D1E7FF;border-radius:8px;color:#183551;font-size:14px;line-height:1.6;box-sizing:border-box;\"><code class=\"language-r\" style=\"font-family:Consolas,monospace;white-space:pre;overflow-wrap:normal;word-break:normal;\">v &lt;- c(100,2*100,75)\nnames(v) &lt;- c(\"\u7247\u6bb5\u603b\u6570\", \"\u8bfb\u6bb5\u603b\u6570\", \"\u5df2\u5206\u914d\u7247\u6bb5\")\nprint(v)\n<\/code><\/pre>\n<table style=\"width:100%;border-collapse:collapse;margin:1em 0;font-size:15px\">\n<thead>\n<tr>\n<th style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#ECF6FF;\">\u8f93\u5165\u6216\u6bd4\u8f83\u9879<\/th>\n<th style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#ECF6FF;\">R \u8ba1\u7b97\u7ed3\u679c<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u7247\u6bb5\u603b\u6570<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">100<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u8bfb\u6bb5\u603b\u6570<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">200<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u5df2\u5206\u914d\u7247\u6bb5<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">75<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<figure style=\"margin:1.5em 0;\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/r-guide-rsubread-practice-bb3807f8.png?resize=1120%2C690&#038;ssl=1\" alt=\"\u5b8c\u6574\u914d\u5bf9\u4e0b\u8bfb\u6bb5\u4e0e\u7247\u6bb5\u4e0d\u662f\u540c\u4e00\u5206\u6bcd\u3002\u7247\u6bb5\u603b\u6570 100\uff0c\u8bfb\u6bb5\u603b\u6570 200\uff0c\u5df2\u5206\u914d\u7247\u6bb5 75\u3002\" width=\"1120\" height=\"690\" style=\"max-width:100%;width:100%;height:auto;display:block\"><figcaption style=\"font-size:14px;color:#455970;line-height:1.6;\">\u6559\u5b66\u7b97\u4f8b\uff0c\u6570\u636e\u4e0e\u8ba1\u7b97\u5f0f\u89c1\u56fe\u4e0a\u65b9\u3002<\/figcaption><\/figure>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u628a\u672a\u5206\u914d\u7c7b\u522b\u8fd8\u539f\u5230\u540c\u4e00\u5206\u6bcd<\/h2>\n<p style=\"margin:.5em 0 1em\">\u4e09\u4e2a\u7c7b\u522b\u5408\u8ba1\u4e00\u767e\u4e2a\u7247\u6bb5\u3002\u82e5\u53e6\u4e00\u6b21\u4f7f\u7528\u4e0d\u540c\u7684\u591a\u91cd\u6bd4\u5bf9\u6216\u8ba1\u6570\u914d\u7f6e\uff0c\u5148\u6838\u5bf9\u5206\u7c7b\u89c4\u5219\u548c\u603b\u6570\u518d\u9010\u9879\u6bd4\u8f83\u3002\u65e0\u6ce8\u91ca\u91cd\u53e0\u8f83\u591a\u65f6\u5148\u67e5\u7269\u79cd\u3001\u7ec4\u88c5\u3001\u94fe\u7279\u5f02\u6027\u4e0e\u529f\u80fd\u533a\u6ce8\u91ca\uff0c\u4e0d\u8981\u4ece\u4e00\u4e2a\u767e\u5206\u6bd4\u5c31\u5224\u5b9a\u6d4b\u5e8f\u8d28\u91cf\u3002<\/p>\n<pre style=\"white-space:pre;overflow:auto;max-width:100%;padding:14px;background:#F0F7FF;border:1px solid #D1E7FF;border-radius:8px;color:#183551;font-size:14px;line-height:1.6;box-sizing:border-box;\"><code class=\"language-r\" style=\"font-family:Consolas,monospace;white-space:pre;overflow-wrap:normal;word-break:normal;\">s &lt;- c(Assigned=75,NoFeatures=15,Ambiguous=10)\nround(100*s\/sum(s),1)\n<\/code><\/pre>\n<p style=\"margin:.5em 0 1em\">\u4ee5\u4e00\u4e2a\u7b80\u5316\u7684\u4f8b\u5b50\u8bf4\u660e\u5206\u914d\u7387\u7684\u8ba1\u7b97\u65b9\u5f0f\u3002\u5047\u8bbe\u4e00\u4e2a\u53cc\u7aef\u6587\u5e93\u4e2d\uff0c\u5171\u6709 100 \u4e2a\u5b8c\u6574\u7247\u6bb5\uff0c\u6bcf\u4e2a\u7247\u6bb5\u5305\u542b\u4e24\u4e2a\u8bfb\u6bb5\uff0c\u56e0\u6b64\u603b\u8bfb\u6bb5\u6570\u4e3a 200\u3002\u82e5\u5176\u4e2d 75 \u4e2a\u7247\u6bb5\u88ab\u6210\u529f\u5206\u914d\uff0c\u90a3\u4e48\u5206\u914d\u7387\u4e3a 75%\u3002\u82e5\u4ee5\u7247\u6bb5\u6570\u4e3a\u5206\u6bcd\uff0c\u5219\u5206\u914d\u7387\u4e3a 75\/100 = 75%\u3002\u8fd9\u79cd\u5dee\u5f02\u5728\u5b9e\u9645\u5206\u6790\u4e2d\u53ef\u80fd\u9020\u6210\u8bef\u5224\u3002\u4f8b\u5982\uff0c\u82e5\u8bef\u5c06\u8bfb\u6bb5\u6570\u4f5c\u4e3a\u5206\u6bcd\uff0c\u53ef\u80fd\u9519\u8bef\u5730\u8ba4\u4e3a\u6587\u5e93\u4e2d\u6709\u4e00\u534a\u8bfb\u6bb5\u672a\u5206\u914d\uff0c\u800c\u5b9e\u9645\u4e0a\u53ea\u662f\u8ba1\u7b97\u65b9\u5f0f\u4e0d\u540c\u3002\u56e0\u6b64\uff0c\u5fc5\u987b\u660e\u786e\u5206\u914d\u7387\u7684\u5206\u6bcd\u5b9a\u4e49\uff0c\u624d\u80fd\u51c6\u786e\u89e3\u91ca\u5206\u914d\u7ed3\u679c\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728\u5b9e\u9645\u5206\u6790\u4e2d\uff0c\u5206\u914d\u7387\u7684\u9ad8\u4f4e\u4e0e\u6587\u5e93\u8d28\u91cf\u3001\u6bd4\u5bf9\u53c2\u6570\u8bbe\u7f6e\u53ca\u6ce8\u91ca\u6587\u4ef6\u5b8c\u6574\u6027\u5bc6\u5207\u76f8\u5173\u3002\u82e5\u672a\u5206\u914d\u6bd4\u4f8b\u8fc7\u9ad8\uff0c\u9700\u9996\u5148\u68c0\u67e5 BAM \u6587\u4ef6\u4e0e GTF \u6587\u4ef6\u7684\u5339\u914d\u6027\u3002\u4f8b\u5982\uff0c\u67d3\u8272\u4f53\u547d\u540d\u65b9\u5f0f\u4e0d\u4e00\u81f4\uff0c\u5982\u4e00\u4e2a\u6587\u4ef6\u4f7f\u7528 chr1\uff0c\u53e6\u4e00\u4e2a\u4f7f\u7528 1\uff0c\u5c06\u5bfc\u81f4\u8bfb\u6bb5\u65e0\u6cd5\u6b63\u786e\u5206\u914d\u3002\u6b64\u5916\uff0c\u94fe\u7279\u5f02\u6027\u53c2\u6570\u8bbe\u7f6e\u9519\u8bef\u4e5f\u4f1a\u5bfc\u81f4\u5206\u914d\u5931\u8d25\u3002\u82e5\u6587\u5e93\u6784\u5efa\u4e3a\u65e0\u94fe\u7279\u5f02\u6027\uff0c\u800c\u8bbe\u7f6e\u4e3a\u94fe\u7279\u5f02\u6027\u6a21\u5f0f\uff0c\u5c06\u5bfc\u81f4\u5927\u91cf\u8bfb\u6bb5\u88ab\u9519\u8bef\u6807\u8bb0\u4e3a\u672a\u5206\u914d\u3002\u8fd9\u4e9b\u56e0\u7d20\u7684\u7ec4\u5408\u53ef\u80fd\u4f7f\u5206\u914d\u7387\u663e\u8457\u4e0b\u964d\uff0c\u56e0\u6b64\u9700\u9010\u4e00\u6392\u67e5\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u5bf9\u624b\u5199\u7684\u4e09\u6761\u6bd4\u5bf9\u5b9e\u9645\u505a featureCounts<\/h2>\n<pre style=\"white-space:pre;overflow:auto;max-width:100%;padding:14px;background:#F0F7FF;border:1px solid #D1E7FF;border-radius:8px;color:#183551;font-size:14px;line-height:1.6;box-sizing:border-box;\"><code class=\"language-r\" style=\"font-family:Consolas,monospace;white-space:pre;overflow-wrap:normal;word-break:normal;\">sam&lt;-tempfile(fileext=\".sam\")\nseq&lt;-paste(rep(\"A\",20),collapse=\"\")\nqual&lt;-paste(rep(\"I\",20),collapse=\"\")\nwriteLines(c(\"@HD\\tVN:1.6\\tSO:coordinate\",\"@SQ\\tSN:chr1\\tLN:1000\",vapply(c(100,120,500),function(pos)paste(paste0(\"r\",pos),0,\"chr1\",pos,60,\"20M\",\"*\",0,0,seq,qual,sep=\"\\t\"),character(1))),sam)\ngtf&lt;-tempfile(fileext=\".gtf\")\nwriteLines(c('chr1\\ttest\\texon\\t90\\t160\\t.\\t+\\t.\\tgene_id \"G1\";','chr1\\ttest\\texon\\t480\\t550\\t.\\t+\\t.\\tgene_id \"G2\";'),gtf)\nz&lt;-Rsubread::featureCounts(sam,annot.ext=gtf,isGTFAnnotationFile=TRUE,strandSpecific=0)\nc(3,as.numeric(z$counts[,1]))\n<\/code><\/pre>\n<p style=\"margin:.5em 0 1em\">\u5728 R 4.5.2\u3001Rsubread 2.24.0 \u4e2d\u8fd0\u884c\uff0c\u8f93\u51fa\u4f9d\u6b21\u4e3a\u8f93\u5165\u6bd4\u5bf9 3\uff0c\u7b2c\u4e00\u57fa\u56e0 2\uff0c\u7b2c\u4e8c\u57fa\u56e0 1\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u9047\u5230\u5f02\u5e38\uff0c\u5148\u6838\u5bf9\u54ea\u4e00\u9879<\/h2>\n<p style=\"margin:.5em 0 1em\">\u5148\u7528\u4e00\u4e2a\u6587\u5e93\u68c0\u67e5 <code>Unassigned_NoFeatures<\/code>\u3001\u591a\u91cd\u6bd4\u5bf9\u548c\u6210\u5bf9\u8bfb\u6bb5\u8bbe\u7f6e\u3002\u5927\u91cf\u672a\u5206\u914d\u65f6\u6838\u5bf9\u67d3\u8272\u4f53\u547d\u540d\u548c\u6587\u5e93\u65b9\u5411\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u672a\u5206\u914d\u6bd4\u4f8b\u9ad8\u7684\u5e38\u89c1\u539f\u56e0\u4e4b\u4e00\u662f\u67d3\u8272\u4f53\u547d\u540d\u4e0d\u4e00\u81f4\u3002\u4f8b\u5982\uff0cBAM \u6587\u4ef6\u4e2d\u7684\u67d3\u8272\u4f53\u540d\u79f0\u4e3a chr1\uff0c\u800c GTF \u6587\u4ef6\u4e2d\u4e3a 1\uff0c\u8fd9\u79cd\u4e0d\u5339\u914d\u5c06\u5bfc\u81f4\u8bfb\u6bb5\u65e0\u6cd5\u6b63\u786e\u5206\u914d\u5230\u57fa\u56e0\u533a\u57df\u3002\u6392\u67e5\u65f6\u5e94\u9996\u5148\u68c0\u67e5 BAM \u6587\u4ef6\u4e0e GTF \u6587\u4ef6\u7684\u67d3\u8272\u4f53\u547d\u540d\u65b9\u5f0f\uff0c\u786e\u4fdd\u4e24\u8005\u4e00\u81f4\u3002\u82e5\u5b58\u5728\u547d\u540d\u5dee\u5f02\uff0c\u9700\u624b\u52a8\u4fee\u6539\u5176\u4e2d\u4e00\u65b9\uff0c\u4f7f\u4e24\u8005\u5339\u914d\u3002\u6b64\u5916\uff0c\u82e5 BAM \u6587\u4ef6\u4e2d\u5b58\u5728\u672a\u6bd4\u5bf9\u7684\u8bfb\u6bb5\uff0c\u4e5f\u53ef\u80fd\u88ab\u8bef\u5224\u4e3a\u672a\u5206\u914d\u3002\u56e0\u6b64\uff0c\u9700\u68c0\u67e5 BAM \u6587\u4ef6\u4e2d\u662f\u5426\u6709\u5927\u91cf\u672a\u6bd4\u5bf9\u8bfb\u6bb5\uff0c\u8fd9\u53ef\u80fd\u6e90\u4e8e\u6bd4\u5bf9\u53c2\u6570\u8bbe\u7f6e\u4e0d\u5f53\u6216\u53c2\u8003\u57fa\u56e0\u7ec4\u4e0d\u5339\u914d\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u53e6\u4e00\u79cd\u5e38\u89c1\u6545\u969c\u662f\u8bfb\u6bb5\u6807\u8bb0\u4e0d\u4e00\u81f4\u3002\u82e5 BAM \u6587\u4ef6\u4e2d\u8bfb\u6bb5\u6807\u8bb0\u4e0e featureCounts \u7684\u9884\u671f\u4e0d\u4e00\u81f4\uff0c\u5c06\u5bfc\u81f4\u8bfb\u6bb5\u65e0\u6cd5\u6b63\u786e\u5206\u914d\u3002\u4f8b\u5982\uff0c\u82e5 BAM \u6587\u4ef6\u4e2d\u8bfb\u6bb5\u6807\u8bb0\u4e3a\u5355\u7aef\uff0c\u800c\u8bbe\u7f6e\u4e3a\u53cc\u7aef\u6a21\u5f0f\uff0c\u5c06\u5bfc\u81f4\u8bfb\u6bb5\u5206\u914d\u5931\u8d25\u3002\u56e0\u6b64\uff0c\u5728\u5206\u6790\u524d\u9700\u786e\u8ba4 BAM \u6587\u4ef6\u7684\u8bfb\u6bb5\u6807\u8bb0\u65b9\u5f0f\uff0c\u5e76\u6839\u636e\u5b9e\u9645\u6570\u636e\u8bbe\u7f6e\u76f8\u5e94\u7684\u53c2\u6570\u3002\u82e5\u53d1\u73b0\u5206\u914d\u7387\u5f02\u5e38\uff0c\u5e94\u9996\u5148\u68c0\u67e5\u8bfb\u6bb5\u6807\u8bb0\u4e0e\u53c2\u6570\u8bbe\u7f6e\u7684\u4e00\u81f4\u6027\uff0c\u518d\u9010\u6b65\u6392\u67e5\u5176\u4ed6\u53ef\u80fd\u56e0\u7d20\u3002\u8fd9\u79cd\u7531\u6807\u8bb0\u4e0d\u4e00\u81f4\u5f15\u8d77\u7684\u9519\u8bef\uff0c\u5f80\u5f80\u5bb9\u6613\u88ab\u5ffd\u7565\uff0c\u4f46\u5bf9\u7ed3\u679c\u5f71\u54cd\u663e\u8457\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u5e26\u56de\u539f\u59cb\u89c2\u6d4b\u518d\u68c0\u67e5\u4e00\u6b21<\/h2>\n<p style=\"margin:.5em 0 1em\">\u6311\u4e00\u6761\u5df2\u6bd4\u5bf9\u5374\u6ca1\u8ba1\u5165\u7684\u8bfb\u6bb5\uff0c\u5728\u6d4f\u89c8\u5668\u91cc\u540c\u65f6\u663e\u793a\u5b83\u7684\u65b9\u5411\u3001\u4e24\u7aef\u4f4d\u7f6e\u548c\u6240\u7528\u6ce8\u91ca\u3002\u82e5\u8bfb\u6bb5\u843d\u5728\u5185\u542b\u5b50\uff0c\u800c\u8ba1\u6570\u5355\u4f4d\u9009\u7684\u662f\u5916\u663e\u5b50\uff0c\u6539\u53d8\u5206\u914d\u9608\u503c\u65e0\u6cd5\u8ba9\u8be5\u6761\u5bf9\u65e2\u5b9a\u6ce8\u91ca\u4f5c\u51fa\u8d21\u732e\u3002\u82e5\u662f\u53cc\u7aef\u6587\u5e93\uff0c\u8fd8\u5e94\u5148\u786e\u8ba4\u5e0c\u671b\u6570\u7247\u6bb5\u6216\u8bfb\u6bb5\uff0c\u5e76\u6838\u67e5\u6b64\u7248\u672c\u7684\u76f8\u5e94\u53c2\u6570\u3002\u7ed9\u6bcf\u4e00\u7c7b\u672a\u5206\u914d\u539f\u56e0\u7559\u51e0\u6761\u53ef\u624b\u5de5\u6838\u5bf9\u7684\u8bfb\u6bb5\u540d\uff0c\u6bd4\u53ea\u770b\u5168\u5e93\u767e\u5206\u6bd4\u66f4\u5bb9\u6613\u627e\u5230\u6574\u6279\u5171\u7528\u7684\u914d\u7f6e\u9519\u8bef\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u53d6\u7ed3\u679c\u4e2d\u6700\u51c6\u5907\u89e3\u91ca\u7684\u4e00\u884c\uff0c\u628a\u6bcf\u4e2a\u72ec\u7acb\u6837\u672c\u7684\u539f\u59cb\u89c2\u6d4b\u3001\u6240\u5728\u6761\u4ef6\u4ee5\u53ca\u80fd\u591f\u652f\u6301\u8be5\u503c\u7684\u6d4b\u91cf\u6570\u6392\u5f00\u3002\u5148\u770b\u4e00\u4e2a\u6761\u4ef6\u5185\u90e8\u7684\u53d8\u5316\u8303\u56f4\uff0c\u518d\u770b\u4e24\u4e2a\u6761\u4ef6\u7684\u4e2d\u95f4\u4f4d\u7f6e\u3002\u82e5\u5dee\u5f02\u4e3b\u8981\u7531\u4e00\u4e2a\u6837\u672c\u8d21\u732e\uff0c\u67e5\u8be5\u6837\u672c\u540c\u6279\u5176\u4ed6\u6307\u6807\u662f\u5426\u4e5f\u504f\u79fb\uff0c\u7136\u540e\u4fdd\u7559\u5168\u6837\u672c\u548c\u6709\u4f9d\u636e\u7684\u654f\u611f\u6027\u5206\u6790\u4e24\u5957\u7ed3\u679c\u3002\u4ec5\u56e0\u67d0\u4e2a\u70b9\u4e0d\u7b26\u5408\u9884\u671f\u800c\u5220\u9664\uff0c\u4f1a\u540c\u65f6\u6539\u53d8\u6548\u5e94\u4f30\u8ba1\u548c\u4e0d\u786e\u5b9a\u6027\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u4ea4\u4ed8\u8868\u91cc\u6700\u597d\u4fdd\u7559\u4f30\u8ba1\u91cf\u7684\u65b9\u5411\u4ee5\u53ca\u54ea\u4e2a\u6761\u4ef6\u4f5c\u4e3a\u53c2\u7167\u3002\u7f3a\u6d4b\u548c\u6d4b\u51fa\u4e3a\u96f6\u8981\u5206\u522b\u7f16\u7801\uff0c\u67d0\u4f4d\u53d7\u8bd5\u8005\u6ca1\u6709\u8db3\u591f\u89c2\u6d4b\u65f6\uff0c\u5e94\u80fd\u4ece\u8868\u4e0a\u770b\u51fa\u4e3a\u4ec0\u4e48\u8fd9\u4e00\u6b21\u6ca1\u6709\u6570\u503c\u3002\u5bf9\u4e8e\u540c\u4e00\u4eba\u591a\u6b21\u6d4b\u91cf\u7684\u7814\u7a76\uff0c\u6309\u53d7\u8bd5\u8005\u8fde\u7ebf\u53ef\u8ba9\u65b9\u5411\u4e00\u81f4\u6027\u76f4\u63a5\u53ef\u89c1\u3002\u628a\u8fd9\u79cd\u6837\u672c\u5c42\u68c0\u67e5\u4e0e\u6a21\u578b\u7684\u591a\u91cd\u68c0\u9a8c\u7ed3\u679c\u914d\u5408\uff0c\u80fd\u533a\u5206\u201c\u91cd\u590d\u4e2d\u65b9\u5411\u4e00\u81f4\u4f46\u8bc1\u636e\u6709\u9650\u201d\u548c\u201c\u8868\u9762\u6548\u5e94\u5f88\u5927\u5374\u7531\u5355\u4e2a\u5bf9\u8c61\u63a8\u52a8\u201d\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u4e0b\u8f7d\u4ee3\u7801\u548c\u793a\u4f8b\u6570\u636e\uff0c\u5728 Linux \u4e0a\u590d\u73b0<\/h2>\n<p style=\"margin:.5em 0 1em\"><a style=\"color:#1458a5;text-decoration:underline;\" href=\"https:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/r-practice-labs\/031-rsubread-code-a87259b8e1b086e4.zip\">\u4e0b\u8f7d\u672c\u7bc7 R \u4ee3\u7801\uff08ZIP\uff0c4.1 KiB\uff09<\/a> \u00b7 <a style=\"color:#1458a5;text-decoration:underline;\" href=\"https:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/r-practice-labs\/031-rsubread-data-e9bc88e325c2aeb1.zip\">\u4e0b\u8f7d\u914d\u5957\u793a\u4f8b\u6570\u636e\uff08ZIP\uff0c1.1 KiB\uff09<\/a><\/p>\n<p style=\"margin:.5em 0 1em\">\u5c06\u4e24\u4e2a ZIP \u89e3\u538b\u5230\u540c\u4e00\u4f4d\u7f6e\uff0c\u8fdb\u5165 <code style=\"background:#edf5fc;padding:.05em .25em;border-radius:3px;\">031-rsubread<\/code> \u76ee\u5f55\uff0c\u8fd0\u884c <code style=\"background:#edf5fc;padding:.05em .25em;border-radius:3px;\">Rscript --vanilla run.R<\/code>\u3002\u6253\u5f00 <code style=\"background:#edf5fc;padding:.05em .25em;border-radius:3px;\">results\/metrics.tsv<\/code> \u67e5\u770b\u7ed3\u679c\uff0c\u4ee3\u7801\u5305\u4e2d\u7684 <code style=\"background:#edf5fc;padding:.05em .25em;border-radius:3px;\">expected\/metrics.tsv<\/code> \u53ef\u4f9b\u9010\u884c\u6838\u5bf9\u3002\u8981\u91cd\u505a\u6587\u4e2d\u7684\u4e24\u4e2a\u6570\u503c\u7ec3\u4e60\uff0c\u53ef\u7ee7\u7eed\u8fd0\u884c <code style=\"background:#edf5fc;padding:.05em .25em;border-radius:3px;\">Rscript --vanilla checks.R<\/code>\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u672c\u6b21\u4ece\u4e0b\u8f7d\u5305\u590d\u73b0\u7684\u6b65\u9aa4\u662f\u201c\u5bf9\u624b\u5199\u7684\u4e09\u6761\u6bd4\u5bf9\u5b9e\u9645\u505a featureCounts\u201d\u3002Linux x86_64\u3001R 4.5.2\u3001Rsubread 2.24.0 \u7684\u8f93\u51fa\u4e3a\u8f93\u5165\u6bd4\u5bf9 3\uff0c\u7b2c\u4e00\u57fa\u56e0 2\uff0c\u7b2c\u4e8c\u57fa\u56e0 1\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u628a\u4e09\u6761 SAM \u6bd4\u5bf9\u7684\u53c2\u8003\u540d\u3001\u4f4d\u7f6e\u4e0e CIGAR \u6284\u5230\u7eb8\u4e0a\uff0c\u5728 GTF \u4e2d\u4e3a\u6bcf\u6761\u6807\u51fa\u53ef\u80fd\u5f52\u5c5e\u7684\u57fa\u56e0\uff0c\u7136\u540e\u4e0e counts \u9010\u9879\u6bd4\u8f83\u3002\u6539\u53d8\u5206\u94fe\u8bbe\u7f6e\u65f6\u5148\u786e\u8ba4\u5efa\u5e93\u65b9\u5411\uff0c\u518d\u770b\u54ea\u4e9b\u8bb0\u5f55\u5931\u53bb\u5f52\u5c5e\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u5b9e\u8dd1\u540e\u7684\u7ecf\u9a8c\u603b\u7ed3<\/h2>\n<p style=\"margin:.5em 0 1em\">\u5b9e\u9645\u628a\u4e09\u6761\u5df2\u77e5\u4f4d\u7f6e\u7684\u6bd4\u5bf9\u4ea4\u7ed9 featureCounts \u540e\uff0c\u4e24\u4efd\u8ba1\u6570\u843d\u5728\u7b2c\u4e00\u4e2a\u57fa\u56e0\uff0c\u4e00\u4efd\u843d\u5728\u7b2c\u4e8c\u4e2a\u3002\u8fd9\u4e2a\u5355\u7aef\u5c0f\u6587\u4ef6\u4e3a\u5b9a\u4f4d\u6ce8\u91ca\u3001\u67d3\u8272\u4f53\u548c\u8ba1\u6570\u89c4\u5219\u63d0\u4f9b\u4e86\u9633\u6027\u5bf9\u7167\uff0c\u4e0d\u80fd\u7528\u6765\u9a8c\u8bc1\u53cc\u7aef\u7247\u6bb5\u6216\u6587\u5e93\u94fe\u65b9\u5411\u3002\u6362\u771f\u5b9e BAM \u65f6\uff0c\u6bcf\u6b21\u53ea\u6539\u53d8\u4e00\u9879\u8bbe\u5b9a\u518d\u8bfb\u5206\u914d\u8868\u3002<\/p>\n<p style=\"border-top:1px solid #DAE6F2;margin-top:2em;padding-top:1em;\">\u5f53\u6570\u636e\u4e0e\u4ee3\u7801\u5df2\u7ecf\u5728\u5c0f\u89c4\u6a21\u8f93\u5165\u4e0a\u5bf9\u9f50\uff0c\u540e\u9762\u9700\u8981\u6309\u540c\u4e00\u53e3\u5f84\u5206\u6790\u6574\u6279\u9879\u76ee\u65f6\uff0c\u53ef\u4ee5\u6309\u5b9e\u9645\u4efb\u52a1\u4f7f\u7528<a href=\"https:\/\/www.biocloudservice.com\/wordpress\/compute-services\/\" style=\"color:#185CB7;text-decoration:underline;\" data-ysx-event=\"contact_click\">\u4e91\u751f\u4fe1\u751f\u7269\u4fe1\u606f\u5b66\u5206\u6790\u670d\u52a1\u5668<\/a>\u3002<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u767e\u4e2a\u5b8c\u6574\u53cc\u7aef\u7247\u6bb5\u5bf9\u5e94\u4e24\u767e\u4e2a\u8bfb\u6bb5\uff0c\u82e5\u4e03\u5341\u4e94\u4e2a\u7247\u6bb5\u5206\u914d\uff0c\u7247\u6bb5\u5206\u914d\u7387\u4e3a\u767e\u5206\u4e4b\u4e03\u5341\u4e94\u3002<\/p>\n","protected":false},"author":1,"featured_media":68642,"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":[1,72],"tags":[749,728,750],"class_list":["post-68643","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-part","category-transcriptomics","tag-rsubread","tag-r","tag-750"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/r-guide-rsubread-practice-bb3807f8.png?fit=1120%2C690&ssl=1","_links":{"self":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68643","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=68643"}],"version-history":[{"count":2,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68643\/revisions"}],"predecessor-version":[{"id":70801,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68643\/revisions\/70801"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media\/68642"}],"wp:attachment":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media?parent=68643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/categories?post=68643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/tags?post=68643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}