{"id":68790,"date":"2026-12-05T09:10:36","date_gmt":"2026-12-05T01:10:36","guid":{"rendered":"https:\/\/www.biocloudservice.com\/wordpress\/?p=68790"},"modified":"2026-12-05T09:10:36","modified_gmt":"2026-12-05T01:10:36","slug":"r-guide-xcms-practice","status":"publish","type":"post","link":"https:\/\/www.biocloudservice.com\/wordpress\/r-guide-xcms-practice\/","title":{"rendered":"xcms \u4fdd\u7559\u65f6\u95f4\u6821\u6b63\u540e\u5cf0\u5bf9\u9f50\u4e86\u5417\uff1f\u7528\u6df7\u5408 QC \u56de\u5230\u63d0\u53d6\u79bb\u5b50\u8272\u8c31"},"content":{"rendered":"<div class=\"ysx-r-practice\" id=\"ysx-r-xcms\" 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\">\u540c\u4e00\u6df7\u5408 QC \u7684\u67d0\u4e2a\u5cf0\u5728\u4e09\u9488\u91cc\u9010\u6e10\u665a\u51fa\uff0c\u65e2\u53ef\u80fd\u662f\u4fdd\u7559\u65f6\u95f4\u6f02\u79fb\uff0c\u4e5f\u53ef\u80fd\u62ff\u9519\u4e86\u76f8\u90bb\u5cf0\u3002xcms \u5bfb\u5cf0\u3001\u6821\u6b63\u548c\u8de8\u6837\u672c\u5206\u7ec4\u5e94\u5206\u522b\u56de\u5230\u63d0\u53d6\u79bb\u5b50\u8272\u8c31\u6838\u67e5\uff0c\u5c24\u5176\u8981\u4fdd\u7559\u524d\u540e\u5cf0\u5f62\u548c\u987a\u5e8f\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">xcms \u7684\u8f93\u5165\u548c\u5206\u6790\u5bf9\u8c61<\/h2>\n<p style=\"margin:.5em 0 1em\">raw \u4e3a xcms \u652f\u6301\u7684\u5df2\u8bfb\u5165\u7684\u9ad8\u5206\u8fa8\u7387\u8d28\u8c31\u5bf9\u8c61\uff0c\u793a\u4f8b\u4e3a\u8d28\u5fc3 LC\u2013MS \u6570\u636e\u3002\u5cf0\u5bbd\u5355\u4f4d\u79d2\uff0c\u6821\u6b63\u7b97\u6cd5\u5e94\u4e0e\u5e73\u53f0\u5339\u914d\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u4fdd\u7559\u65f6\u95f4\u6821\u6b63\u540e\u5cf0\u662f\u5426\u5bf9\u9f50\uff0c\u662f\u8d28\u8c31\u6570\u636e\u5206\u6790\u4e2d\u4e00\u4e2a\u5173\u952e\u95ee\u9898\u3002\u5728\u4f7f\u7528\u6df7\u5408\u8d28\u63a7\u6837\u672c\u8fdb\u884c\u6821\u6b63\u65f6\uff0c\u9700\u8981\u660e\u786e\u6821\u6b63\u662f\u5426\u771f\u6b63\u5b9e\u73b0\u4e86\u5cf0\u7684\u5bf9\u9f50\uff0c\u800c\u975e\u4ec5\u4ec5\u8c03\u6574\u4e86\u65f6\u95f4\u5750\u6807\u3002\u6821\u6b63\u8fc7\u7a0b\u540e\uff0c\u5e94\u68c0\u67e5\u63d0\u53d6\u79bb\u5b50\u8272\u8c31\uff08EIC\uff09\u4e2d\u5cf0\u7684\u5f62\u72b6\u3001\u4f4d\u7f6e\u4e0e\u91cd\u53e0\u60c5\u51b5\u3002\u82e5\u5cf0\u672a\u5bf9\u9f50\uff0c\u53ef\u80fd\u9020\u6210\u4e0d\u540c\u5316\u5408\u7269\u7684\u4fe1\u53f7\u88ab\u9519\u8bef\u5408\u5e76\uff0c\u5f71\u54cd\u540e\u7eed\u5b9a\u91cf\u5206\u6790\u3002\u56e0\u6b64\uff0c\u5fc5\u987b\u901a\u8fc7\u53ef\u89c6\u5316\u65b9\u6cd5\u786e\u8ba4\u6821\u6b63\u540e\u5cf0\u662f\u5426\u771f\u6b63\u5bf9\u9f50\uff0c\u907f\u514d\u56e0\u8bef\u5224\u5bfc\u81f4\u7684\u9519\u8bef\u7ed3\u679c\u3002\u5728\u672c\u7814\u7a76\u4e2d\uff0c\u539f\u59cb\u6570\u636e\u4e3a\u8d28\u5fc3\u6a21\u5f0f\u7684\u9ad8\u5206\u8fa8\u7387LC\u2013MS\u6570\u636e\uff0c\u5305\u542b\u591a\u4e2a\u6837\u672c\uff0c\u6bcf\u4e2a\u6837\u672c\u7684\u4fdd\u7559\u65f6\u95f4\u5b58\u5728\u7cfb\u7edf\u6027\u504f\u5dee\u3002\u6821\u6b63\u7b97\u6cd5\u91c7\u7528Obiwarp\u65b9\u6cd5\uff0c\u8be5\u65b9\u6cd5\u57fa\u4e8e\u6837\u672c\u95f4\u5cf0\u5f62\u7684\u76f8\u4f3c\u6027\u8fdb\u884c\u5bf9\u9f50\uff0c\u9002\u7528\u4e8e\u5904\u7406\u6279\u6b21\u95f4\u4fdd\u7559\u65f6\u95f4\u6f02\u79fb\u95ee\u9898\u3002\u6821\u6b63\u540e\uff0c\u5e94\u68c0\u67e5\u5cf0\u7684\u5f62\u72b6\u662f\u5426\u4e00\u81f4\uff0c\u662f\u5426\u51fa\u73b0\u62d6\u5c3e\u6216\u524d\u4f38\u73b0\u8c61\uff0c\u786e\u4fdd\u5cf0\u5f62\u672a\u56e0\u6821\u6b63\u8fc7\u7a0b\u88ab\u7834\u574f\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728\u8fdb\u884c\u4fdd\u7559\u65f6\u95f4\u6821\u6b63\u524d\uff0c\u9996\u5148\u9700\u8981\u5bf9\u539f\u59cb\u8d28\u8c31\u6570\u636e\u8fdb\u884c\u5cf0\u68c0\u6d4b\uff0c\u4f7f\u7528findChromPeaks()\u51fd\u6570\u5b8c\u6210\u3002\u6b64\u51fd\u6570\u6839\u636e\u8bbe\u5b9a\u7684\u53c2\u6570\uff0c\u5982\u5cf0\u5bbd\u3001\u4fe1\u566a\u6bd4\u7b49\uff0c\u8bc6\u522b\u8d28\u8c31\u56fe\u4e2d\u7684\u8272\u8c31\u5cf0\u3002\u5728\u672c\u4f8b\u4e2d\uff0c\u4f7f\u7528\u4e86CentWave\u65b9\u6cd5\uff0c\u53c2\u6570\u4e3appm=15\uff0c\u5cf0\u5bbd\u8303\u56f4\u4e3a5\u523025\u79d2\u3002\u8be5\u65b9\u6cd5\u9002\u7528\u4e8e\u9ad8\u5206\u8fa8\u7387\u8d28\u8c31\u6570\u636e\uff0c\u80fd\u591f\u6709\u6548\u8bc6\u522b\u5cf0\u7684\u8d77\u59cb\u4e0e\u7ed3\u675f\u65f6\u95f4\u3002\u5cf0\u68c0\u6d4b\u5b8c\u6210\u540e\uff0c\u5f97\u5230\u7684\u5cf0\u4fe1\u606f\u5305\u542bmz\u3001rt\u3001intensity\u7b49\u5b57\u6bb5\uff0c\u8fd9\u4e9b\u4fe1\u606f\u662f\u540e\u7eed\u6821\u6b63\u4e0e\u5206\u7ec4\u7684\u57fa\u7840\u3002\u5728\u6570\u636e\u5904\u7406\u8fc7\u7a0b\u4e2d\uff0c\u5e94\u786e\u4fdd\u5cf0\u68c0\u6d4b\u53c2\u6570\u8bbe\u7f6e\u5408\u7406\uff0c\u907f\u514d\u56e0\u53c2\u6570\u4e0d\u5f53\u5bfc\u81f4\u5cf0\u88ab\u9057\u6f0f\u6216\u8bef\u68c0\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u6821\u6b63\u524d\u7684\u5cf0\u4f4d\u7f6e\u4e0e\u6821\u6b63\u540e\u7684\u5cf0\u4f4d\u7f6e\u5e94\u901a\u8fc7EIC\u56fe\u8fdb\u884c\u5bf9\u6bd4\uff0c\u786e\u8ba4\u662f\u5426\u771f\u6b63\u5bf9\u9f50\u3002\u4f8b\u5982\uff0c\u539f\u59cb\u6570\u636e\u4e2d\u4e09\u4e2a\u5cf0\u5206\u522b\u5728300\u3001306\u3001312\u79d2\u51fa\u73b0\uff0c\u6821\u6b63\u540e\u5e94\u4fdd\u6301\u5176\u76f8\u5bf9\u4f4d\u7f6e\u4e0d\u53d8\uff0c\u4e14\u5cf0\u5f62\u5e94\u4e00\u81f4\u3002\u82e5\u6821\u6b63\u540e\u5cf0\u5f62\u53d1\u751f\u660e\u663e\u53d8\u5316\uff0c\u8bf4\u660e\u6821\u6b63\u8fc7\u7a0b\u53ef\u80fd\u5f15\u5165\u4e86\u8bef\u5dee\u3002\u5728\u5b9e\u9645\u64cd\u4f5c\u4e2d\uff0c\u5e94\u901a\u8fc7plotChromPeaks()\u51fd\u6570\u67e5\u770b\u6bcf\u4e2a\u6837\u672c\u7684EIC\u56fe\uff0c\u786e\u8ba4\u5cf0\u7684\u5f62\u72b6\u4e0e\u4f4d\u7f6e\u662f\u5426\u7a33\u5b9a\u3002\u82e5\u4ec5\u901a\u8fc7\u65f6\u95f4\u5750\u6807\u5224\u65ad\u6821\u6b63\u6548\u679c\uff0c\u5bb9\u6613\u5ffd\u7565\u5cf0\u5f62\u53d8\u5316\uff0c\u5bfc\u81f4\u8bef\u5224\u3002\u56e0\u6b64\uff0c\u5e94\u7ed3\u5408\u5cf0\u5f62\u4e0e\u4f4d\u7f6e\u7efc\u5408\u5224\u65ad\u6821\u6b63\u662f\u5426\u6210\u529f\u3002\u6821\u6b63\u540e\uff0c\u5cf0\u7684\u8d77\u59cb\u65f6\u95f4\u3001\u5cf0\u503c\u65f6\u95f4\u3001\u7ed3\u675f\u65f6\u95f4\u5e94\u4fdd\u6301\u4e00\u81f4\uff0c\u5426\u5219\u5e94\u91cd\u65b0\u68c0\u67e5\u6821\u6b63\u53c2\u6570\u6216\u6570\u636e\u8d28\u91cf\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u4ece\u8d28\u63a7\u8fc7\u7684 mzML \u5f00\u59cb\uff0c<code>findChromPeaks()<\/code> \u68c0\u5cf0\uff0c\u4f9d\u6240\u9009\u65b9\u6cd5\u786e\u5b9a\u662f\u5426\u9700\u8981\u521d\u6b21\u5206\u7ec4\uff0c\u518d\u7528 <code>adjustRtime()<\/code> \u5bf9\u9f50\u53ca <code>groupChromPeaks()<\/code> \u5efa\u7acb\u7279\u5f81\u8868\u3002 <a href=\"https:\/\/bioconductor.org\/packages\/release\/bioc\/vignettes\/xcms\/inst\/doc\/xcms.html\" style=\"color:#185CB7;text-decoration:underline;\">xcms \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;\">p &lt;- xcms::findChromPeaks(raw,param=xcms::CentWaveParam(ppm=15,peakwidth=c(5,25)))\na &lt;- xcms::adjustRtime(p,param=xcms::ObiwarpParam())\nhead(xcms::chromPeaks(a))\n<\/code><\/pre>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u540c\u4e00 QC \u5cf0\u6821\u6b63\u524d\u7684\u65f6\u95f4\u5dee<\/h2>\n<p style=\"margin:.5em 0 1em\">\u56fe\u793a\u4e09\u9488\u539f\u59cb\u9876\u70b9\u5728\u4e09\u767e\u3001\u4e09\u767e\u96f6\u516d\u3001\u4e09\u767e\u4e00\u5341\u4e8c\u79d2\uff0c\u7eb5\u503c\u662f\u76f8\u5bf9\u9996\u9488\u7684\u96f6\u3001\u516d\u3001\u5341\u4e8c\u79d2\u3002\u6821\u6b63\u540e\u9700\u68c0\u67e5\u6574\u6761\u5cf0\u5f62\u3001\u5171\u6d17\u8131\u53ca\u53e6\u4e00\u4e2a\u975e\u53c2\u7167\u5cf0\u3002\u4e0d\u80fd\u628a\u7ed9\u51fa\u7684\u539f\u59cb\u504f\u79fb\u5f53\u6821\u6b63\u6548\u679c\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(300,306,312)-300\nnames(v) &lt;- c(\"\u9488\u4e00\u79d2\", \"\u9488\u4e8c\u79d2\", \"\u9488\u4e09\u79d2\")\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;\">\u9488\u4e00\u79d2<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">0 \u79d2<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u9488\u4e8c\u79d2<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">6 \u79d2<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u9488\u4e09\u79d2<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">12 \u79d2<\/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-xcms-practice-181c9909.png?resize=1120%2C690&#038;ssl=1\" alt=\"\u540c\u4e00 QC \u5cf0\u6821\u6b63\u524d\u7684\u65f6\u95f4\u5dee\u3002\u9488\u4e00\u79d2 0 \u79d2\uff0c\u9488\u4e8c\u79d2 6 \u79d2\uff0c\u9488\u4e09\u79d2 12 \u79d2\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;\">\u4e24\u6761\u540c\u8d28\u91cf\u8272\u8c31\u5cf0\u662f\u5426\u5e94\u8be5\u5408\u6210\u4e00\u4e2a\uff1f<\/h2>\n<p style=\"margin:.5em 0 1em\">\u8fd9\u4e00\u7ec4\u4e24\u9488\u5404\u6709\u4e24\u5cf0\uff0c\u6700\u8fd1\u5dee\u503c\u4e0e\u53ef\u80fd\u7684\u6821\u6b63\u6f02\u79fb\u6709\u91cd\u53e0\u3002\u4fdd\u7559\u65f6\u95f4\u63a5\u8fd1\u53ea\u80fd\u63d0\u4f9b\u5019\u9009\uff0c\u7ed3\u5408\u63d0\u53d6\u79bb\u5b50\u8272\u8c31\u7684\u5cf0\u5f62\u3001\u76f8\u90bb\u5cf0\u76f8\u5bf9\u987a\u5e8f\u548c QC \u4e00\u81f4\u6027\uff0c\u518d\u51b3\u5b9a\u8de8\u6837\u672c\u5206\u7ec4\uff0c\u907f\u514d\u628a\u5f02\u6784\u4f53\u786c\u5e76\u6210\u4e00\u4e2a\u7279\u5f81\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;\">a &lt;- c(300,310)\nb &lt;- c(304,314)\nouter(a,b,function(x,y)abs(x-y))\n<\/code><\/pre>\n<p style=\"margin:.5em 0 1em\">\u5728\u4fdd\u7559\u65f6\u95f4\u6821\u6b63\u6d41\u7a0b\u4e2d\uff0c\u82e5\u672a\u6b63\u786e\u6267\u884c\u5cf0\u68c0\u6d4b\u6216\u5206\u7ec4\u64cd\u4f5c\uff0c\u53ef\u80fd\u5bfc\u81f4\u6821\u6b63\u540e\u5cf0\u672a\u771f\u6b63\u5bf9\u9f50\u3002\u4f8b\u5982\uff0c\u82e5\u5728findChromPeaks()\u4e2d\u4f7f\u7528\u4e86\u8fc7\u5bbd\u7684\u5cf0\u5bbd\u53c2\u6570\uff0c\u53ef\u80fd\u5c06\u539f\u672c\u5206\u79bb\u826f\u597d\u7684\u5cf0\u8bef\u5224\u4e3a\u4e00\u4e2a\u5cf0\uff0c\u9020\u6210\u6821\u6b63\u65f6\u65e0\u6cd5\u51c6\u786e\u8bc6\u522b\u5176\u72ec\u7acb\u6027\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5373\u4f7fadjustRtime()\u6267\u884c\u4e86\u6821\u6b63\uff0c\u5cf0\u7684\u4f4d\u7f6e\u4ecd\u53ef\u80fd\u672a\u5bf9\u9f50\uff0c\u56e0\u4e3a\u539f\u59cb\u5cf0\u68c0\u6d4b\u5df2\u5c06\u591a\u4e2a\u5cf0\u5408\u5e76\u3002\u82e5\u672a\u5728\u5206\u7ec4\u524d\u68c0\u67e5\u5cf0\u68c0\u6d4b\u7ed3\u679c\uff0c\u5bb9\u6613\u5ffd\u7565\u8fd9\u4e00\u95ee\u9898\uff0c\u4f7f\u540e\u7eed\u6821\u6b63\u7ed3\u679c\u51fa\u73b0\u504f\u5dee\u3002\u56e0\u6b64\uff0c\u5fc5\u987b\u5728\u5cf0\u68c0\u6d4b\u5b8c\u6210\u540e\uff0c\u901a\u8fc7plotChromPeaks()\u67e5\u770b\u6bcf\u4e2a\u6837\u672c\u7684EIC\u56fe\uff0c\u786e\u8ba4\u5cf0\u662f\u5426\u6b63\u786e\u5206\u79bb\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u82e5\u6821\u6b63\u540e\u53d1\u73b0\u5cf0\u672a\u5bf9\u9f50\uff0c\u5e94\u9996\u5148\u786e\u8ba4\u662f\u5426\u4f7f\u7528\u4e86\u6b63\u786e\u7684\u6821\u6b63\u65b9\u6cd5\u3002\u4f8b\u5982\uff0c\u82e5\u6837\u672c\u95f4\u4fdd\u7559\u65f6\u95f4\u6f02\u79fb\u8f83\u5927\uff0c\u800c\u91c7\u7528\u7684\u6821\u6b63\u65b9\u6cd5\u5bf9\u8fd9\u79cd\u6f02\u79fb\u4e0d\u654f\u611f\uff0c\u53ef\u80fd\u5bfc\u81f4\u6821\u6b63\u5931\u8d25\u3002\u6b64\u65f6\u5e94\u68c0\u67e5\u6821\u6b63\u53c2\u6570\uff0c\u5982ObiwarpParam()\u4e2d\u7684gapInit\u7b49\u8bbe\u7f6e\uff0c\u786e\u8ba4\u662f\u5426\u9002\u5408\u5f53\u524d\u6570\u636e\u3002\u82e5\u53c2\u6570\u8bbe\u7f6e\u4e0d\u5339\u914d\uff0c\u5e94\u5c1d\u8bd5\u8c03\u6574\u53c2\u6570\u6216\u66f4\u6362\u6821\u6b63\u65b9\u6cd5\u3002\u6b64\u5916\uff0c\u5e94\u786e\u8ba4\u6837\u672c\u662f\u5426\u5305\u542b\u5f02\u5e38\u6570\u636e\uff0c\u5982\u4fe1\u53f7\u5f02\u5e38\u6216\u80cc\u666f\u5e72\u6270\uff0c\u8fd9\u4e9b\u56e0\u7d20\u4e5f\u53ef\u80fd\u5f71\u54cd\u6821\u6b63\u6548\u679c\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u5728 xcms \u968f\u5305\u5bf9\u8c61\u5185\u8bfb\u53d6\u5b9e\u9645\u8272\u8c31\u5cf0\u8868<\/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;\">data(\"xdata\",package=\"xcms\")\npk&lt;-xcms::chromPeaks(xdata)\nc(nrow(pk),as.integer(\"rt\" %in% colnames(pk)),length(unique(pk[,\"sample\"])))\n<\/code><\/pre>\n<p style=\"margin:.5em 0 1em\">\u5728 R 4.5.2\u3001xcms 4.8.0 \u4e2d\u8fd0\u884c\uff0c\u8f93\u51fa\u4f9d\u6b21\u4e3a\u8272\u8c31\u5cf0\u6761\u76ee 3,651\uff0c\u6709\u4fdd\u7559\u65f6\u95f4\u5b57\u6bb5 1\uff0c\u4e0d\u540c\u6837\u672c\u7f16\u53f7 8\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\">\u7528\u6df7\u5408 QC \u7684\u63d0\u53d6\u79bb\u5b50\u8272\u8c31\u68c0\u67e5\u5cf0\u5bbd\u3001\u4fdd\u7559\u65f6\u95f4\u504f\u79fb\u4e0e\u7ea0\u6b63\u540e\u5bf9\u9f50\u6548\u679c\uff0c\u907f\u514d\u628a\u6765\u81ea\u4e0d\u540c\u5316\u5408\u7269\u7684\u5cf0\u5f3a\u884c\u5408\u5e76\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728adjustRtime()\u4e2d\uff0c\u82e5\u6821\u6b63\u65b9\u6cd5\u7684\u53c2\u6570\u8bbe\u7f6e\u4e0d\u5f53\uff0c\u4e5f\u53ef\u80fd\u5f71\u54cd\u5cf0\u5bf9\u9f50\u6548\u679c\u3002\u4f8b\u5982\uff0cObiwarpParam()\u4e2d\u7684gapInit\u53c2\u6570\u63a7\u5236\u6821\u6b63\u8fc7\u7a0b\u4e2d\u5cf0\u5f62\u7684\u5339\u914d\u7a0b\u5ea6\uff0c\u82e5\u8bbe\u7f6e\u8fc7\u5c0f\uff0c\u53ef\u80fd\u5bfc\u81f4\u5cf0\u672a\u5145\u5206\u5bf9\u9f50\u3002\u82e5\u8bbe\u7f6e\u8fc7\u5927\uff0c\u5219\u53ef\u80fd\u5f15\u5165\u8fc7\u5ea6\u6821\u6b63\u3002\u8fd9\u79cd\u53c2\u6570\u654f\u611f\u6027\u5728\u4e0d\u540c\u6837\u672c\u95f4\u8868\u73b0\u5c24\u4e3a\u660e\u663e\u3002\u56e0\u6b64\uff0c\u5728\u6821\u6b63\u524d\u5e94\u5148\u8fdb\u884c\u53c2\u6570\u6d4b\u8bd5\uff0c\u89c2\u5bdf\u4e0d\u540c\u53c2\u6570\u4e0b\u5cf0\u7684\u5bf9\u9f50\u60c5\u51b5\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u4f8b\u5982\uff0c\u82e5\u6837\u672c\u5206\u7ec4\u8bbe\u7f6e\u9519\u8bef\uff0c\u53ef\u80fd\u5c06\u4e0d\u540c\u6837\u672c\u7684\u5cf0\u8bef\u5224\u4e3a\u540c\u4e00\u7279\u5f81\u5cf0\u3002\u6b64\u65f6\u5373\u4f7f\u6821\u6b63\u540e\u5cf0\u4f4d\u7f6e\u5bf9\u9f50\uff0c\u4e5f\u96be\u4ee5\u4fdd\u8bc1\u5cf0\u7684\u72ec\u7acb\u6027\u3002\u56e0\u6b64\uff0c\u5e94\u786e\u4fdd\u6837\u672c\u5206\u7ec4\u4fe1\u606f\u4e0e\u5b9e\u9645\u6837\u672c\u4e00\u81f4\uff0c\u907f\u514d\u56e0\u5206\u7ec4\u9519\u8bef\u5bfc\u81f4\u7684\u8bef\u5224\u3002\u5728\u53c2\u6570\u8bbe\u7f6e\u5b8c\u6210\u540e\uff0c\u5e94\u901a\u8fc7plotChromPeaks()\u89c2\u5bdf\u6821\u6b63\u540e\u5cf0\u7684\u5206\u5e03\u60c5\u51b5\uff0c\u786e\u8ba4\u5cf0\u662f\u5426\u771f\u6b63\u5bf9\u9f50\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\">\u53d6\u4e00\u4e2a\u5728\u6df7\u5408\u8d28\u63a7\u6837\u672c\u91cc\u770b\u4f3c\u5206\u6210\u4e24\u7ec4\u7684\u5cf0\uff0c\u56de\u5230\u7edf\u4e00\u8d28\u91cf\u7a97\u53e3\u7684\u63d0\u53d6\u79bb\u5b50\u8272\u8c31\uff0c\u6807\u8bb0\u539f\u59cb\u548c\u6821\u6b63\u4fdd\u7559\u65f6\u95f4\u4ee5\u53ca\u6bcf\u9488\u8fdb\u6837\u987a\u5e8f\u3002\u82e5\u540c\u4e00\u6b21\u8fdb\u6837\u91cc\u5c31\u6709\u4e24\u4e2a\u53ef\u5206\u8fa8\u5cf0\uff0c\u5f3a\u884c\u5bf9\u9f50\u4f1a\u5408\u5e76\u4e0d\u540c\u7269\u8d28\u3002\u82e5\u968f\u8fdb\u6837\u987a\u5e8f\u9010\u6e10\u6f02\u79fb\uff0c\u53ef\u770b\u6821\u6b63\u662f\u5426\u628a\u540c\u4e00\u5cf0\u91cd\u65b0\u5bf9\u51c6\u800c\u4fdd\u6301\u5cf0\u5f62\u3002\u8f93\u51fa\u5cf0\u7ec4\u548c\u586b\u8865\u503c\u65f6\u4fdd\u7559\u539f\u6765\u662f\u5426\u68c0\u51fa\u3001\u5cf0\u9762\u79ef\u548c\u7a7a\u767d\u6837\u672c\u4fe1\u53f7\u4e09\u9879\u8bc1\u636e\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u9009\u4e00\u4e2a\u5f3a\u5019\u9009\uff0c\u540c\u65f6\u9009\u4e00\u4e2a\u5f3a\u5ea6\u8f83\u4f4e\u6216\u4f4d\u7f6e\u63a5\u8fd1\u7684\u5bf9\u8c61\uff0c\u5728\u540c\u4e00\u663e\u793a\u5c3a\u5ea6\u4e0b\u56de\u5230\u539f\u59cb\u6d4b\u91cf\u3002\u8bb0\u5f55\u6837\u672c\u6216\u89c6\u91ce\u3001\u76ee\u6807\u4f4d\u7f6e\u3001\u4f7f\u7528\u7684\u4fe1\u53f7\u7a97\u53e3\u548c\u662f\u5426\u6709\u90bb\u8fd1\u5e72\u6270\u3002\u53ea\u770b\u6700\u7ec8\u5e73\u5747\u6570\u6216\u4e00\u4e2a\u5339\u914d\u5206\u6570\uff0c\u5f88\u96be\u5206\u8fa8\u771f\u5b9e\u4fe1\u53f7\u3001\u8fb9\u754c\u9519\u4f4d\u4ee5\u53ca\u5c11\u6570\u6781\u5f3a\u89c2\u6d4b\u7684\u8d21\u732e\u3002\u82e5\u624b\u5de5\u53e0\u56fe\u80fd\u770b\u51fa\u5dee\u5f02\uff0c\u518d\u6307\u5b9a\u4e00\u9879\u53ef\u4ee5\u6279\u91cf\u590d\u6838\u7684\u91cf\uff0c\u4f8b\u5982\u6709\u6548\u5339\u914d\u6570\u3001\u5b9e\u9645\u8986\u76d6\u6216\u539f\u59cb\u5cf0\u5bbd\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u628a\u8fd9\u5957\u68c0\u67e5\u7528\u5728\u4e00\u4e2a\u672a\u53c2\u4e0e\u6311\u9009\u7684\u6837\u672c\u4e0a\u3002\u9633\u6027\u5bf9\u7167\u56de\u7b54\u6d41\u7a0b\u80fd\u4e0d\u80fd\u4fdd\u7559\u5df2\u77e5\u4fe1\u53f7\uff0c\u9634\u6027\u6216\u90bb\u8fd1\u5bf9\u7167\u56de\u7b54\u5b83\u4f1a\u4e0d\u4f1a\u628a\u76f8\u4f3c\u5bf9\u8c61\u6df7\u4e3a\u4e00\u7c7b\u3002\u4e24\u8005\u82e5\u51fa\u73b0\u76f8\u4e92\u77db\u76fe\u7684\u7ed3\u679c\uff0c\u5e94\u56de\u5230\u539f\u59cb\u8bb0\u5f55\u51b3\u5b9a\u662f\u91c7\u96c6\u6761\u4ef6\u4e0d\u4e00\u81f4\u3001\u4f4d\u7f6e\u5339\u914d\u6709\u8bef\uff0c\u8fd8\u662f\u73b0\u6709\u5206\u8fa8\u7387\u672c\u8eab\u4e0d\u8db3\u4ee5\u533a\u522b\u5019\u9009\u3002\u4fdd\u7559\u8fd9\u4e24\u79cd\u5bf9\u7167\uff0c\u4ea4\u4ed8\u65f6\u5c31\u80fd\u5177\u4f53\u8bf4\u660e\u54ea\u4e9b\u7ed3\u8bba\u8fd8\u9700\u8981\u53e6\u5916\u7684\u6d4b\u91cf\u65b9\u6cd5\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\/091-xcms-code-0942e15e6e6d8524.zip\">\u4e0b\u8f7d\u672c\u7bc7 R \u4ee3\u7801\uff08ZIP\uff0c4.9 KiB\uff09<\/a> \u00b7 <a style=\"color:#1458a5;text-decoration:underline;\" href=\"https:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/r-practice-labs\/091-xcms-data-f6ed95e4966c7940.zip\">\u4e0b\u8f7d\u914d\u5957\u793a\u4f8b\u6570\u636e\uff08ZIP\uff0c281.5 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;\">091-xcms<\/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\u5728 xcms \u968f\u5305\u5bf9\u8c61\u5185\u8bfb\u53d6\u5b9e\u9645\u8272\u8c31\u5cf0\u8868\u201d\u3002Linux x86_64\u3001R 4.5.2\u3001xcms 4.8.0 \u7684\u8f93\u51fa\u4e3a\u8272\u8c31\u5cf0\u6761\u76ee 3651\uff0c\u6709\u4fdd\u7559\u65f6\u95f4\u5b57\u6bb5 1\uff0c\u4e0d\u540c\u6837\u672c\u7f16\u53f7 8\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">chromPeaks \u7684\u6bcf\u4e00\u884c\u662f\u4e00\u6761\u5cf0\u68c0\u6d4b\u8bb0\u5f55\u3002\u5148\u6309 sample \u6570\u5404\u6837\u672c\u68c0\u6d4b\u5230\u591a\u5c11\u5cf0\uff0c\u518d\u8ffd\u8e2a\u540c\u4e00\u4fdd\u7559\u65f6\u95f4\u90bb\u57df\u7684\u8bb0\u5f55\u662f\u5426\u5728\u540e\u7eed\u7279\u5f81\u5206\u7ec4\u4e2d\u88ab\u5f52\u5e76\u3002\u5728\u5206\u7ec4\u4e4b\u524d\uff0c\u4e0d\u80fd\u628a\u5cf0\u884c\u6570\u5f53\u4f5c\u4ee3\u8c22\u7269\u6570\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\">\u968f\u5305\u8272\u8c31\u5cf0\u5bf9\u8c61\u5c06\u4e00\u4e2a\u6837\u672c\u91cc\u68c0\u6d4b\u5230\u7684\u5cf0\u5217\u6210\u591a\u884c\uff0c\u540c\u4e00 m\/z \u9644\u8fd1\u53ef\u4ee5\u6709\u591a\u4e2a\u4e0d\u540c\u65f6\u95f4\u7684\u5cf0\u3002\u786e\u8ba4\u7ed3\u679c\u4e2d\u6709\u53ef\u7528\u7684\u4fdd\u7559\u65f6\u95f4\u53ca\u6837\u672c\u7f16\u53f7\uff0c\u624d\u80fd\u56de\u5230\u539f\u9488\u7684\u63d0\u53d6\u79bb\u5b50\u8272\u8c31\u9a8c\u8bc1\u6821\u6b63\u3002\u8868\u4e2d\u5cf0\u884c\u6570\u4e0d\u80fd\u76f4\u63a5\u5145\u5f53\u8de8\u6837\u672c\u7684\u72ec\u7acb\u5316\u5408\u7269\u6570\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>\u56fe\u793a\u4e09\u9488\u539f\u59cb\u9876\u70b9\u5728\u4e09\u767e\u3001\u4e09\u767e\u96f6\u516d\u3001\u4e09\u767e\u4e00\u5341\u4e8c\u79d2\uff0c\u7eb5\u503c\u662f\u76f8\u5bf9\u9996\u9488\u7684\u96f6\u3001\u516d\u3001\u5341\u4e8c\u79d2\u3002<\/p>\n","protected":false},"author":1,"featured_media":68789,"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":[47,1],"tags":[728,817,818],"class_list":["post-68790","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r","category-part","tag-r","tag-xcms","tag-818"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/r-guide-xcms-practice-181c9909.png?fit=1120%2C690&ssl=1","_links":{"self":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68790","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=68790"}],"version-history":[{"count":3,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68790\/revisions"}],"predecessor-version":[{"id":70939,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68790\/revisions\/70939"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media\/68789"}],"wp:attachment":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media?parent=68790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/categories?post=68790"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/tags?post=68790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}