{"id":68641,"date":"2026-12-05T09:10:35","date_gmt":"2026-12-05T01:10:35","guid":{"rendered":"https:\/\/www.biocloudservice.com\/wordpress\/?p=68641"},"modified":"2026-12-05T09:10:35","modified_gmt":"2026-12-05T01:10:35","slug":"r-guide-motifmatchr-practice","status":"publish","type":"post","link":"https:\/\/www.biocloudservice.com\/wordpress\/r-guide-motifmatchr-practice\/","title":{"rendered":"motifmatchr \u626b\u63cf ATAC \u5cf0\uff0c\u547d\u4e2d\u4e2a\u6570\u4e0e\u547d\u4e2d\u5cf0\u6570\u6709\u4ec0\u4e48\u4e0d\u540c\uff1f"},"content":{"rendered":"<div class=\"ysx-r-practice\" id=\"ysx-r-motifmatchr\" 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\">\u4e00\u4e2a\u5cf0\u91cc\u51fa\u73b0\u4e24\u5904\u540c\u4e00 motif\uff0c\u53e6\u4e00\u4e2a\u5cf0\u53ea\u6709\u4e00\u5904\u3002\u7edf\u8ba1\u542b motif \u7684\u5cf0\u6570\uff0c\u7ed3\u679c\u662f\u4e8c\u3002\u7edf\u8ba1\u547d\u4e2d\u4f4d\u7f6e\uff0c\u7ed3\u679c\u662f\u4e09\u3002motifmatchr \u7684\u8f93\u51fa\u9009\u62e9\u53d6\u51b3\u4e8e\u4e0b\u6e38\u662f\u8981\u505a\u5cf0\u96c6\u5408\u5bcc\u96c6\uff0c\u8fd8\u662f\u8981\u8ffd\u5230\u7279\u5b9a\u78b1\u57fa\u8bbe\u8ba1\u5b9e\u9a8c\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">motifmatchr \u7684\u8f93\u5165\u548c\u5206\u6790\u5bf9\u8c61<\/h2>\n<p style=\"margin:.5em 0 1em\">pwms \u662f\u5df2\u9009 motif \u77e9\u9635\u96c6\u5408\uff0cpeaks \u662f\u6709\u6b63\u786e\u67d3\u8272\u4f53\u547d\u540d\u7684 GRanges\uff0cgenome \u4e3a\u540c\u7248\u672c\u53c2\u8003\u5e8f\u5217\u5bf9\u8c61\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">motifmatchr \u5305\u7684 matchMotifs \u51fd\u6570\u7528\u4e8e\u8bc6\u522b\u57fa\u56e0\u7ec4\u8303\u56f4\u5185\u7279\u5b9a\u8f6c\u5f55\u56e0\u5b50\u7ed3\u5408\u4f4d\u70b9\u3002\u8fd9\u4e9b\u8f93\u5165\u5171\u540c\u6784\u6210\u5206\u6790\u7684\u57fa\u7840\u6846\u67b6\u3002motif \u6743\u91cd\u77e9\u9635\u901a\u5e38\u6765\u81ea\u6570\u636e\u5e93\uff0c\u4ee3\u8868\u7279\u5b9a\u8f6c\u5f55\u56e0\u5b50\u7684\u7ed3\u5408\u504f\u597d\u3002\u5cf0\u533a\u95f4\u662f ATAC-seq \u6570\u636e\u4e2d\u5bcc\u96c6\u7684\u5f00\u653e\u67d3\u8272\u8d28\u533a\u57df\uff0c\u5176\u67d3\u8272\u4f53\u547d\u540d\u9700\u4e0e\u53c2\u8003\u57fa\u56e0\u7ec4\u4e00\u81f4\u3002\u53c2\u8003\u57fa\u56e0\u7ec4\u5219\u63d0\u4f9b\u78b1\u57fa\u5e8f\u5217\u80cc\u666f\uff0c\u7528\u4e8e\u8ba1\u7b97\u5339\u914d\u5f97\u5206\u3002\u8fd9\u4e9b\u8f93\u5165\u5728\u5206\u6790\u524d\u5fc5\u987b\u4fdd\u6301\u4e00\u81f4\u6027\u548c\u51c6\u786e\u6027\uff0c\u4ee5\u786e\u4fdd\u7ed3\u679c\u7684\u53ef\u6bd4\u6027\u3002\u4efb\u4f55\u8f93\u5165\u4e0d\u4e00\u81f4\u90fd\u53ef\u80fd\u5bfc\u81f4\u5339\u914d\u9519\u8bef\u6216\u65e0\u6cd5\u8bc6\u522b\u76ee\u6807 motif\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u51fd\u6570\u7684\u8f93\u51fa\u5bf9\u8c61\u662f SummarizedExperiment \u7c7b\u578b\uff0c\u5305\u542b\u591a\u4e2a assay\uff0c\u5176\u4e2d motifMatches \u662f\u6838\u5fc3\u8f93\u51fa\u77e9\u9635\u3002\u8be5\u77e9\u9635\u7684\u884c\u5bf9\u5e94\u8f93\u5165\u7684\u5cf0\u533a\u95f4\uff0c\u5217\u5bf9\u5e94\u6bcf\u4e2a motif\u3002\u77e9\u9635\u4e2d\u6bcf\u4e2a\u5143\u7d20\u8868\u793a\u8be5\u5cf0\u662f\u5426\u547d\u4e2d\u67d0\u4e2a motif\uff0c\u4f46\u4e0d\u8868\u793a\u547d\u4e2d\u4f4d\u7f6e\u3002\u8fd9\u79cd\u8bbe\u8ba1\u4f7f\u5f97\u5206\u6790\u8fc7\u7a0b\u53ef\u4ee5\u805a\u7126\u4e8e\u5cf0\u7684\u547d\u4e2d\u4e0e\u5426\uff0c\u800c\u65e0\u9700\u8003\u8651\u5177\u4f53\u78b1\u57fa\u4f4d\u7f6e\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u8fd9\u79cd\u4e8c\u5143\u5224\u65ad\u80fd\u591f\u5feb\u901f\u7b5b\u9009\u51fa\u53ef\u80fd\u7684\u7ed3\u5408\u4f4d\u70b9\u3002\u82e5\u9700\u8fdb\u4e00\u6b65\u5b9a\u4f4d\u7ed3\u5408\u4f4d\u70b9\uff0c\u53ef\u4f7f\u7528 out \u53c2\u6570\u8bbe\u4e3a &#8220;scores&#8221;\uff0c\u4ee5\u83b7\u53d6\u66f4\u8be6\u7ec6\u7684\u5339\u914d\u4fe1\u606f\u3002\u8fd9\u79cd\u8bbe\u8ba1\u5141\u8bb8\u7528\u6237\u6839\u636e\u9700\u6c42\u7075\u6d3b\u9009\u62e9\u5206\u6790\u7c92\u5ea6\uff0c\u4ece\u800c\u517c\u987e\u6548\u7387\u4e0e\u7cbe\u5ea6\u3002\u5206\u6790\u8fc7\u7a0b\u4e2d\uff0cmotif \u4e0e\u5cf0\u7684\u5339\u914d\u662f\u57fa\u4e8e\u80cc\u666f\u78b1\u57fa\u9891\u7387\u548c\u9608\u503c\u8bbe\u5b9a\u8fdb\u884c\u7684\uff0c\u8fd9\u4e9b\u53c2\u6570\u7684\u8bbe\u5b9a\u76f4\u63a5\u5f71\u54cd\u5339\u914d\u7ed3\u679c\u7684\u53ef\u9760\u6027\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728\u5904\u7406\u91cd\u590d\u547d\u4e2d\u540c\u4e00\u5cf0\u7684\u60c5\u51b5\u65f6\uff0c\u9700\u8981\u533a\u5206\u547d\u4e2d\u4e2a\u6570\u4e0e\u547d\u4e2d\u5cf0\u6570\u3002\u5f53\u4e00\u4e2a\u5cf0\u5185\u5b58\u5728\u591a\u4e2a motif \u4f4d\u70b9\uff0c\u6216\u591a\u4e2a motif \u540c\u65f6\u547d\u4e2d\u540c\u4e00\u5cf0\u65f6\uff0c\u8fd9\u79cd\u91cd\u590d\u547d\u4e2d\u4f1a\u663e\u8457\u5f71\u54cd\u7edf\u8ba1\u5206\u6790\u7684\u7ed3\u679c\u3002\u4f8b\u5982\uff0c\u4e00\u4e2a\u5cf0\u53ef\u80fd\u540c\u65f6\u547d\u4e2d\u4e24\u4e2a\u4e0d\u540c\u7684 motif\uff0c\u4f46\u8fd9\u4e24\u4e2a motif \u5c5e\u4e8e\u540c\u4e00\u5bb6\u65cf\uff0c\u5176\u7ed3\u5408\u504f\u597d\u76f8\u4f3c\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u82e5\u4ec5\u7edf\u8ba1\u547d\u4e2d\u5cf0\u6570\uff0c\u4f1a\u4f4e\u4f30\u5b9e\u9645\u7684\u7ed3\u5408\u4e8b\u4ef6\u3002\u800c\u7edf\u8ba1\u547d\u4e2d\u4e2a\u6570\u5219\u53ef\u4ee5\u53cd\u6620\u51fa\u6240\u6709\u5339\u914d\u4e8b\u4ef6\u7684\u603b\u548c\uff0c\u5305\u62ec\u91cd\u590d\u5339\u914d\u3002\u56e0\u6b64\uff0c\u7406\u89e3\u5339\u914d\u77e9\u9635\u7684\u7ed3\u6784\u548c\u7edf\u8ba1\u65b9\u5f0f\uff0c\u662f\u6b63\u786e\u89e3\u91ca\u5206\u6790\u7ed3\u679c\u7684\u524d\u63d0\u3002motifmatchr \u5305\u5728\u8bbe\u8ba1\u4e0a\u652f\u6301\u540c\u65f6\u8f93\u51fa\u547d\u4e2d\u77e9\u9635\u548c\u4f4d\u7f6e\u4fe1\u606f\uff0c\u4e3a\u7528\u6237\u63d0\u4f9b\u4e86\u7075\u6d3b\u7684\u5206\u6790\u9009\u9879\u3002\u8fd9\u79cd\u8bbe\u8ba1\u4f7f\u5f97\u7528\u6237\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u7814\u7a76\u95ee\u9898\u9009\u62e9\u5408\u9002\u7684\u5206\u6790\u7b56\u7565\uff0c\u907f\u514d\u56e0\u7edf\u8ba1\u65b9\u5f0f\u4e0d\u540c\u800c\u4ea7\u751f\u7684\u8bef\u5224\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">motifMatches \u51fd\u6570\u8fd4\u56de\u7684\u77e9\u9635\u662f\u7a00\u758f\u77e9\u9635\uff0c\u5176\u7ed3\u6784\u53cd\u6620\u4e86\u6bcf\u4e2a\u5cf0\u4e0e motif \u7684\u5339\u914d\u5173\u7cfb\u3002\u77e9\u9635\u7684\u884c\u8868\u793a\u8f93\u5165\u7684\u5cf0\u533a\u95f4\uff0c\u5217\u8868\u793a\u6bcf\u4e2a motif \u7684\u5339\u914d\u60c5\u51b5\u3002\u77e9\u9635\u4e2d\u6bcf\u4e2a\u5143\u7d20\u4e3a TRUE \u6216 FALSE\uff0c\u8868\u793a\u8be5\u5cf0\u662f\u5426\u547d\u4e2d\u5bf9\u5e94 motif\u3002\u8fd9\u79cd\u4e8c\u5143\u8868\u793a\u65b9\u5f0f\u4f7f\u5f97\u5206\u6790\u7ed3\u679c\u6e05\u6670\u660e\u4e86\uff0c\u4fbf\u4e8e\u5feb\u901f\u8bc6\u522b\u663e\u8457\u5339\u914d\u4e8b\u4ef6\u3002\u5728\u5b9e\u9645\u5206\u6790\u4e2d\uff0c\u7528\u6237\u53ef\u901a\u8fc7 colSums \u51fd\u6570\u7edf\u8ba1\u6bcf\u4e2a motif \u7684\u547d\u4e2d\u5cf0\u6570\u3002\u8be5\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u5411\u91cf\uff0c\u8868\u793a\u6bcf\u4e2a motif \u547d\u4e2d\u7684\u5cf0\u6570\u3002\u8fd9\u79cd\u7edf\u8ba1\u65b9\u5f0f\u5bf9\u4e8e\u8bc4\u4f30 motif \u7684\u6574\u4f53\u7ed3\u5408\u80fd\u529b\u975e\u5e38\u6709\u7528\u3002\u4f8b\u5982\uff0c\u82e5\u67d0 motif \u547d\u4e2d\u591a\u4e2a\u5cf0\uff0c\u8bf4\u660e\u5176\u5728\u8be5\u6837\u672c\u4e2d\u5177\u6709\u8f83\u5f3a\u7684\u7ed3\u5408\u6d3b\u6027\u3002\u8fd9\u79cd\u7edf\u8ba1\u65b9\u5f0f\u53ef\u4ee5\u7528\u4e8e\u540e\u7eed\u7684\u5bcc\u96c6\u5206\u6790\uff0c\u5982 GO \u5206\u6790\u6216 ChIP-seq \u7ed3\u5408\u5206\u6790\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u628a motif \u6743\u91cd\u77e9\u9635\u3001\u5cf0\u533a\u95f4\u548c\u5bf9\u5e94\u53c2\u8003\u57fa\u56e0\u7ec4\u4f20\u7ed9 <code>matchMotifs()<\/code>\u3002\u505a\u4e0b\u6e38\u5bcc\u96c6\u53ef\u7528 <code>motifMatches()<\/code> \u53d6\u547d\u4e2d\u77e9\u9635\uff0c\u5b9a\u4f4d\u78b1\u57fa\u65f6\u518d\u53d6\u4f4d\u7f6e\u3002 <a href=\"https:\/\/bioconductor.org\/packages\/release\/bioc\/vignettes\/motifmatchr\/inst\/doc\/motifmatchr.html\" style=\"color:#185CB7;text-decoration:underline;\">motifmatchr \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;\">m &lt;- motifmatchr::matchMotifs(pwms, peaks, genome=genome, out=\"matches\")\nhit &lt;- motifmatchr::motifMatches(m)\nMatrix::colSums(hit)\n<\/code><\/pre>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u91cd\u590d\u547d\u4e2d\u540c\u4e00\u5cf0\u65f6\u7684\u4e09\u79cd\u8ba1\u6570<\/h2>\n<p style=\"margin:.5em 0 1em\">\u4e09\u5cf0\u5206\u522b\u542b\u4e8c\u3001\u96f6\u3001\u4e00\u5904\u540c\u4e00 motif\uff0c\u4e8c\u5143\u8f93\u51fa\u6709\u4e24\u4e2a\u9633\u6027\u5cf0\uff0c\u4f4d\u7f6e\u603b\u6570\u4e3a\u4e09\u3002\u547d\u4e2d\u4e0d\u6307\u793a\u86cb\u767d\u5b9e\u9645\u5360\u4f4d\u3002\u6bd4\u8f83\u5bb6\u65cf\u6210\u5458\u65f6\u8bf4\u660e\u5e8f\u5217\u5bf9\u5b83\u4eec\u662f\u5426\u6709\u533a\u5206\u5ea6\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(length(c(2,0,1)),sum(c(2,0,1)&gt;0),sum(c(2,0,1)))\nnames(v) &lt;- c(\"\u5cf0\u7684\u603b\u6570\", \"\u6709\u547d\u4e2d\u7684\u5cf0\", \"\u5168\u90e8\u547d\u4e2d\u4f4d\u7f6e\")\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;\">\u5cf0\u7684\u603b\u6570<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">3<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u6709\u547d\u4e2d\u7684\u5cf0<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">2<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u5168\u90e8\u547d\u4e2d\u4f4d\u7f6e<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">3<\/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-motifmatchr-practice-45515723.png?resize=1120%2C690&#038;ssl=1\" alt=\"\u91cd\u590d\u547d\u4e2d\u540c\u4e00\u5cf0\u65f6\u7684\u4e09\u79cd\u8ba1\u6570\u3002\u5cf0\u7684\u603b\u6570 3\uff0c\u6709\u547d\u4e2d\u7684\u5cf0 2\uff0c\u5168\u90e8\u547d\u4e2d\u4f4d\u7f6e 3\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;\">\u5cf0\u9009\u62e9\u4f1a\u600e\u6837\u6539\u53d8\u547d\u4e2d\u7387\uff1f<\/h2>\n<p style=\"margin:.5em 0 1em\">\u56db\u4e2a\u5cf0\u4e2d\u4e24\u4e2a\u547d\u4e2d\uff0c\u82e5\u53ea\u7559\u524d\u4e24\u4e2a\u5cf0\u547d\u4e2d\u7387\u5c31\u4ece\u4e00\u534a\u53d8\u6210\u5168\u90e8\u3002\u6781\u7aef\u4f8b\u5b50\u8bf4\u660e\u80cc\u666f\u5fc5\u987b\u53cd\u6620\u8fdb\u5165\u6bd4\u8f83\u7684\u5cf0\u3002\u76ee\u6807\u96c6\u4e0e\u80cc\u666f\u5e94\u6838\u5bf9\u957f\u5ea6\u3001\u78b1\u57fa\u7ec4\u6210\u548c\u53ef\u53ca\u6027\uff0c\u5bb6\u65cf motif \u8fd8\u9700\u8003\u8651\u5e8f\u5217\u76f8\u4f3c\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;\">hit &lt;- c(TRUE,TRUE,FALSE,FALSE)\nc(all=mean(hit),subset=mean(hit[1:2]))\n<\/code><\/pre>\n<p style=\"margin:.5em 0 1em\">\u8be5\u6a21\u5f0f\u4e0b\u8fd4\u56de\u7684 SummarizedExperiment \u5bf9\u8c61\u5305\u542b\u591a\u4e2a assay\uff0c\u5176\u4e2d motifMatches \u4ecd\u7136\u662f\u7a00\u758f\u77e9\u9635\uff0c\u4f46\u989d\u5916\u5305\u542b motifScores \u548c motifCounts\u3002motifScores \u63d0\u4f9b\u4e86\u6bcf\u4e2a\u5cf0\u4e0e motif \u7684\u5339\u914d\u5f97\u5206\uff0c\u800c motifCounts \u5219\u63d0\u4f9b\u4e86\u5339\u914d\u4f4d\u7f6e\u7684\u8ba1\u6570\u3002\u8fd9\u79cd\u8bbe\u8ba1\u4f7f\u5f97\u7528\u6237\u53ef\u4ee5\u540c\u65f6\u83b7\u5f97\u5339\u914d\u7684\u4e8c\u5143\u4fe1\u606f\u548c\u8be6\u7ec6\u7684\u4f4d\u7f6e\u4fe1\u606f\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u8fd9\u79cd\u4fe1\u606f\u53ef\u7528\u4e8e\u5206\u6790 motif \u7684\u7ed3\u5408\u5f3a\u5ea6\u548c\u4f4d\u7f6e\u5206\u5e03\u3002\u4f8b\u5982\uff0c\u82e5\u67d0 motif \u5728\u591a\u4e2a\u5cf0\u4e2d\u5177\u6709\u9ad8\u5f97\u5206\uff0c\u8bf4\u660e\u5176\u5728\u8fd9\u4e9b\u5cf0\u4e2d\u5177\u6709\u5f3a\u7ed3\u5408\u80fd\u529b\u3002\u8fd9\u79cd\u5206\u6790\u65b9\u5f0f\u5bf9\u4e8e\u7406\u89e3 motif \u7684\u529f\u80fd\u548c\u8c03\u63a7\u673a\u5236\u975e\u5e38\u6709\u5e2e\u52a9\u3002\u901a\u8fc7\u7efc\u5408\u5206\u6790\u5339\u914d\u77e9\u9635\u548c\u4f4d\u7f6e\u4fe1\u606f\uff0c\u7528\u6237\u53ef\u4ee5\u66f4\u5168\u9762\u5730\u7406\u89e3\u8f6c\u5f55\u8c03\u63a7\u7684\u590d\u6742\u6027\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728\u7ed9\u5b9a\u7684\u793a\u4f8b\u4e2d\uff0c\u4e09\u4e2a\u5cf0\u5206\u522b\u547d\u4e2d\u4e0d\u540c\u6570\u91cf\u7684 motif\u3002\u7b2c\u4e00\u4e2a\u5cf0\u547d\u4e2d\u4e24\u4e2a motif\uff0c\u7b2c\u4e8c\u4e2a\u5cf0\u672a\u547d\u4e2d\u4efb\u4f55 motif\uff0c\u7b2c\u4e09\u4e2a\u5cf0\u547d\u4e2d\u4e00\u4e2a motif\u3002\u8fd9\u79cd\u7ed3\u6784\u6e05\u6670\u5730\u5c55\u793a\u4e86\u5339\u914d\u77e9\u9635\u7684\u8f93\u51fa\u903b\u8f91\u3002\u5728\u5b9e\u9645\u5206\u6790\u4e2d\uff0c\u8fd9\u79cd\u7ed3\u6784\u4f7f\u5f97\u7528\u6237\u53ef\u4ee5\u5feb\u901f\u8bc6\u522b\u51fa\u5177\u6709\u663e\u8457\u7ed3\u5408\u6d3b\u6027\u7684\u5cf0\u548c motif\u3002\u8fd9\u79cd\u5206\u6790\u65b9\u5f0f\u5bf9\u4e8e\u7b5b\u9009\u5173\u952e\u8c03\u63a7\u56e0\u5b50\u975e\u5e38\u6709\u7528\u3002\u5728\u5904\u7406\u91cd\u590d\u547d\u4e2d\u65f6\uff0c\u8fd9\u79cd\u7ed3\u6784\u4f1a\u663e\u793a\u591a\u4e2a TRUE \u503c\uff0c\u53cd\u6620\u8be5\u5cf0\u540c\u65f6\u547d\u4e2d\u591a\u4e2a motif\u3002\u8fd9\u79cd\u8bbe\u8ba1\u4f7f\u5f97\u7528\u6237\u53ef\u4ee5\u540c\u65f6\u5173\u6ce8\u5cf0\u7684\u547d\u4e2d\u60c5\u51b5\u548c motif \u7684\u547d\u4e2d\u6570\u91cf\uff0c\u4ece\u800c\u66f4\u5168\u9762\u5730\u7406\u89e3\u8c03\u63a7\u7f51\u7edc\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u7528\u7ed9\u5b9a DNA \u548c\u4eba\u5de5 PWM \u5b9e\u9645\u5339\u914d motif<\/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;\">seqs&lt;-Biostrings::DNAStringSet(c(\"ACGTACGTACGT\",\"TTTTTTTTTTTT\"))\nm&lt;-matrix(.01,4,4,dimnames=list(c(\"A\",\"C\",\"G\",\"T\"),NULL))\ndiag(m)&lt;-.97\npwm&lt;-TFBSTools::PWMatrix(profileMatrix=log2(m\/.25))\nhit&lt;-motifmatchr::matchMotifs(pwm,seqs,bg=rep(.25,4),p.cutoff=.01)\nh&lt;-motifmatchr::motifMatches(hit)\nc(nrow(h),sum(h[,1]),ncol(h))\n<\/code><\/pre>\n<p style=\"margin:.5em 0 1em\">\u5728 R 4.5.2\u3001motifmatchr 1.32.0 \u4e2d\u8fd0\u884c\uff0c\u8f93\u51fa\u4f9d\u6b21\u4e3a\u5e8f\u5217\u6570 2\uff0c\u6709\u547d\u4e2d\u7684\u5e8f\u5217\u6570 1\uff0c\u6743\u91cd\u77e9\u9635\u6570 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\u7edf\u4e00\u53c2\u8003\u7ec4\u88c5\u548c\u80cc\u666f\u78b1\u57fa\u9891\u7387\u3002\u76f8\u4f3c motif \u53ef\u80fd\u540c\u65f6\u547d\u4e2d\uff0c\u5e94\u4fdd\u7559 motif \u5bb6\u65cf\u53ca\u7248\u672c\u4fe1\u606f\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u82e5\u9608\u503c\u8bbe\u5b9a\u8fc7\u9ad8\uff0c\u53ef\u80fd\u5bfc\u81f4\u90e8\u5206\u771f\u5b9e\u7ed3\u5408\u4f4d\u70b9\u672a\u88ab\u8bc6\u522b\u3002\u82e5\u9608\u503c\u8bbe\u5b9a\u8fc7\u4f4e\uff0c\u53ef\u80fd\u5bfc\u81f4\u5927\u91cf\u5047\u9633\u6027\u7ed3\u679c\u3002\u901a\u8fc7\u8c03\u6574\u9608\u503c\u53c2\u6570\uff0c\u53ef\u4ee5\u8bc4\u4f30\u4e0d\u540c\u8bbe\u5b9a\u5bf9\u5339\u914d\u7ed3\u679c\u7684\u5f71\u54cd\u3002\u4f8b\u5982\uff0c\u82e5\u67d0 motif \u5728\u4f4e\u9608\u503c\u4e0b\u547d\u4e2d\u591a\u4e2a\u5cf0\uff0c\u800c\u5728\u9ad8\u9608\u503c\u4e0b\u4ec5\u547d\u4e2d\u4e00\u4e2a\u5cf0\uff0c\u8bf4\u660e\u8be5 motif \u7684\u7ed3\u5408\u5f3a\u5ea6\u5728\u4e0d\u540c\u6761\u4ef6\u4e0b\u5b58\u5728\u5dee\u5f02\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u5982\u4f55\u7528\u81ea\u5df1\u7684\u6570\u636e\u590d\u6838<\/h2>\n<p style=\"margin:.5em 0 1em\">\u7528\u4e00\u6bb5\u957f\u5ea6\u548c\u65b9\u5411\u660e\u786e\u7684\u4eba\u5de5\u5e8f\u5217\u505a\u6b63\u5bf9\u7167\uff0c\u628a motif \u653e\u5728\u5df2\u77e5\u4f4d\u7f6e\uff0c\u518d\u653e\u5165\u4e00\u4e2a\u5355\u78b1\u57fa\u6539\u53d8\u7684\u8fd1\u4f3c\u5e8f\u5217\u3002\u5728\u540c\u4e00\u5339\u914d\u9608\u503c\u4e0e\u80cc\u666f\u78b1\u57fa\u9891\u7387\u4e0b\uff0c\u5206\u522b\u6838\u5bf9\u662f\u5426\u547d\u4e2d\u3001\u547d\u4e2d\u4e86\u51e0\u6b21\u3001\u4f4d\u4e8e\u54ea\u6761\u94fe\u3002\u4e00\u4e2a\u5cf0\u91cc\u51fa\u73b0\u4e09\u6b21\u4e0e\u4e09\u4e2a\u5cf0\u5404\u51fa\u73b0\u4e00\u6b21\uff0c\u4f1a\u4f7f\u4e0d\u540c\u7684\u6c47\u603b\u91cf\u53d1\u751f\u53d8\u5316\u3002\u628a\u77e9\u9635\u7684\u884c\u540d\u5148\u63a5\u56de\u5cf0\u8868\u518d\u5bfc\u51fa\uff0c\u907f\u514d\u6392\u5e8f\u6216\u53bb\u91cd\u4e4b\u540e\u628a\u540c\u4e00\u4e2a\u5cf0\u7684\u591a\u4e2a\u4f4d\u7f6e\u4e32\u5230\u522b\u7684\u533a\u95f4\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u628a\u5019\u9009\u533a\u57df\u7684\u539f\u59cb\u6807\u8bc6\u3001\u53c2\u8003\u7248\u672c\u3001\u8d77\u70b9\u548c\u7ec8\u70b9\u5199\u5728\u540c\u4e00\u884c\uff0c\u518d\u4ece\u4e00\u4e2a\u5177\u4f53\u5bf9\u8c61\u53cd\u67e5\u5b83\u5982\u4f55\u843d\u8fdb\u8be5\u533a\u57df\u3002\u82e5\u9700\u8981\u8f6c\u6362\u540d\u79f0\u6216\u5750\u6807\uff0c\u4fdd\u7559\u8f6c\u6362\u524d\u540e\u4e24\u4e2a\u503c\u4ee5\u53ca\u65e0\u6cd5\u5339\u914d\u7684\u6761\u76ee\u3002\u591a\u4e2a\u5bf9\u8c61\u5408\u5728\u4e00\u8d77\u4ee5\u540e\uff0c\u540d\u5b57\u76f8\u540c\u4e0d\u4ee3\u8868\u6765\u81ea\u540c\u4e00\u6ce8\u91ca\u7248\u672c\u3002\u6700\u7701\u4e8b\u7684\u9a8c\u7b97\u662f\u540c\u65f6\u67e5\u4e00\u6761\u660e\u786e\u5e94\u5f53\u547d\u4e2d\u7684\u8bb0\u5f55\u548c\u4e00\u6761\u6070\u5728\u8fb9\u754c\u5916\u7684\u8bb0\u5f55\uff0c\u540e\u8005\u80fd\u53d1\u73b0\u5355\u9760\u9633\u6027\u4f8b\u5b50\u770b\u4e0d\u51fa\u7684\u7aef\u70b9\u9519\u8bef\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5bf9\u4e8e\u7ed3\u679c\u8868\u7684\u4e00\u884c\uff0c\u518d\u95ee\u5b83\u80fd\u4e0d\u80fd\u56de\u5230\u539f\u59cb\u8bb0\u5f55\u3002\u82e5\u4e00\u884c\u4ee3\u8868\u805a\u5408\u540e\u7684\u533a\u57df\uff0c\u8981\u8ba9\u8bfb\u8005\u67e5\u5f97\u5230\u6709\u54ea\u4e9b\u6210\u5458\u88ab\u5408\u5e76\uff0c\u91cd\u590d\u6620\u5c04\u7684\u6210\u5458\u6309\u4ec0\u4e48\u89c4\u5219\u8ba1\u7b97\u3002\u82e5\u6362\u7528\u53e6\u4e00\u4e2a\u6ce8\u91ca\u7248\u672c\uff0c\u5148\u5217\u51fa\u6d88\u5931\u3001\u65b0\u589e\u548c\u8eab\u4efd\u53ef\u5bf9\u5e94\u7684\u533a\u57df\uff0c\u533a\u57df\u8eab\u4efd\u4e0d\u540c\u7684\u884c\u4e0d\u8981\u53ea\u6309\u6392\u5e8f\u53f7\u6a2a\u5411\u62fc\u5728\u4e00\u8d77\u3002\u8fd9\u6837\u5373\u4f7f\u6700\u7ec8\u6570\u5b57\u4e0d\u540c\uff0c\u4e5f\u80fd\u786e\u5b9a\u662f\u5019\u9009\u8303\u56f4\u53d8\u4e86\uff0c\u8fd8\u662f\u540c\u4e00\u8303\u56f4\u5185\u7684\u6d4b\u91cf\u786e\u5b9e\u4e0d\u540c\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\/030-motifmatchr-code-1caf10d4f78dc14f.zip\">\u4e0b\u8f7d\u672c\u7bc7 R \u4ee3\u7801\uff08ZIP\uff0c4.7 KiB\uff09<\/a> \u00b7 <a style=\"color:#1458a5;text-decoration:underline;\" href=\"https:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/r-practice-labs\/030-motifmatchr-data-246c1cfacb9efe23.zip\">\u4e0b\u8f7d\u914d\u5957\u793a\u4f8b\u6570\u636e\uff08ZIP\uff0c1.3 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;\">030-motifmatchr<\/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\u7528\u7ed9\u5b9a DNA \u548c\u4eba\u5de5 PWM \u5b9e\u9645\u5339\u914d motif\u201d\u3002Linux x86_64\u3001R 4.5.2\u3001motifmatchr 1.32.0 \u7684\u8f93\u51fa\u4e3a\u5e8f\u5217\u6570 2\uff0c\u6709\u547d\u4e2d\u7684\u5e8f\u5217\u6570 1\uff0c\u6743\u91cd\u77e9\u9635\u6570 1\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u56fa\u5b9a PWM \u548c\u80cc\u666f\u78b1\u57fa\u9891\u7387\uff0c\u4ec5\u6539\u53d8\u4e00\u6761\u5e8f\u5217\u7684\u4e00\u4e2a\u78b1\u57fa\uff0c\u7136\u540e\u5728\u76f8\u540c\u9608\u503c\u4e0b\u91cd\u8dd1\u3002\u547d\u4e2d\u8868\u4e2d\u7684 TRUE \u8868\u793a\u6ee1\u8db3\u6b64\u6b21\u5e8f\u5217\u5339\u914d\u6761\u4ef6\u3002\u8ba8\u8bba\u5b9e\u9645\u7ed3\u5408\u8fd8\u5e94\u8865\u8db3\u5bf9\u5e94\u7ec6\u80de\u7c7b\u578b\u7684\u67d3\u8272\u8d28\u8bc1\u636e\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\">\u4eba\u5de5\u6743\u91cd\u77e9\u9635\u5728\u4e24\u4e2a\u77ed\u5e8f\u5217\u4e2d\u53ea\u547d\u4e2d\u4e00\u4e2a\uff0c\u8fd9\u4e2a\u7ed3\u679c\u53ef\u56de\u5230\u56db\u4e2a\u78b1\u57fa\u7684 motif \u9010\u4f4d\u6838\u5bf9\u3002\u5f53\u4e0b\u6e38\u53ea\u95ee\u591a\u5c11\u4e2a\u5cf0\u542b\u6b64\u6a21\u5f0f\uff0c\u4f7f\u7528\u5e03\u5c14\u77e9\u9635\u8db3\u591f\u3002\u9700\u8981\u8bbe\u8ba1\u7a81\u53d8\u6216\u5b9a\u4f4d\u78b1\u57fa\u65f6\uff0c\u518d\u53d6\u5177\u4f53\u4f4d\u7f6e\u5e76\u663e\u5f0f\u8bb0\u5f55\u65b9\u5411\u548c\u80cc\u666f\u9891\u7387\u3002<\/p>\n<p style=\"border-top:1px solid #DAE6F2;margin-top:2em;padding-top:1em;\">\u5b8c\u6210\u4e00\u4e2a\u4ee3\u8868\u6837\u672c\u7684\u590d\u6838\u540e\uff0c\u82e5\u8981\u5bf9\u66f4\u591a\u6587\u5e93\u91cd\u590d\u76f8\u540c\u7684\u5904\u7406\uff0c\u53ef\u628a\u6837\u672c\u6e05\u5355\u3001\u53c2\u6570\u548c\u8f93\u51fa\u8def\u5f84\u4e00\u8d77\u8fc1\u5230<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>\u4e0a\u6309\u6279\u6b21\u8fd0\u884c\u3002<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4e09\u5cf0\u5206\u522b\u542b\u4e8c\u3001\u96f6\u3001\u4e00\u5904\u540c\u4e00 motif\uff0c\u4e8c\u5143\u8f93\u51fa\u6709\u4e24\u4e2a\u9633\u6027\u5cf0\uff0c\u4f4d\u7f6e\u603b\u6570\u4e3a\u4e09\u3002<\/p>\n","protected":false},"author":1,"featured_media":68640,"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,71],"tags":[748,728,741],"class_list":["post-68641","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-part","category-single-cell","tag-motifmatchr","tag-r","tag-741"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/r-guide-motifmatchr-practice-45515723.png?fit=1120%2C690&ssl=1","_links":{"self":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68641","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=68641"}],"version-history":[{"count":3,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68641\/revisions"}],"predecessor-version":[{"id":70914,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68641\/revisions\/70914"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media\/68640"}],"wp:attachment":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media?parent=68641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/categories?post=68641"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/tags?post=68641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}