{"id":29233,"date":"2024-02-22T17:50:32","date_gmt":"2024-02-22T09:50:32","guid":{"rendered":"http:\/\/www.biocloudservice.com\/wordpress\/?p=29233"},"modified":"2024-02-22T17:50:33","modified_gmt":"2024-02-22T09:50:33","slug":"%e5%8d%95%e7%bb%86%e8%83%9e%e6%95%b0%e6%8d%aemarker%e5%9f%ba%e5%9b%a0%e5%b0%8f%e6%8f%90%e7%90%b4%e5%9b%be%e7%bb%98%e5%88%b6","status":"publish","type":"post","link":"http:\/\/www.biocloudservice.com\/wordpress\/?p=29233","title":{"rendered":"\u5355\u7ec6\u80de\u6570\u636emarker\u57fa\u56e0\u5c0f\u63d0\u7434\u56fe\u7ed8\u5236"},"content":{"rendered":"<p>\u5355\u7ec6\u80de\u6570\u636emarker\u57fa\u56e0\u5c0f\u63d0\u7434\u56fe\u7ed8\u5236<\/p>\n<p>\u4eca\u5929\u5c0f\u679c\u60f3\u901a\u8fc7\u5355\u7ec6\u80de\u6570\u636emarker\u57fa\u56e0\u8868\u8fbe\u91cf\u6570\u636e\u6765\u7ed8\u5236\u5206\u9762\u5c0f\u63d0\u7434\u56fe\uff0c\u901a\u8fc7\u5c0f\u63d0\u7434\u56fe\u6765\u5c55\u793amarker\u57fa\u56e0\u5728\u4e0d\u540c\u7ec6\u80de\u7fa4\u4e2d\u7684\u5206\u5e03\u60c5\u51b5\uff0c\u5e76\u505a\u4e86\u663e\u8457\u6027\u5206\u6790\uff0c\u8bdd\u4e0d\u591a\u8bf4\u5f00\u59cb\u4eca\u5929\u7684\u5206\u4eab\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\n  \u5b89\u88c5\u9700\u8981\u7684R\u5305<\/li>\n<\/ol>\n<p>install.packages(\u201cggplot2\u201d)<\/p>\n<p>install.packages(\u201cggsci\u201d)<\/p>\n<p>install.packages(\u201cggpubr\u201d)<\/p>\n<p>install.packages(\u201crstatix\u201d)<\/p>\n<p>install.packafes(\u201ctidyverse\u201d)<\/p>\n<ol>\n<li>\n  \u8f7d\u5165\u9700\u8981\u7684R\u5305<\/li>\n<\/ol>\n<p>library(ggplot2)<\/p>\n<p>library(ggsci)<\/p>\n<p>library(ggpubr)<\/p>\n<p>library(rstatix)<\/p>\n<p>library(tidyverse)<\/p>\n<ol>\n<li>\n  \u793a\u4f8b\u6570\u636e<\/li>\n<\/ol>\n<p>df &lt;- read.csv(&#8220;scviolin.csv&#8221;, header = T)<\/p>\n<p># \u6309\u81ea\u5df1\u7684\u8981\u6c42\u6392\u5e8f\uff0c\u8be5\u987a\u5e8f\u5bf9\u5e94\u56fe\u4e2d\u7684\u987a\u5e8f<\/p>\n<p>df$aging &lt;- factor(df$aging, levels = c(&#8220;Y&#8221;, &#8220;O&#8221;))<\/p>\n<p>df$cluster_short &lt;- factor(df$cluster_short, levels = c(&#8220;OO&#8221;,&#8221;GC&#8221;, &#8220;SC&#8221;, &#8220;SMC&#8221;,  &#8220;EC&#8221;, &#8220;NKT&#8221;, &#8220;M&#8221;))<\/p>\n<p>df$gene &lt;- factor(df$gene, levels = c(&#8220;DDX4&#8221;, &#8220;AMH&#8221;, &#8220;COL1A2&#8221;, &#8220;ACTG2&#8221;, &#8220;CDH5&#8221;, &#8220;KLRB1&#8221;, &#8220;CD163&#8221;))<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"314\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309134908.jpeg?resize=640%2C314\" class=\"wp-image-29234\" alt=\"Dingtalk_20230309134908\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309134908.jpeg?w=1009 1009w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309134908.jpeg?resize=300%2C147 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309134908.jpeg?resize=768%2C377 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309134908.jpeg?resize=600%2C294 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<ol>\n<li>\n  \u7ed8\u56fe\u4ee3\u7801<\/li>\n<\/ol>\n<p>#\u663e\u8457\u6027\u5206\u6790<\/p>\n<p>stat.test &lt;- df %&gt;%<\/p>\n<p>group_by(cluster_short, gene) %&gt;%<\/p>\n<p>t_test(expression ~ aging) %&gt;%<\/p>\n<p>adjust_pvalue(method = &#8220;bonferroni&#8221;) %&gt;%<\/p>\n<p>add_significance()<\/p>\n<p>stat.test &lt;- stat.test %&gt;% add_xy_position(x = &#8220;aging&#8221;)<\/p>\n<p>#\u5f00\u59cb\u7ed8\u56fe<\/p>\n<p>p1 &lt;- ggviolin(df, x = &#8220;aging&#8221;, y = &#8220;expression&#8221;,<\/p>\n<p>fill = &#8220;aging&#8221;,<\/p>\n<p>facet = c(&#8220;gene&#8221;,&#8221;cluster_short&#8221;)) + #\u5206\u9762<\/p>\n<p>scale_fill_npg() +<\/p>\n<p>xlab(&#8220;&#8221;) +<\/p>\n<p>ylab(&#8220;Expression&#8221;) +<\/p>\n<p>theme(panel.grid = element_blank(),<\/p>\n<p>strip.text.y = element_text(angle = 0),<\/p>\n<p>strip.background.x = element_rect(fill = &#8220;grey95&#8221;), # \u9876\u90e8\u586b\u5145\u6d45\u7070\u8272<\/p>\n<p>strip.background.y = element_blank())<\/p>\n<p>p1 +<\/p>\n<p>stat_pvalue_manual(stat.test,<\/p>\n<p>bracket.nudge.y = 1,<\/p>\n<p>hide.ns = TRUE, #\u4e0d\u663e\u793a\u4e0d\u663e\u8457\u7684<\/p>\n<p>label = &#8220;{p.adj}{p.adj.signif}&#8221;, # pvalue\u548c\u661f\u6807<\/p>\n<p>label.size = 3, # pvalue\u5b57\u7684\u5927\u5c0f<\/p>\n<p>vjust = -0.5) + # pvalue\u7684\u4e0a\uff08\u8d1f\uff09\u4e0b\u4f4d\u7f6e<\/p>\n<p>scale_y_continuous(expand = expansion(mult = c(0, 0.1))) #\u7ed9pvalue\u6587\u5b57\u7559\u8db3\u7a7a\u95f4<\/p>\n<p>ggsave(&#8220;scViolin.pdf&#8221;, width = 9, height = 9)<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"635\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309140700.jpeg?resize=640%2C635\" class=\"wp-image-29235\" alt=\"Dingtalk_20230309140700\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309140700.jpeg?w=684 684w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309140700.jpeg?resize=300%2C298 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309140700.jpeg?resize=150%2C150 150w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309140700.jpeg?resize=600%2C596 600w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309140700.jpeg?resize=100%2C100 100w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>\u5c0f\u679c\u6700\u7ec8\u7ed8\u5236\u51fa\u4e86\u8fd9\u5f20\u6f02\u4eae\u7684\u5c0f\u63d0\u7434\u56fe\uff0c\u770b\u8d77\u6765\u6548\u679c\u8fd8\u4e0d\u9519\u5965\uff0c\u5728\u8fd9\u91cc\u5b89\u5229\u4e00\u4e0b\u5965\uff0c\u672c\u516c\u53f8\u670d\u52a1\u5668\u5df2\u7ecf\u5b89\u88c5\u597d\u76f8\u5173\u5355\u7ec6\u80de\u6570\u636e\u5206\u6790\u7684R\u5305\u548c\u8f6f\u4ef6\uff0c\u6709\u9700\u8981\u7684\u53ef\u4ee5\u8054\u7cfb\u5c0f\u679c\uff0c\u672c\u671f\u7684\u5206\u4eab\u5c31\u5230\u8fd9\u91cc\u4e0b\u671f\u5728\u89c1\u5965\u3002<\/p>\n<p>\n  \u5355\u7ec6\u80de\u6570\u636emarker\u57fa\u56e0\u5c0f\u63d0\u7434\u56fe\u7ed8\u5236\n<\/p>\n<p>\n  \u4eca\u5929\u5c0f\u679c\u60f3\u901a\u8fc7\u5355\u7ec6\u80de\u6570\u636emarker\u57fa\u56e0\u8868\u8fbe\u91cf\u6570\u636e\u6765\u7ed8\u5236\u5206\u9762\u5c0f\u63d0\u7434\u56fe\uff0c\u901a\u8fc7\u5c0f\u63d0\u7434\u56fe\u6765\u5c55\u793amarker\u57fa\u56e0\u5728\u4e0d\u540c\u7ec6\u80de\u7fa4\u4e2d\u7684\u5206\u5e03\u60c5\u51b5\uff0c\u5e76\u505a\u4e86\u663e\u8457\u6027\u5206\u6790\uff0c\u8bdd\u4e0d\u591a\u8bf4\u5f00\u59cb\u4eca\u5929\u7684\u5206\u4eab\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a\n<\/p>\n<ol>\n<li>\n  \u5b89\u88c5\u9700\u8981\u7684R\u5305\n<\/li>\n<\/ol>\n<p>\n  install.packages(\u201cggplot2\u201d)\n<\/p>\n<p>\n  install.packages(\u201cggsci\u201d)\n<\/p>\n<p>\n  install.packages(\u201cggpubr\u201d)\n<\/p>\n<p>\n  install.packages(\u201crstatix\u201d)\n<\/p>\n<p>\n  install.packafes(\u201ctidyverse\u201d)\n<\/p>\n<ol>\n<li>\n  \u8f7d\u5165\u9700\u8981\u7684R\u5305\n<\/li>\n<\/ol>\n<p>\n  library(ggplot2)\n<\/p>\n<p>\n  library(ggsci)\n<\/p>\n<p>\n  library(ggpubr)\n<\/p>\n<p>\n  library(rstatix)\n<\/p>\n<p>\n  library(tidyverse)\n<\/p>\n<ol>\n<li>\n  \u793a\u4f8b\u6570\u636e\n<\/li>\n<\/ol>\n<p>\n  df &lt;- read.csv(&#8220;scviolin.csv&#8221;, header = T)\n<\/p>\n<p>\n  # \u6309\u81ea\u5df1\u7684\u8981\u6c42\u6392\u5e8f\uff0c\u8be5\u987a\u5e8f\u5bf9\u5e94\u56fe\u4e2d\u7684\u987a\u5e8f\n<\/p>\n<p>\n  df$aging &lt;- factor(df$aging, levels = c(&#8220;Y&#8221;, &#8220;O&#8221;))\n<\/p>\n<p>\n  df$cluster_short &lt;- factor(df$cluster_short, levels = c(&#8220;OO&#8221;,&#8221;GC&#8221;, &#8220;SC&#8221;, &#8220;SMC&#8221;,  &#8220;EC&#8221;, &#8220;NKT&#8221;, &#8220;M&#8221;))\n<\/p>\n<p>\n  df$gene &lt;- factor(df$gene, levels = c(&#8220;DDX4&#8221;, &#8220;AMH&#8221;, &#8220;COL1A2&#8221;, &#8220;ACTG2&#8221;, &#8220;CDH5&#8221;, &#8220;KLRB1&#8221;, &#8220;CD163&#8221;))\n<\/p>\n<p>\n  <img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"314\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309134908-1.jpeg?resize=640%2C314\" class=\"wp-image-29378\" alt=\"Dingtalk_20230309134908\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309134908-1.jpeg?w=1009 1009w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309134908-1.jpeg?resize=300%2C147 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309134908-1.jpeg?resize=768%2C377 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309134908-1.jpeg?resize=600%2C294 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/>\n<\/p>\n<ol>\n<li>\n  \u7ed8\u56fe\u4ee3\u7801\n<\/li>\n<\/ol>\n<p>\n  #\u663e\u8457\u6027\u5206\u6790\n<\/p>\n<p>\n  stat.test &lt;- df %&gt;%\n<\/p>\n<p>\n    group_by(cluster_short, gene) %&gt;%\n<\/p>\n<p>\n    t_test(expression ~ aging) %&gt;%\n<\/p>\n<p>\n    adjust_pvalue(method = &#8220;bonferroni&#8221;) %&gt;%\n<\/p>\n<p>\n    add_significance()\n<\/p>\n<p>\n  stat.test &lt;- stat.test %&gt;% add_xy_position(x = &#8220;aging&#8221;)\n<\/p>\n<p>\n  #\u5f00\u59cb\u7ed8\u56fe\n<\/p>\n<p>\n  p1 &lt;- ggviolin(df, x = &#8220;aging&#8221;, y = &#8220;expression&#8221;,\n<\/p>\n<p>\n                 fill = &#8220;aging&#8221;,\n<\/p>\n<p>\n                 facet = c(&#8220;gene&#8221;,&#8221;cluster_short&#8221;)) + #\u5206\u9762\n<\/p>\n<p>\n    scale_fill_npg() +\n<\/p>\n<p>\n    xlab(&#8220;&#8221;) +\n<\/p>\n<p>\n    ylab(&#8220;Expression&#8221;) +\n<\/p>\n<p>\n    theme(panel.grid = element_blank(),\n<\/p>\n<p>\n          strip.text.y = element_text(angle = 0),\n<\/p>\n<p>\n          strip.background.x = element_rect(fill = &#8220;grey95&#8221;), # \u9876\u90e8\u586b\u5145\u6d45\u7070\u8272\n<\/p>\n<p>\n          strip.background.y = element_blank())\n<\/p>\n<p>\n  p1 +\n<\/p>\n<p>\n    stat_pvalue_manual(stat.test,\n<\/p>\n<p>\n                       bracket.nudge.y = 1,\n<\/p>\n<p>\n                       hide.ns = TRUE, #\u4e0d\u663e\u793a\u4e0d\u663e\u8457\u7684\n<\/p>\n<p>\n                       label = &#8220;{p.adj}{p.adj.signif}&#8221;, # pvalue\u548c\u661f\u6807\n<\/p>\n<p>\n                       label.size = 3, # pvalue\u5b57\u7684\u5927\u5c0f\n<\/p>\n<p>\n                       vjust = -0.5) + # pvalue\u7684\u4e0a\uff08\u8d1f\uff09\u4e0b\u4f4d\u7f6e\n<\/p>\n<p>\n    scale_y_continuous(expand = expansion(mult = c(0, 0.1))) #\u7ed9pvalue\u6587\u5b57\u7559\u8db3\u7a7a\u95f4\n<\/p>\n<p>\n  ggsave(&#8220;scViolin.pdf&#8221;, width = 9, height = 9)\n<\/p>\n<p>\n  <img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"635\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309140700-1.jpeg?resize=640%2C635\" class=\"wp-image-29379\" alt=\"Dingtalk_20230309140700\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309140700-1.jpeg?w=684 684w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309140700-1.jpeg?resize=300%2C298 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309140700-1.jpeg?resize=150%2C150 150w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309140700-1.jpeg?resize=600%2C596 600w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309140700-1.jpeg?resize=100%2C100 100w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/>\n<\/p>\n<p>\n  \u5c0f\u679c\u6700\u7ec8\u7ed8\u5236\u51fa\u4e86\u8fd9\u5f20\u6f02\u4eae\u7684\u5c0f\u63d0\u7434\u56fe\uff0c\u770b\u8d77\u6765\u6548\u679c\u8fd8\u4e0d\u9519\u5965\uff0c\u5728\u8fd9\u91cc\u5b89\u5229\u4e00\u4e0b\u5965\uff0c\u672c\u516c\u53f8\u670d\u52a1\u5668\u5df2\u7ecf\u5b89\u88c5\u597d\u76f8\u5173\u5355\u7ec6\u80de\u6570\u636e\u5206\u6790\u7684R\u5305\u548c\u8f6f\u4ef6\uff0c\u6709\u9700\u8981\u7684\u53ef\u4ee5\u8054\u7cfb\u5c0f\u679c\uff0c\u672c\u671f\u7684\u5206\u4eab\u5c31\u5230\u8fd9\u91cc\u4e0b\u671f\u5728\u89c1\u5965\u3002\n<\/p>\n<p>\n  \u5355\u7ec6\u80de\u6570\u636emarker\u57fa\u56e0\u5c0f\u63d0\u7434\u56fe\u7ed8\u5236\n<\/p>\n<p>\n  \u4eca\u5929\u5c0f\u679c\u60f3\u901a\u8fc7\u5355\u7ec6\u80de\u6570\u636emarker\u57fa\u56e0\u8868\u8fbe\u91cf\u6570\u636e\u6765\u7ed8\u5236\u5206\u9762\u5c0f\u63d0\u7434\u56fe\uff0c\u901a\u8fc7\u5c0f\u63d0\u7434\u56fe\u6765\u5c55\u793amarker\u57fa\u56e0\u5728\u4e0d\u540c\u7ec6\u80de\u7fa4\u4e2d\u7684\u5206\u5e03\u60c5\u51b5\uff0c\u5e76\u505a\u4e86\u663e\u8457\u6027\u5206\u6790\uff0c\u8bdd\u4e0d\u591a\u8bf4\u5f00\u59cb\u4eca\u5929\u7684\u5206\u4eab\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a\n<\/p>\n<ol>\n<li>\n  \u5b89\u88c5\u9700\u8981\u7684R\u5305\n<\/li>\n<\/ol>\n<p>\n  install.packages(\u201cggplot2\u201d)\n<\/p>\n<p>\n  install.packages(\u201cggsci\u201d)\n<\/p>\n<p>\n  install.packages(\u201cggpubr\u201d)\n<\/p>\n<p>\n  install.packages(\u201crstatix\u201d)\n<\/p>\n<p>\n  install.packafes(\u201ctidyverse\u201d)\n<\/p>\n<ol>\n<li>\n  \u8f7d\u5165\u9700\u8981\u7684R\u5305\n<\/li>\n<\/ol>\n<p>\n  library(ggplot2)\n<\/p>\n<p>\n  library(ggsci)\n<\/p>\n<p>\n  library(ggpubr)\n<\/p>\n<p>\n  library(rstatix)\n<\/p>\n<p>\n  library(tidyverse)\n<\/p>\n<ol>\n<li>\n  \u793a\u4f8b\u6570\u636e\n<\/li>\n<\/ol>\n<p>\n  df &lt;- read.csv(&#8220;scviolin.csv&#8221;, header = T)\n<\/p>\n<p>\n  # \u6309\u81ea\u5df1\u7684\u8981\u6c42\u6392\u5e8f\uff0c\u8be5\u987a\u5e8f\u5bf9\u5e94\u56fe\u4e2d\u7684\u987a\u5e8f\n<\/p>\n<p>\n  df$aging &lt;- factor(df$aging, levels = c(&#8220;Y&#8221;, &#8220;O&#8221;))\n<\/p>\n<p>\n  df$cluster_short &lt;- factor(df$cluster_short, levels = c(&#8220;OO&#8221;,&#8221;GC&#8221;, &#8220;SC&#8221;, &#8220;SMC&#8221;,  &#8220;EC&#8221;, &#8220;NKT&#8221;, &#8220;M&#8221;))\n<\/p>\n<p>\n  df$gene &lt;- factor(df$gene, levels = c(&#8220;DDX4&#8221;, &#8220;AMH&#8221;, &#8220;COL1A2&#8221;, &#8220;ACTG2&#8221;, &#8220;CDH5&#8221;, &#8220;KLRB1&#8221;, &#8220;CD163&#8221;))\n<\/p>\n<p>\n  <img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"314\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309134908-2.jpeg?resize=640%2C314\" class=\"wp-image-29380\" alt=\"Dingtalk_20230309134908\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309134908-2.jpeg?w=1009 1009w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309134908-2.jpeg?resize=300%2C147 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309134908-2.jpeg?resize=768%2C377 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309134908-2.jpeg?resize=600%2C294 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/>\n<\/p>\n<ol>\n<li>\n  \u7ed8\u56fe\u4ee3\u7801\n<\/li>\n<\/ol>\n<p>\n  #\u663e\u8457\u6027\u5206\u6790\n<\/p>\n<p>\n  stat.test &lt;- df %&gt;%\n<\/p>\n<p>\n    group_by(cluster_short, gene) %&gt;%\n<\/p>\n<p>\n    t_test(expression ~ aging) %&gt;%\n<\/p>\n<p>\n    adjust_pvalue(method = &#8220;bonferroni&#8221;) %&gt;%\n<\/p>\n<p>\n    add_significance()\n<\/p>\n<p>\n  stat.test &lt;- stat.test %&gt;% add_xy_position(x = &#8220;aging&#8221;)\n<\/p>\n<p>\n  #\u5f00\u59cb\u7ed8\u56fe\n<\/p>\n<p>\n  p1 &lt;- ggviolin(df, x = &#8220;aging&#8221;, y = &#8220;expression&#8221;,\n<\/p>\n<p>\n                 fill = &#8220;aging&#8221;,\n<\/p>\n<p>\n                 facet = c(&#8220;gene&#8221;,&#8221;cluster_short&#8221;)) + #\u5206\u9762\n<\/p>\n<p>\n    scale_fill_npg() +\n<\/p>\n<p>\n    xlab(&#8220;&#8221;) +\n<\/p>\n<p>\n    ylab(&#8220;Expression&#8221;) +\n<\/p>\n<p>\n    theme(panel.grid = element_blank(),\n<\/p>\n<p>\n          strip.text.y = element_text(angle = 0),\n<\/p>\n<p>\n          strip.background.x = element_rect(fill = &#8220;grey95&#8221;), # \u9876\u90e8\u586b\u5145\u6d45\u7070\u8272\n<\/p>\n<p>\n          strip.background.y = element_blank())\n<\/p>\n<p>\n  p1 +\n<\/p>\n<p>\n    stat_pvalue_manual(stat.test,\n<\/p>\n<p>\n                       bracket.nudge.y = 1,\n<\/p>\n<p>\n                       hide.ns = TRUE, #\u4e0d\u663e\u793a\u4e0d\u663e\u8457\u7684\n<\/p>\n<p>\n                       label = &#8220;{p.adj}{p.adj.signif}&#8221;, # pvalue\u548c\u661f\u6807\n<\/p>\n<p>\n                       label.size = 3, # pvalue\u5b57\u7684\u5927\u5c0f\n<\/p>\n<p>\n                       vjust = -0.5) + # pvalue\u7684\u4e0a\uff08\u8d1f\uff09\u4e0b\u4f4d\u7f6e\n<\/p>\n<p>\n    scale_y_continuous(expand = expansion(mult = c(0, 0.1))) #\u7ed9pvalue\u6587\u5b57\u7559\u8db3\u7a7a\u95f4\n<\/p>\n<p>\n  ggsave(&#8220;scViolin.pdf&#8221;, width = 9, height = 9)\n<\/p>\n<p>\n  <img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"635\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309140700-2.jpeg?resize=640%2C635\" class=\"wp-image-29381\" alt=\"Dingtalk_20230309140700\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309140700-2.jpeg?w=684 684w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309140700-2.jpeg?resize=300%2C298 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309140700-2.jpeg?resize=150%2C150 150w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309140700-2.jpeg?resize=600%2C596 600w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230309140700-2.jpeg?resize=100%2C100 100w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/>\n<\/p>\n<p>\n  \u5c0f\u679c\u6700\u7ec8\u7ed8\u5236\u51fa\u4e86\u8fd9\u5f20\u6f02\u4eae\u7684\u5c0f\u63d0\u7434\u56fe\uff0c\u770b\u8d77\u6765\u6548\u679c\u8fd8\u4e0d\u9519\u5965\uff0c\u5728\u8fd9\u91cc\u5b89\u5229\u4e00\u4e0b\u5965\uff0c\u672c\u516c\u53f8\u670d\u52a1\u5668\u5df2\u7ecf\u5b89\u88c5\u597d\u76f8\u5173\u5355\u7ec6\u80de\u6570\u636e\u5206\u6790\u7684R\u5305\u548c\u8f6f\u4ef6\uff0c\u6709\u9700\u8981\u7684\u53ef\u4ee5\u8054\u7cfb\u5c0f\u679c\uff0c\u672c\u671f\u7684\u5206\u4eab\u5c31\u5230\u8fd9\u91cc\u4e0b\u671f\u5728\u89c1\u5965\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5355\u7ec6\u80de\u6570\u636emarker\u57fa\u56e0\u5c0f\u63d0\u7434\u56fe\u7ed8\u5236 \u4eca\u5929\u5c0f\u679c\u60f3\u901a\u8fc7\u5355\u7ec6\u80de\u6570\u636emarker\u57fa\u56e0\u8868\u8fbe\u91cf\u6570\u636e\u6765\u7ed8\u5236\u5206\u9762\u5c0f\u63d0\u7434\u56fe\uff0c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","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\/29233"}],"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=29233"}],"version-history":[{"count":1,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/29233\/revisions"}],"predecessor-version":[{"id":29382,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/29233\/revisions\/29382"}],"wp:attachment":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=29233"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=29233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}