{"id":55181,"date":"2024-06-16T16:18:00","date_gmt":"2024-06-16T08:18:00","guid":{"rendered":"http:\/\/www.biocloudservice.com\/wordpress\/?p=55181"},"modified":"2024-06-16T16:18:00","modified_gmt":"2024-06-16T08:18:00","slug":"%e5%9f%ba%e5%9b%a0%e7%bb%b4%e5%ba%a6%e5%a4%aa%e9%ab%98%e6%80%8e%e4%b9%88%e5%8a%9e%ef%bc%9f%e6%97%a0%e6%89%80%e8%b0%93%ef%bc%81pca%e9%99%8d%e7%bb%b4%e4%bc%9a%e5%87%ba%e6%89%8b%ef%bc%81","status":"publish","type":"post","link":"http:\/\/www.biocloudservice.com\/wordpress\/?p=55181","title":{"rendered":"\u57fa\u56e0\u7ef4\u5ea6\u592a\u9ad8\u600e\u4e48\u529e\uff1f\u65e0\u6240\u8c13\uff01PCA\u964d\u7ef4\u4f1a\u51fa\u624b\uff01"},"content":{"rendered":"<p><html><br \/>\n<head><br \/>\n<title><\/title><br \/>\n<meta charset=\"utf-8\"><br \/>\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0,viewport-fit=cover\"><\/p>\n<style>\n*{margin:0;padding:0}html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;line-height:1.6}img{z-index:999;position:relative;max-width:100%;margin:10px 0;}body{letter-spacing:.034em}h1,h2,h3,h4,h5,h6{font-weight:400;font-size:16px}a{color:#576b95;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}td,th{word-wrap:break-word;padding:5px 10px;border:1px solid #DDD;}table{margin-bottom:10px;border-collapse:collapse;display:table;width:100%!important;}.appmsg_skin_default .rich_media_area_primary{background-color:#fff}.appmsg_skin_default .rich_media_area_primary .weui-loadmore_line .weui-loadmore__tips{background-color:#fff}.rich_media_area_primary{padding:20px 16px 12px;background-color:#fafafa}@media (max-width:375px){.rich_media_area_primary{padding:20px 60px 15px 60px}.rich_media_area_extra{padding:0 60px 21px 60px}}@media (min-width:1024px){.rich_media_area_primary_inner,.rich_media_area_extra_inner,body{max-width:677px;margin-left:auto;margin-right:auto}.rich_media_area_primary{padding-top:32px}}.rich_media{padding:20px;overflow:hidden;}.appmsg_skin_default .rich_media_area_primary{background-color:#fff}.appmsg_skin_default .rich_media_area_primary .weui-loadmore_line .weui-loadmore__tips{background-color:#fff}@media screen and (min-width:1024px){.rich_media_area_primary_inner,.rich_media_area_extra_inner{max-width:677px;margin-left:auto;margin-right:auto}.rich_media_area_primary{padding-top:32px}}.rich_media_content{overflow:hidden;color:#333;font-size:17px;word-wrap:break-word;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;text-align:justify;position:relative;z-index:0}.rich_media_content *{max-width:100%!important;box-sizing:border-box!important;-webkit-box-sizing:border-box!important;word-wrap:break-word!important}.rich_media_content p{clear:both;min-height:1em}.rich_media_content em{font-style:italic}.rich_media_content fieldset{min-width:0}.rich_media_content .list-paddingleft-1,.rich_media_content .list-paddingleft-2,.rich_media_content .list-paddingleft-3{padding-left:2.2em}.rich_media_content .list-paddingleft-1 .list-paddingleft-2,.rich_media_content .list-paddingleft-2 .list-paddingleft-2,.rich_media_content .list-paddingleft-3 .list-paddingleft-2{padding-left:30px}.rich_media_content .list-paddingleft-1{padding-left:1.2em}.rich_media_content .list-paddingleft-3{padding-left:3.2em}.rich_media_content .code-snippet,.rich_media_content .code-snippet__fix{max-width:1000%!important}.rich_media_content .code-snippet *,.rich_media_content .code-snippet__fix *{max-width:1000%!important}.rich_media_title{font-size:22px;line-height:1.4;margin-bottom:13px;padding-bottom:13px;border-bottom:1px solid #e7e7eb;}@supports(-webkit-overflow-scrolling:touch){.rich_media_title{font-weight:700}}.rich_media_meta{display:inline-block;vertical-align:middle;padding:0 0 10px 0;font-size:15px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.rich_media_meta.icon_appmsg_tag{margin-right:0px}.rich_media_meta.meta_tag_text{margin-right:0}.rich_media_meta_list em{font-style:normal}.rich_media_meta_text{color:#a5a5a5;}p{margin:0;}.msgBox{margin-top:20px;padding-top:20px;padding-left:50px;overflow:hidden;border-top:2px dashed #09a2ff;}.msg{padding-top:7px;clear:both;}.msgBody{float:right;width:100%;margin-left:55px;padding-bottom:15px;border-bottom:1px dashed #e0e0e0;}.userHeadImg{float:left;margin-left:-50px;}.userHeadImg img{width:40px;height:40px;margin-right:10px;border-radius:3px;}.userName{color:#888888;line-height:24px;font-size:14px;margin:5px 0 5px 0;height:24px;}.replyBody,.autherBody{color:#565656;font-size:15px;}.replyIcon{border-left:4px solid #33ab01;margin-right:5px;}.ad{text-decoration:none;color:#d6d4d4;font-size:12px;}.msgBodyReply{padding-top:5px;}.userName span{float:right;color:#afafaf;font-size:14px;}code{text-align:left;font-size:14px;display:block;white-space:pre;display:-webkit-box;display:-webkit-flex;display:flex;position:relative;}.code-snippet__fix{font-size:14px;margin:10px 0;display:block;color:#333;position:relative;background-color:rgba(0,0,0,0.03);border:1px solid #f0f0f0;border-radius:2px;display:-webkit-box;display:-webkit-flex;display:flex;padding-left:25px;line-height:26px}.code-snippet__fix code{text-align:left;font-size:14px;display:block;white-space:pre;display:-webkit-box;display:-webkit-flex;display:flex;position:relative;font-family:Consolas,\"Liberation Mono\",Menlo,Courier,monospace}.code-snippet__comment,.code-snippet__quote{color:#afafaf;font-style:italic}.code-snippet__keyword,.code-snippet__selector-tag,.code-snippet__subst{color:#ca7d37}.code-snippet__number,.code-snippet__literal,.code-snippet__variable,.code-snippet__template-variable,.code-snippet__tag .code-snippet__attr{color:#0e9ce5}.code-snippet__string,.code-snippet__doctag{color:#d14}.code-snippet__title,.code-snippet__section,.code-snippet__selector-id{color:#d14}.code-snippet__subst{font-weight:normal}.code-snippet__type,.code-snippet__class .code-snippet__title{color:#0e9ce5}.code-snippet__tag,.code-snippet__name,.code-snippet__attribute{color:#0e9ce5;font-weight:normal}.code-snippet__regexp,.code-snippet__link{color:#ca7d37}.code-snippet__symbol,.code-snippet__bullet{color:#d14}.code-snippet__built_in,.code-snippet__builtin-name{color:#ca7d37}.code-snippet__meta{color:#afafaf}.code-snippet__deletion{background:#fdd}.code-snippet__addition{background:#dfd}.code-snippet__emphasis{font-style:italic}.code-snippet__strong{font-weight:bold}.account_avatar{width:40px;height:40px;padding:0;}.account_info{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;padding:20px 0;align-items:center}.flex_bd{padding-left:14px;}.account_nickname{display:inline-block;vertical-align:middle;line-height:1.2;color:#576b95;font-size:14px}.account_desc{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;color:rgba(0,0,0,0.3);font-size:14px;line-height:1.2;padding-top:.4em}.msg_source_url{text-align:left;word-break:break-all;margin-top:20px;}.msg_source_url a{padding-right:10px;}.msg_source_url .url_text{color:#a8a8a8;}.video-desc{font-size:14px;margin-top:15px;color:#6c6c6c;}.msg_source_url{text-align:left;}.original_primary_card_tips{color:rgba(0,0,0,0.3);line-height:1.4;font-size:15px;}.weui-flex__item{margin-bottom:20px;padding:20px 16px;margin-top:16px;line-height:1.4;align-items:center;background-color:#f7f7f7;border-radius:8px;position:relative;}.original_primary_desc{color:rgba(0,0,0,0.5);font-size:14px;padding-top:4px;width:auto;overflow:hidden;text-overflow:ellipsis;}.msgBodyReplyList{border-top:1px solid #e1e1e1;margin-top:10px;}.msgBodyReplyListTop{border-top:0;}.reply_like_num{float:right;font-size:14px;color:#c7c7c7;}.msgData{margin-top:20px;color:#626262;}.msgData span{font-size:14px;padding-right:15px;}.msgData .likes{float:right;padding-right:0;}.js_text_content p{font-size:18px;}.rich_media_meta_link{font-size:15px;}blockquote {padding-left: 10px;border-left: 3px solid #dbdbdb;color: rgba(0,0,0,0.5);font-size: 15px;padding-top: 4px;margin: 1em 0;}.video_iframe{width:500px;height:400px;}.blockquote_info{color:#b5b5b5;margin-top:10px;}#copyright_logo{color:#bdbdbd;}.rich_media_meta_list{margin-bottom:10px;}.reprint{background:#efefef;border-radius:5px;padding:8px;color:#1f1f1f;}.reprint a{word-break:break-all;}.topic{color:#8e8e8e;background:#f7f7f7;border-radius:5px;padding:10px 8px;}.topic a{padding-right:5px;}.topic p{margin-bottom:5px;}\n<\/style>\n<link href=\"https:\/\/www.juyifx.cn\/config\/css\/wxArticle.css\" rel=\"stylesheet\"\/>\n<\/head><script>\nvar data={\"mp\":\"\u751f\u4fe1\u679c\",\"title\":\"\u57fa\u56e0\u7ef4\u5ea6\u592a\u9ad8\u600e\u4e48\u529e\uff1f\u65e0\u6240\u8c13\uff01PCA\u964d\u7ef4\u4f1a\u51fa\u624b\uff01\",\"time\":\"2023-06-16 19:04:02\",\"timeStamp\":\"1686913442\"};\n<\/script><br \/>\n<body><\/p>\n<div class=\"rich_media\">\n<h1 class=\"rich_media_title\" id=\"activity-name\"><a href=\"http:\/\/mp.weixin.qq.com\/s?__biz=Mzg3OTg3MjQyNg==&#038;mid=2247488459&#038;idx=2&#038;sn=5856888f0c879f1d2989c47da08cb064&#038;chksm=cf7c830ef80b0a1865b8bc9efd54d6726e1b34a3f4b44bf312c19e3f1c0c38eacd6428bb6897#rd\" target=\"_blank\" rel=\"noopener\">\u57fa\u56e0\u7ef4\u5ea6\u592a\u9ad8\u600e\u4e48\u529e\uff1f\u65e0\u6240\u8c13\uff01PCA\u964d\u7ef4\u4f1a\u51fa\u624b\uff01<\/a><\/h1>\n<div id=\"meta_content\" class=\"rich_media_meta_list\"><span class=\"rich_media_meta rich_media_meta_text\">\u5c0f\u5e08\u59b9&nbsp;&nbsp;<\/span><span class=\"rich_media_meta rich_media_meta_nickname\" id=\"profileBt\"><a href=\"javascript:void(0);\" class=\"wx_tap_link js_wx_tap_highlight weui-wa-hotarea\" id=\"js_name\">\u751f\u4fe1\u679c&nbsp;&nbsp;<\/a><\/span><em id=\"publish_time\" class=\"rich_media_meta rich_media_meta_text\">2023-06-16 19:04:02<\/em><\/div>\n<p><content><\/p>\n<div class=\"reprint\">\n<p>\u8f6c\u81ea\u516c\u4f17\u53f7\uff1aR\u8bed\u8a00\u5b66\u5f92<br \/><a href=\"http:\/\/mp.weixin.qq.com\/s?__biz=Mzg5MDk3Mzg4OA==&#038;mid=2247483989&#038;idx=1&#038;sn=73f72841c3366f8d7a222dacd805acbc\" target=\"_blank\" title=\"\u9605\u8bfb\u539f\u6587\" rel=\"noopener\">http:\/\/mp.weixin.qq.com\/s?__biz=Mzg5MDk3Mzg4OA==&#038;mid=2247483989&#038;idx=1&#038;sn=73f72841c3366f8d7a222dacd805acbc<\/a><\/p>\n<\/div>\n<section style=\"font-size: 16px;margin-bottom: 24px;\">\n<section style=\"text-align: left;justify-content: flex-start;display: flex;flex-flow: row nowrap;margin-top: 20px;margin-bottom: 25px;\" powered-by=\"xiumi.us\">\n<section style=\"display: inline-block;width: auto;vertical-align: top;align-self: flex-start;flex: 0 0 auto;min-width: 5%;height: auto;background-color: rgb(249, 172, 172);box-shadow: rgb(249, 172, 172) 0px 0px 5px 3px;\">\n<section style=\"text-align: center;transform: translate3d(2px, 0px, 0px);margin-top: -14px;margin-bottom: -14px;\" powered-by=\"xiumi.us\">\n<p>{ \u70b9\u51fb\u84dd\u5b57\uff0c\u5173\u6ce8\u6211\u4eec }<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section powered-by=\"xiumi.us\">\n<p style=\"white-space: normal;\">\u5728RNA-seq\u5b9e\u9a8c\u4e2d\uff0c\u6211\u4eec\u901a\u5e38\u4f1a\u83b7\u5f97\u5927\u91cf\u7684\u57fa\u56e0\u8868\u8fbe\u6570\u636e\uff0c\u6bcf\u4e2a\u6837\u672c\u90fd\u5305\u542b\u6570\u5343\u4e2a\u57fa\u56e0\u7684\u8868\u8fbe\u91cf\u3002\u8fd9\u4e9b\u6570\u636e\u975e\u5e38\u590d\u6742\uff0c\u96be\u4ee5\u76f4\u63a5\u5206\u6790\u548c\u7406\u89e3\u3002\u800cPCA\uff08Principal Component Analysis\uff09\u4e3b\u6210\u5206\u5206\u6790\u53ef\u4ee5\u5c06\u8fd9\u4e9b\u590d\u6742\u7684\u6570\u636e\u964d\u7ef4\u5230\u8f83\u4f4e\u7684\u7ef4\u5ea6\uff0c\u5e76\u53ef\u89c6\u5316\u6210\u4e8c\u7ef4\u6216\u4e09\u7ef4\u56fe\u5f62\uff0c\u4ece\u800c\u66f4\u597d\u5730\u7406\u89e3\u6570\u636e\u7684\u7ed3\u6784\u548c\u6a21\u5f0f\u3002<br  \/><\/p>\n<p style=\"white-space: normal;\"><br  \/><\/p>\n<p style=\"white-space: normal;\">PCA\u7684\u6838\u5fc3\u662f\u9009\u62e9\u65b0\u7684\u5750\u6807\u7cfb\uff08\u4e3b\u6210\u5206\uff09\uff0c\u5750\u6807\u8f74\u5782\u76f4\uff08\u4e5f\u5c31\u662f\u6b63\u4ea4\uff0c\u7ebf\u6027\u65e0\u5173\uff09\uff0c\u65b9\u5dee\u8db3\u591f\u5927\uff08\u4e3a\u4e86\u4f7f\u6570\u636e\u5728\u5750\u6807\u8f74\u7684\u6295\u5c04\u70b9\u5c3d\u53ef\u80fd\u7684\u5e7f\uff0c\u663e\u793a\u51fa\u66f4\u591a\u6570\u636e\u7279\u5f81\uff09<\/p>\n<p style=\"white-space: normal;\"><br  \/><\/p>\n<p style=\"white-space: normal;\"><strong>\u5728RNA-seq\u4e2d\uff0cPCA\u53ef\u4ee5\u7528\u4e8e\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762\uff1a<\/strong><\/p>\n<p style=\"white-space: normal;\"><br  \/><\/p>\n<p style=\"white-space: normal;\"><strong><span style=\"color: rgb(249, 110, 87);\">\u6570\u636e\u964d\u7ef4<\/span><\/strong>\uff1a\u901a\u8fc7PCA\u53ef\u4ee5\u5c06\u9ad8\u7ef4\u7684RNA-seq\u6570\u636e\u964d\u7ef4\u5230\u8f83\u4f4e\u7684\u7ef4\u5ea6\uff0c\u540c\u65f6\u4fdd\u7559\u6570\u636e\u7684\u5927\u90e8\u5206\u53d8\u5f02\u6027\u3002\u8fd9\u6837\u53ef\u4ee5\u51cf\u5c11\u6570\u636e\u7684\u566a\u58f0\u548c\u5197\u4f59\u4fe1\u606f\uff0c\u4ece\u800c\u66f4\u597d\u5730\u5c55\u73b0\u6570\u636e\u7684\u4e3b\u8981\u7279\u5f81\u3002<\/p>\n<p style=\"white-space: normal;\"><br  \/><\/p>\n<p style=\"white-space: normal;\"><strong><span style=\"color: rgb(249, 110, 87);\">\u53ef\u89c6\u5316<\/span><\/strong>\uff1a\u901a\u8fc7PCA\u53ef\u4ee5\u5c06RNA-seq\u6570\u636e\u53ef\u89c6\u5316\u4e3a\u4e8c\u7ef4\u6216\u4e09\u7ef4\u56fe\u5f62\uff0c\u4ece\u800c\u66f4\u597d\u5730\u7406\u89e3\u6570\u636e\u7684\u7ed3\u6784\u548c\u6a21\u5f0f\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u4e0d\u540c\u6837\u672c\u4e4b\u95f4\u7684\u57fa\u56e0\u8868\u8fbe\u91cf\u7ed8\u5236\u6210\u4e00\u4e2a\u6563\u70b9\u56fe\uff0c\u4e0d\u540c\u6837\u672c\u7684\u8868\u8fbe\u6a21\u5f0f\u5c31\u53ef\u4ee5\u5728\u56fe\u5f62\u4e2d\u5448\u73b0\u51fa\u6765\u3002<\/p>\n<p style=\"white-space: normal;\"><br  \/><\/p>\n<p style=\"white-space: normal;\"><strong><span style=\"color: rgb(249, 110, 87);\">\u6570\u636e\u63a2\u7d22<\/span><\/strong>\uff1a\u901a\u8fc7PCA\u53ef\u4ee5\u53d1\u73b0RNA-seq\u6570\u636e\u7684\u76f8\u5173\u6027\u548c\u5dee\u5f02\u6027\uff0c\u5e2e\u52a9\u6211\u4eec\u53d1\u73b0\u4e0d\u540c\u6837\u672c\u4e4b\u95f4\u7684\u5dee\u5f02\u548c\u5171\u540c\u70b9\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u53ef\u4ee5\u5206\u6790PCA\u56fe\u4e2d\u7684\u6bcf\u4e2a\u4e3b\u6210\u5206\uff0c\u627e\u51fa\u5bf9\u5dee\u5f02\u6027\u6700\u5927\u7684\u57fa\u56e0\uff0c\u8fdb\u4e00\u6b65\u7814\u7a76\u8fd9\u4e9b\u57fa\u56e0\u7684\u751f\u7269\u5b66\u529f\u80fd\u548c\u76f8\u5173\u75be\u75c5\u3002<\/p>\n<p style=\"white-space: normal;\"><br  \/><\/p>\n<p style=\"white-space: normal;\">\u6211\u4eec\u968f\u673a\u751f\u6210\u4e24\u7ec4\u6a21\u62df\u57fa\u56e0\u6570\u636e\uff0c\u5e76\u8fdb\u884cPCA\u964d\u7ef4\u3002<\/p>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"r\"><code><span class=\"code-snippet_outer\">set.seed(<span class=\"code-snippet__number\">123<\/span>)<\/span><\/code><code><span class=\"code-snippet_outer\">n &lt;- 100<\/span><\/code><code><span class=\"code-snippet_outer\">mean_A &lt;- 5<\/span><\/code><code><span class=\"code-snippet_outer\">sd_A &lt;- 2<\/span><\/code><code><span class=\"code-snippet_outer\">mean_B &lt;- 8<\/span><\/code><code><span class=\"code-snippet_outer\">sd_B &lt;- 2<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">gene_data_A &lt;- matrix(rnorm(n * <span class=\"code-snippet__number\">5<\/span>, mean = mean_A, sd = sd_A), nrow = <span class=\"code-snippet__number\">50<\/span>, ncol = <span class=\"code-snippet__number\">10<\/span>)<\/span><\/code><code><span class=\"code-snippet_outer\">gene_data_B &lt;- matrix(rnorm(n * <span class=\"code-snippet__number\">5<\/span>, mean = mean_B, sd = sd_B), nrow = <span class=\"code-snippet__number\">50<\/span>, ncol = <span class=\"code-snippet__number\">10<\/span>)<\/span><\/code><code><span class=\"code-snippet_outer\">gene_data &lt;- rbind(gene_data_A, gene_data_B)<\/span><\/code><code><span class=\"code-snippet_outer\">colnames(gene_data) &lt;- paste0(<span class=\"code-snippet__string\">\"Gene\"<\/span>, <span class=\"code-snippet__number\">1<\/span>:<span class=\"code-snippet__number\">10<\/span>)<\/span><\/code><code><span class=\"code-snippet_outer\">rownames(gene_data) &lt;- <span class=\"code-snippet__number\">1<\/span>:nrow(gene_data)<\/span><\/code><code><span class=\"code-snippet_outer\">group &lt;- data.frame(Sample = <span class=\"code-snippet__number\">1<\/span>:nrow(gene_data), Group = <span class=\"code-snippet__built_in\">rep<\/span>(<span class=\"code-snippet__built_in\">c<\/span>(<span class=\"code-snippet__string\">\"GroupA\"<\/span>, <span class=\"code-snippet__string\">\"GroupB\"<\/span>), each = <span class=\"code-snippet__number\">50<\/span>))<\/span><\/code><\/pre>\n<\/section>\n<p style=\"white-space: normal;\" powered-by=\"xiumi.us\">\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528FactoMineR \u5305\u8c03\u7528PCA\u3002FactoMineR\u662f\u4e00\u4e2a\u7528\u4e8e\u591a\u5143\u63a2\u7d22\u6027\u6570\u636e\u5206\u6790\u548c\u6570\u636e\u6316\u6398\u7684R\u5305\u3002\u5b83\u4e3a\u591a\u7ef4\u6570\u636e\u7684\u964d\u7ef4\u3001\u805a\u7c7b\u548c\u53ef\u89c6\u5316\u63d0\u4f9b\u4e86\u5e7f\u6cdb\u7684\u65b9\u6cd5\u3002<\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"r\"><code><span class=\"code-snippet_outer\">gene.pca &lt;- PCA(gene_data, ncp = <span class=\"code-snippet__number\">2<\/span>, scale.unit = <span class=\"code-snippet__literal\">TRUE<\/span>, graph = <span class=\"code-snippet__literal\">FALSE<\/span>)<\/span><\/code><\/pre>\n<\/section>\n<p style=\"white-space: normal;\" powered-by=\"xiumi.us\">\u4f7f\u7528PCA\u964d\u7ef4\uff0c\u63d0\u53d6\u8d21\u732e\u5ea6\u6700\u9ad8\u7684\u4e24\u4e2a\u7279\u5f81<\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"r\"><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__comment\">#\u63d0\u53d6\u6837\u672c\u5728 PCA \u524d\u4e24\u8f74\u4e2d\u7684\u5750\u6807<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">pca_sample &lt;- data.frame(gene.pca$ind$coord[ ,<span class=\"code-snippet__number\">1<\/span>:<span class=\"code-snippet__number\">2<\/span>])<\/span><\/code><code><span class=\"code-snippet_outer\">pca_sample$Sample=row.names(pca_sample)<\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__comment\">#\u63d0\u53d6 PCA \u524d\u4e24\u8f74\u7684\u8d21\u732e\u5ea6<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">pca_eig1 &lt;- <span class=\"code-snippet__built_in\">round<\/span>(gene.pca$eig[<span class=\"code-snippet__number\">1<\/span>,<span class=\"code-snippet__number\">2<\/span>], <span class=\"code-snippet__number\">2<\/span>)<\/span><\/code><code><span class=\"code-snippet_outer\">pca_eig2 &lt;- <span class=\"code-snippet__built_in\">round<\/span>(gene.pca$eig[<span class=\"code-snippet__number\">2<\/span>,<span class=\"code-snippet__number\">2<\/span>],<span class=\"code-snippet__number\">2<\/span> )<\/span><\/code><\/pre>\n<\/section>\n<p style=\"white-space: normal;\" powered-by=\"xiumi.us\">\u5bf9\u964d\u7ef4\u7ed3\u679c\u8fdb\u884c\u53ef\u89c6\u5316<\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"r\"><code><span class=\"code-snippet_outer\">pca_sample &lt;- merge(pca_sample, group,by=<span class=\"code-snippet__string\">\"Sample\"<\/span>)<\/span><\/code><code><span class=\"code-snippet_outer\">head(pca_sample)<\/span><\/code><code><span class=\"code-snippet_outer\">p &lt;- ggplot(data = pca_sample, aes(x = Dim.1, y = Dim.2)) +<\/span><\/code><code><span class=\"code-snippet_outer\">geom_point(aes(color = Group), size = <span class=\"code-snippet__number\">2<\/span>) + &nbsp;<span class=\"code-snippet__comment\">#\u6839\u636e\u6837\u672c\u5750\u6807\u7ed8\u5236\u4e8c\u7ef4\u6563\u70b9\u56fe<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">scale_color_manual(values = <span class=\"code-snippet__built_in\">c<\/span>(<span class=\"code-snippet__string\">'orange'<\/span>, <span class=\"code-snippet__string\">'purple'<\/span>)) + &nbsp;<span class=\"code-snippet__comment\">#\u81ea\u5b9a\u4e49\u989c\u8272<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">theme(panel.grid = element_blank(), panel.background = element_rect(color = <span class=\"code-snippet__string\">'black'<\/span>, fill = <span class=\"code-snippet__string\">'transparent'<\/span>),<\/span><\/code><code><span class=\"code-snippet_outer\">legend.key = element_rect(fill = <span class=\"code-snippet__string\">'transparent'<\/span>)) + &nbsp;<span class=\"code-snippet__comment\">#\u53bb\u9664\u80cc\u666f\u548c\u7f51\u683c\u7ebf<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">labs(x = &nbsp;paste(<span class=\"code-snippet__string\">'PCA1:'<\/span>, pca_eig1, <span class=\"code-snippet__string\">'%'<\/span>), y = paste(<span class=\"code-snippet__string\">'PCA2:'<\/span>, pca_eig2, <span class=\"code-snippet__string\">'%'<\/span>), color = <span class=\"code-snippet__string\">''<\/span>) &nbsp;<span class=\"code-snippet__comment\">#\u5c06 PCA \u8f74\u8d21\u732e\u5ea6\u6dfb\u52a0\u5230\u5750\u6807\u8f74\u6807\u9898\u4e2d<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">p<\/span><\/code><code><span class=\"code-snippet_outer\">p + stat_ellipse(aes(color = Group), level = <span class=\"code-snippet__number\">0.95<\/span>, show.legend = <span class=\"code-snippet__literal\">FALSE<\/span>)<\/span><\/code><code><span class=\"code-snippet_outer\">p + stat_ellipse(aes(fill = Group), geom = <span class=\"code-snippet__string\">'polygon'<\/span>, level = <span class=\"code-snippet__number\">0.95<\/span>, alpha = <span class=\"code-snippet__number\">0.3<\/span>, show.legend = <span class=\"code-snippet__literal\">FALSE<\/span>) +<\/span><\/code><code><span class=\"code-snippet_outer\">scale_fill_manual(values = <span class=\"code-snippet__built_in\">c<\/span>(<span class=\"code-snippet__string\">'orange'<\/span>, <span class=\"code-snippet__string\">'purple'<\/span>))<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;\" powered-by=\"xiumi.us\">\n<section style=\"vertical-align: middle;display: inline-block;line-height: 0;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.7045929018789144\" src=\"http:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/1_z8eAFtm0qH9oj5FKnqicVOKdXCibSg.png\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/oCSOtP61aEWaOVp4oK5ibDkBelm3NzicicQLtFC0YNLByA2c2WqnOcUveZiaNicz8eAFtm0qH9oj5FKnqicVOKdXCibSg\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"958\" style=\"vertical-align: middle;width: 100%;\"  \/><\/section>\n<\/section>\n<p style=\"white-space: normal;\" powered-by=\"xiumi.us\">\u8fd9\u5c31\u662f\u4f7f\u7528R\u5bf9\u591a\u7ef4\u7684\u57fa\u56e0\u6570\u636e\u8fdb\u884cPCA\u7684\u8fc7\u7a0b\u5566\uff0c\u662f\u4e0d\u662f\u975e\u5e38\u7b80\u5355\uff01\u5feb\u548c\u5c0f\u5e08\u59b9\u4e00\u8d77\u8bd5\u8bd5\u5427\uff01<\/p>\n<section style=\"text-align: center;justify-content: center;display: flex;flex-flow: row nowrap;margin-top: 10px;margin-bottom: 10px;\" powered-by=\"xiumi.us\">\n<section style=\"display: inline-block;vertical-align: middle;width: auto;flex: 100 100 0%;height: auto;align-self: center;margin-right: 10px;\">\n<section style=\"margin-top: 10px;margin-bottom: 10px;\" powered-by=\"xiumi.us\">\n<section style=\"background-color: rgb(249, 172, 172);height: 1px;\"><svg viewbox=\"0 0 1 1\" style=\"float:left;line-height:0;width:0;vertical-align:top;\"><\/svg><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block;vertical-align: middle;width: auto;align-self: center;flex: 0 0 auto;min-width: 5%;height: auto;border-style: solid;border-width: 1px;border-color: rgb(249, 172, 172);padding-right: 8px;padding-left: 8px;margin-right: 10px;\">\n<section style=\"text-align: justify;color: rgb(249, 172, 172);\" powered-by=\"xiumi.us\">\n<p style=\"white-space: normal;\">E<\/p>\n<\/section>\n<\/section>\n<section style=\"display: inline-block;vertical-align: middle;width: auto;align-self: center;flex: 0 0 auto;min-width: 5%;height: auto;border-style: solid;border-width: 1px;border-color: rgb(249, 172, 172);padding-right: 8px;padding-left: 8px;margin-right: 10px;\">\n<section style=\"text-align: justify;color: rgb(249, 172, 172);\" powered-by=\"xiumi.us\">\n<p style=\"white-space: normal;\">N<\/p>\n<\/section>\n<\/section>\n<section style=\"display: inline-block;vertical-align: middle;width: auto;align-self: center;flex: 0 0 auto;min-width: 5%;height: auto;border-style: solid;border-width: 1px;border-color: rgb(249, 172, 172);padding-right: 8px;padding-left: 8px;margin-right: 10px;\">\n<section style=\"text-align: justify;color: rgb(249, 172, 172);\" powered-by=\"xiumi.us\">\n<p style=\"white-space: normal;\">D<\/p>\n<\/section>\n<\/section>\n<section style=\"display: inline-block;vertical-align: middle;width: auto;align-self: center;flex: 100 100 0%;height: auto;\">\n<section style=\"margin-top: 10px;margin-bottom: 10px;\" powered-by=\"xiumi.us\">\n<section style=\"background-color: rgb(249, 172, 172);height: 1px;\"><svg viewbox=\"0 0 1 1\" style=\"float:left;line-height:0;width:0;vertical-align:top;\"><\/svg><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"text-align: center;margin-bottom: 24px;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-galleryid=\"\" data-ratio=\"0.5555555555555556\" data-s=\"300,640\" src=\"http:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/2_icWAmgGMVEzREAJmM59ov44ziaMCGg-5.jpg\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_jpg\/oCSOtP61aEWjRWAeR9wicY9JyrK13cNBaR2PPYHOsBTrS4rJOUOnJCEIxt1icWAmgGMVEzREAJmM59ov44ziaMCGg\/640?wx_fmt=jpeg'\" data-type=\"jpeg\" data-w=\"900\" style=\"\"  \/><\/p>\n<p style=\"display: none;margin-bottom: 24px;\"><mp-style-type data-value=\"3\"><\/mp-style-type><\/p>\n<p><\/content>\n<\/div>\n<p><\/body><br \/>\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u57fa\u56e0\u7ef4\u5ea6\u592a\u9ad8\u600e\u4e48\u529e\uff1f\u65e0\u6240\u8c13\uff01PCA\u964d\u7ef4\u4f1a\u51fa\u624b\uff01 \u5c0f\u5e08\u59b9&nbsp;&nbsp;\u751f\u4fe1\u679c&nbsp;&nbsp;2 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":""},"categories":[1],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/55181"}],"collection":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=55181"}],"version-history":[{"count":1,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/55181\/revisions"}],"predecessor-version":[{"id":55184,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/55181\/revisions\/55184"}],"wp:attachment":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=55181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=55181"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=55181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}