{"id":15919,"date":"2023-10-19T22:07:43","date_gmt":"2023-10-19T14:07:43","guid":{"rendered":"http:\/\/www.biocloudservice.com\/wordpress\/?p=15919"},"modified":"2023-10-19T22:07:44","modified_gmt":"2023-10-19T14:07:44","slug":"sci%e9%83%bd%e5%9c%a8%e4%bd%bf%e7%94%a8%e7%9a%84%e5%8d%95%e5%9f%ba%e5%9b%a0%e5%85%8d%e7%96%ab%e6%b5%b8%e6%b6%a6%e8%bf%98%e4%b8%8d%e4%bc%9a%e5%90%97%ef%bc%9f%e5%b0%8f%e8%8a%b1%e6%89%8b%e6%8a%8a","status":"publish","type":"post","link":"http:\/\/www.biocloudservice.com\/wordpress\/?p=15919","title":{"rendered":"SCI\u90fd\u5728\u4f7f\u7528\u7684\u5355\u57fa\u56e0\u514d\u75ab\u6d78\u6da6\u8fd8\u4e0d\u4f1a\u5417\uff1f\u5c0f\u82b1\u624b\u628a\u624b\u6559\u4f60\u5b66\u4f1a\uff01\uff08\u4e8c\uff09"},"content":{"rendered":"<p>\u5c0f\u82b1\u5728\u4e0a\u7bc7\u6587\u7ae0\u8bf4\u660e\u4e86\u5355\u57fa\u56e0\u7684\u514d\u75ab\u6d78\u6da6\uff0c\u5c31\u662f\u5bf9\u5206\u6790\u67d0\u4e2a\u57fa\u56e0\u4e0e\u514d\u75ab\u7ec6\u80de\u7684\u76f8\u5173\u6027\uff0c\u8fd9\u79cd\u5206\u6790\u65b9\u6cd5\u867d\u7136\u4e0d\u5e38\u89c1\uff0c\u4f46\u662f\u4e5f\u662f\u5728\u9ad8\u5206\u6587\u7ae0\u4e2d\u7ecf\u5e38\u89c1\u5230\u4e00\u5c0f\u90e8\u5206\uff0c\u5176\u5b9e\u8fd8\u6709\u4e00\u79cd\u65b9\u5f0f\uff0c\u5c0f\u4f19\u4f34\u7684\u57fa\u56e0\u592a\u591a\u4e0d\u77e5\u9053\u5982\u4f55\u653e\uff0c\u6216\u8005\u60f3\u628a\u57fa\u56e0\u5f53\u4f5c\u4e00\u4e2a\u6574\u4f53\u8be5\u5982\u4f55\u5206\u6790\u5462\uff1f\u5c0f\u82b1\u8fd9\u91cc\u6709\u4e00\u79cd\u65b9\u6cd5\uff0c\u5c31\u662f\u628a\u6211\u4eec\u57fa\u56e0\u805a\u7c7b\u3002\u4e0d\u540c\u7684\u7ec4\u8fdb\u884c\u5206\u6790\uff0c\u6bcf\u4e2a\u7ec4\u5305\u62ec\u76f8\u5e94\u7684\u57fa\u56e0\u3002\u5c0f\u4f19\u4f34\u662f\u4e0d\u662f\u5f88\u65b0\u5947\uff0c\u6765\u770b\u770b\u5982\u4f55\u53bb\u7ed8\u5236\u5427\uff01<\/p>\n<p>\u539f\u7406\u5176\u5b9e\u5f88\u7b80\u5355\uff0c\u5c0f\u82b1\u4e4b\u95f4\u6559\u8fc7\u5927\u5bb6\u4e00\u81f4\u6027\u805a\u7c7b\uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u7528\u4e00\u81f4\u6027\u805a\u7c7b\u7ed3\u679c\u53bb\u5206\u6790\uff0c<\/p>\n<p>\u6211\u4eec\u5148\u628a\u57fa\u56e0\u805a\u7c7b\uff0c\u8fd9\u91cc\u6211\u4eec\u9700\u8981\u7528\u5230\u4e00\u4e9b\u5305\uff0c\u6ca1\u6709\u7684\u5c0f\u4f19\u4f34\u53bb\u4e0b\u8f7d\u4e00\u4e0b<\/p>\n<p>#install.packages(&#8220;BiocManager&#8221;)<\/p>\n<p>#BiocManager::install(&#8216;ConsensusClusterPlus&#8217;)<\/p>\n<p>library(tidyverse)<\/p>\n<p>library(ConsensusClusterPlus)<\/p>\n<p>\u8fd9\u91cc\u793a\u4f8b\u6570\u636e\u8fd8\u662f\u548c\u4e0a\u4e00\u7bc7\u4e00\u6837\u6765\u770b\u770b\uff1a<\/p>\n<p>exp &lt;- read.table(&#8220;CESC_fpkm_mRNA_01A.txt&#8221;,sep = &#8220;\\t&#8221;,row.names = 1,check.names = F,stringsAsFactors = F,header = T)<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"234\" class=\"wp-image-15920\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-1.png?resize=640%2C234\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-1.png?w=773 773w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-1.png?resize=300%2C110 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-1.png?resize=768%2C281 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-1.png?resize=600%2C220 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>\u4e0b\u9762\u6211\u4eec\u53bb\u9009\u62e9\u8981\u805a\u7c7b\u7684\u57fa\u56e0\uff0c\u5e76\u4e14\u505a\u4e00\u4e9b\u5904\u7406<\/p>\n<p>d=as.matrix(exp)<\/p>\n<p>gene &lt;- c(&#8220;MMP9&#8243;,&#8221;CCND1&#8243;,&#8221;STAT1&#8243;,&#8221;AR&#8221;,&#8221;AKR1C3&#8243;,&#8221;GSTP1&#8243;,&#8221;PGR&#8221;) #\u8fd9\u91cc\u5c0f\u82b1\u968f\u673a\u51e0\u4e2a\u57fa\u56e0\u53bb\u5c55\u793a<\/p>\n<p>d &lt;- d[gene,]<\/p>\n<p>mads=apply(d,1,mad)<\/p>\n<p>d=d[rev(order(mads))[1:7],] #\u6ce8\u610f\u4e0b\u8fd9\u91cc\u76847\u662f\u57fa\u56e0\u4e2a\u6570<\/p>\n<p>d = sweep(d,1, apply(d,1,median,na.rm=T))<\/p>\n<p>title=(&#8220;JULEI&#8221;) ##\u6587\u4ef6\u5939\u8f93\u51fa\u56fe\u7247\u7684\u4f4d\u7f6e\uff0c\u540d\u5b57\u5c0f\u4f19\u4f34\u53ef\u4ee5\u6309\u7167\u81ea\u5df1\u60f3\u6cd5\u53bb\u5199<\/p>\n<p>set.seed(1) #\u5c0f\u82b1\u53d1\u73b0\u8bbe\u4e0d\u8bbe\u7f6e\u79cd\u5b50\u90fd\u4e00\u6837<\/p>\n<p>results = ConsensusClusterPlus(d,maxK=9,reps=50,pItem=0.8,pFeature=1,<\/p>\n<p>title=title,clusterAlg=&#8221;hc&#8221;,distance=&#8221;pearson&#8221;,seed=1,plot=&#8221;pdf&#8221;)<\/p>\n<p>results[[2]][[&#8220;consensusMatrix&#8221;]][1:5,1:5]<\/p>\n<p>results[[2]][[&#8220;consensusTree&#8221;]]<\/p>\n<p>results[[2]][[&#8220;consensusClass&#8221;]][1:5]<\/p>\n<p>icl = calcICL(results,title=title,plot=&#8221;pdf&#8221;) ##\u753b\u53e6\u4e00\u7ec4\u56fe\u7247<\/p>\n<p>group&lt;-results[[2]][[&#8220;consensusClass&#8221;]]<\/p>\n<p>group&lt;-as.data.frame(group)<\/p>\n<p>group$group &lt;- factor(group$group,levels=c(1,2))<\/p>\n<p>save(group,file = &#8220;group_AY.Rda&#8221;)#\u6211\u4eec\u4fdd\u5b58\u4e00\u4e0b\u805a\u7c7b\u7684\u5206\u7ec4\u4fe1\u606f\uff0c\u4e0b\u6b21\u5c31\u662f\u76f4\u63a5\u6253\u5f00\u4f7f\u7528\u4e86<\/p>\n<p>\u5148\u770b\u770b\u7ed3\u679c<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"231\" height=\"327\" class=\"wp-image-15921\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-2.png?resize=231%2C327\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-2.png?w=231 231w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-2.png?resize=212%2C300 212w\" sizes=\"(max-width: 231px) 100vw, 231px\" data-recalc-dims=\"1\" \/><\/p>\n<p>\u518d\u770b\u4e00\u4e0b\u53ef\u89c6\u5316\u7684\u7ed3\u679c\u56fe<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"200\" height=\"46\" class=\"wp-image-15922\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-3.png?resize=200%2C46\" data-recalc-dims=\"1\" \/><\/p>\n<p>\u5c0f\u82b1\u8fd9\u91cc\u9009\u62e9K=2\u7684\u60c5\u51b5\u53bb\u5c55\u793a\uff0c<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"597\" height=\"628\" class=\"wp-image-15923\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-4.png?resize=597%2C628\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-4.png?w=597 597w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-4.png?resize=285%2C300 285w\" sizes=\"(max-width: 597px) 100vw, 597px\" data-recalc-dims=\"1\" \/> <img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"624\" class=\"wp-image-15924\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-5.png?resize=640%2C624\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-5.png?w=651 651w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-5.png?resize=300%2C293 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-5.png?resize=600%2C585 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"619\" class=\"wp-image-15925\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-6.png?resize=640%2C619\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-6.png?w=673 673w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-6.png?resize=300%2C290 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-6.png?resize=600%2C580 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"192\" class=\"wp-image-15926\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-7.png?resize=640%2C192\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-7.png?w=661 661w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-7.png?resize=300%2C90 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-7.png?resize=600%2C180 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>\u805a\u7c7b\u7ed3\u679c\u7684\u89e3\u8bfb\uff0c\u5c0f\u82b1\u8fd9\u91cc\u4e0d\u591a\u8d58\u8ff0\u4e86\uff0c\u5c0f\u4f19\u4f34\u53ef\u4ee5\u770b\u770b\u5f80\u671f\u5c0f\u82b1\u4ecb\u7ecd\u7684\u3002<\/p>\n<p>\u8fd9\u91cc\u5c0f\u82b1\u8bbe\u7f6e\u4e00\u4e0b\u914d\u8272<\/p>\n<p>\u540e\u7eed\u4e3a\u4e86\u597d\u770b\uff0c\u54c8\u54c8<\/p>\n<p>#\u914d\u8272<\/p>\n<p># \u5b89\u88c5\u5e76\u52a0\u8f7dcolorspace\u5305<\/p>\n<p>#install.packages(&#8220;colorspace&#8221;)<\/p>\n<p>library(colorspace)<\/p>\n<p># choosing HCL-based color palettes<\/p>\n<p># \u67e5\u770b\u6240\u6709\u7684\u989c\u8272\u753b\u677f<\/p>\n<p>hcl_palettes(plot = TRUE)<\/p>\n<p>\u7136\u540e\u6211\u4eec\u5c31\u5bf9\u805a\u7c7b\u5206\u7ec4\u8fdb\u884c\u70ed\u56fe\u7684\u53ef\u89c6\u5316\uff0c\u6bd5\u7adf\u6211\u4eec\u8981\u5c55\u793a\u5206\u7ec4\u7684\u4fe1\u606f\u7684\uff1a<\/p>\n<p># \u7ed8\u5236ConsensusClusterPlus\u540e\u7684\u70ed\u56fe<\/p>\n<p>library(pheatmap)<\/p>\n<p>group &lt;- group %&gt;%<\/p>\n<p>rownames_to_column(&#8220;sample&#8221;)<\/p>\n<p>annotation &lt;- group %&gt;% arrange(group) %&gt;% column_to_rownames(&#8220;sample&#8221;)<\/p>\n<p>a &lt;- group %&gt;% arrange(group) %&gt;% mutate(sample=substring(.$sample,1,12))<\/p>\n<p>b &lt;- t(exp_gene) %&gt;%<\/p>\n<p>as.data.frame() %&gt;%<\/p>\n<p>rownames_to_column(&#8220;sample&#8221;) %&gt;%<\/p>\n<p>mutate(sample=substring(.$sample,1,12))<\/p>\n<p>c &lt;- inner_join(a,b,&#8221;sample&#8221;) %&gt;% .[,-2] %&gt;% column_to_rownames(&#8220;sample&#8221;) %&gt;% t(.)<\/p>\n<p>pheatmap(c,annotation = annotation,<\/p>\n<p>cluster_cols = F,fontsize=5,fontsize_row=5,<\/p>\n<p>scale=&#8221;row&#8221;,show_colnames=F,<\/p>\n<p>fontsize_col=3)<\/p>\n<p>bk &lt;- c(seq(-5,-0.1,by=0.01),seq(0,5,by=0.01))<\/p>\n<p>pheatmap(c,annotation = annotation,<\/p>\n<p>annotation_colors = list(group = c(&#8220;1&#8243; =&#8221;#8B1C62&#8221;,&#8221;2&#8243;= &#8220;#EE9572&#8243;)),<\/p>\n<p>cluster_cols = F,fontsize=10,fontsize_row=10,<\/p>\n<p>scale=&#8221;row&#8221;,show_colnames=F,cluster_row = F,<\/p>\n<p>color = c(colorRampPalette(colors = c(&#8220;#551A8B&#8221;,&#8221;white&#8221;))(length(bk)\/2),colorRampPalette(colors = c(&#8220;white&#8221;,&#8221;#CD3700&#8243;))(length(bk)\/2)),<\/p>\n<p>#legend_breaks=seq(-3,3,1),<\/p>\n<p>fontsize_col=3)<\/p>\n<p>dev.off()<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"374\" class=\"wp-image-15927\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-8.png?resize=640%2C374\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-8.png?w=992 992w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-8.png?resize=300%2C175 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-8.png?resize=768%2C448 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-8.png?resize=600%2C350 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>\u8fd9\u6837\u770b\u6765\uff0c\u805a\u7c7b\u4e00\u7ec4\u7684\u9ad8\u8868\u8fbe\u57fa\u56e0\u5728\u805a\u7c7b\u4e8c\u7ec4\u662f\u4f4e\u8868\u8fbe\u3002\u90a3\u4e48\u6211\u4eec\u5c31\u8be5\u5bf9\u7740\u4e24\u7ec4\u8fdb\u884c\u514d\u75ab\u5206\u6790\u4e86\uff0c\u63a5\u4e0b\u6765\u6211\u4eec\u8fdb\u5165\u6b63\u9898\uff0c<\/p>\n<p>#cluster\u5206\u7ec4CIBERSORT<\/p>\n<p>setwd(&#8220;&#8221;)#\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e0b\u5206\u7ec4<\/p>\n<p>library(tidyverse)<\/p>\n<p>\u6211\u4eec\u8fd9\u91cc\u7528\u7684\u514d\u75ab\u6d78\u6da6\u7684\u7ed3\u679c\u662f\u4e0a\u671f\u5c0f\u82b1\u4ecb\u7ecd\u8fc7\u7684\uff0c\u5c0f\u4f19\u4f34\u6ca1\u6709\u7684\u53ef\u4ee5\u53bb\u770b\u4e0a\u671f\u6587\u7ae0\uff0c\u300aSCI\u90fd\u5728\u4f7f\u7528\u7684\u5355\u57fa\u56e0\u514d\u75ab\u6d78\u6da6\u8fd8\u4e0d\u4f1a\u5417\uff1f\u5c0f\u82b1\u624b\u628a\u624b\u6559\u4f60\u5b66\u4f1a\uff01\uff08\u4e00\uff09\u300b<\/p>\n<p>a &lt;- read.table(&#8220;CIBERSORT-Results.txt&#8221;, sep = &#8220;\\t&#8221;,row.names = 1,check.names = F,header = T)<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"199\" class=\"wp-image-15928\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-9.png?resize=640%2C199\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-9.png?w=1051 1051w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-9.png?resize=300%2C93 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-9.png?resize=1024%2C318 1024w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-9.png?resize=768%2C238 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-9.png?resize=600%2C186 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>a &lt;- a[,1:22]<\/p>\n<p>identical(rownames(a),rownames(group))<\/p>\n<p>b &lt;- group<\/p>\n<p>class(b$group)<\/p>\n<p>a$group &lt;- b$group<\/p>\n<p>a &lt;- a %&gt;% rownames_to_column(&#8220;sample&#8221;)<\/p>\n<p>library(ggsci)<\/p>\n<p>library(tidyr)<\/p>\n<p>library(ggpubr)<\/p>\n<p>#install.packages(&#8220;ggsci&#8221;)<\/p>\n<p>#install.packages(&#8220;tidyr&#8221;)<\/p>\n<p>#install.packages(&#8220;ggpubr&#8221;)<\/p>\n<p>b &lt;- gather(a,key=CIBERSORT,value = Proportion,-c(group,sample))<\/p>\n<p>ggboxplot(b, x = &#8220;CIBERSORT&#8221;, y = &#8220;Proportion&#8221;,<\/p>\n<p>fill = &#8220;group&#8221;, palette = &#8220;lancet&#8221;)+<\/p>\n<p>stat_compare_means(aes(group = group),<\/p>\n<p>method = &#8220;wilcox.test&#8221;,<\/p>\n<p>label = &#8220;p.signif&#8221;,<\/p>\n<p>symnum.args=list(cutpoints = c(0, 0.001, 0.01, 0.05, 1),<\/p>\n<p>symbols = c(&#8220;***&#8221;, &#8220;**&#8221;, &#8220;*&#8221;, &#8220;ns&#8221;)))+<\/p>\n<p>theme(text = element_text(size=10),<\/p>\n<p>axis.text.x = element_text(angle=45, hjust=1))<\/p>\n<p>dev.off()<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"302\" class=\"wp-image-15929\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-10.png?resize=640%2C302\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-10.png?w=1189 1189w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-10.png?resize=300%2C142 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-10.png?resize=1024%2C483 1024w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-10.png?resize=768%2C362 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-10.png?resize=600%2C283 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>\u6211\u4eec\u7528\u5c0f\u63d0\u7434\u56fe\u5c55\u793a\u4e00\u4e0b\u4fe1\u606f\uff0c\u8fd9\u4e2a\u56fe\u5c31\u662f\u5c55\u793a\u4e86\u4e0d\u540c\u7ec4\u5728\u4e0d\u540c\u514d\u75ab\u7ec6\u80de\u4e2d\u7684\u5360\u6bd4\uff0c\u4e5f\u5c31\u662f\u6b63\u5e38\u7684\u514d\u75ab\u6d78\u6da6\u5206\u6790\uff0c<\/p>\n<p>\u4e0b\u9762\u6211\u4eec\u4ecb\u7ecd\u6700\u540e\u4e00\u79cd\u514d\u75ab\u6d78\u6da6\u7684\u65b9\u5f0f\uff0c\u805a\u7c7b\u7684ssgsea\uff0c\u4e4b\u524d\u5c0f\u82b1\u4e13\u95e8\u4ecb\u7ecd\u8fc7\u4e00\u671fssGSEA\uff0c\u5355\u6837\u672c\u7684\u514d\u75ab\u6d78\u6da6\uff0c\u8fd9\u6b21\u6211\u4eec\u4f7f\u7528\u805a\u7c7b\u540e\u7684\u7ed3\u679c\u53bb\u7ed8\u5236\uff0c\u6765\u770b\u770b\u5982\u4f55\u7ed8\u5236\u7684<\/p>\n<p>ssGSEA<\/p>\n<p>setwd(&#8220;ssGSEA_AY&#8221;)<\/p>\n<p>#BiocManager::install(&#8216;GSVA&#8217;)<\/p>\n<p>library(tidyverse)<\/p>\n<p>library(data.table)<\/p>\n<p>#library(GSVA)<\/p>\n<p>#BiocManager::install(&#8220;GSVA&#8221;)<\/p>\n<p>#BiocManager::install(&#8220;DelayedArray&#8221;)<\/p>\n<p>#library(DelayedArray)<\/p>\n<p>library(GSVA)<\/p>\n<p>#\u51c6\u5907\u7ec6\u80demarker<\/p>\n<p>cellMarker &lt;- data.table::fread(&#8220;cellMarker.csv&#8221;,data.table = F)<\/p>\n<p>colnames(cellMarker)[2] &lt;- &#8220;celltype&#8221;<\/p>\n<p>#\u5c06cellMarker\u6587\u4ef6\u5217\u540d\u7684\u7b2c2\u4e2a\u4fee\u6539\u4e3acelltype<\/p>\n<p>type &lt;- split(cellMarker,cellMarker$celltype)<\/p>\n<p>#\u5c06cellMarker\u6587\u4ef6\u4ee5celltype\u4e3a\u5206\u7ec4\u62c6\u5206\u6210list\u6570\u636e\u683c\u5f0f<\/p>\n<p>#\u5904\u7406data.tables\u5217\u8868\u901a\u5e38\u6bd4\u4f7f\u7528group by\u53c2\u6570\u6309\u7ec4\u5bf9\u5355\u4e2adata.table\u8fdb\u884c\u64cd\u4f5c\u8981\u6162\u5f97\u591a<\/p>\n<p>cellMarker &lt;- lapply(type, function(x){<\/p>\n<p>dd = x$Metagene<\/p>\n<p>unique(dd)<\/p>\n<p>})<\/p>\n<p>#\u5c06list\u4e2d\u6bcf\u4e2acelltype\u4e2d\u7684\u57fa\u56e0\u8fdb\u884c\u5408\u5e76<\/p>\n<p>save(cellMarker,file = &#8220;cellMarker_ssGSEA.Rdata&#8221;)#\u4fdd\u5b58\u4e2d\u95f4\u6587\u4ef6<\/p>\n<p>#load(&#8220;immune_infiltration\/\/cellMarker_ssGSEA.Rdata&#8221;)<\/p>\n<p>##\u8868\u8fbe\u91cf\u77e9\u9635\u7684\u51c6\u5907<\/p>\n<p>###\u884c\u662f\u57fa\u56e0\uff0c\u5217\u662f\u6837\u672c<\/p>\n<p>expr &lt;- data.table::fread(&#8220;CESC_fpkm_mRNA_01A.txt&#8221;,data.table = F) #\u8bfb\u53d6\u8868\u8fbe\u6587\u4ef6<\/p>\n<p>rownames(expr) &lt;- expr[,1] #\u5c06\u7b2c\u4e00\u5217\u4f5c\u4e3a\u884c\u540d<\/p>\n<p>expr &lt;- expr[,-1] #\u53bb\u9664\u7b2c\u4e00\u5217<\/p>\n<p>expr &lt;- as.matrix(expr) #\u5c06expr\u8f6c\u6362\u4e3a\u77e9\u9635\u683c\u5f0f<\/p>\n<p># \u4e0b\u9762\u5c31\u662f\u4f7f\u7528ssGSEA\u91cf\u5316\u514d\u75ab\u6d78\u6da6<\/p>\n<p>gsva_data &lt;- gsva(expr,cellMarker, method = &#8220;ssgsea&#8221;)<\/p>\n<p>a &lt;- gsva_data %&gt;% t() %&gt;% as.data.frame()<\/p>\n<p>identical(rownames(a),rownames(group))<\/p>\n<p>a$group &lt;- group$group<\/p>\n<p>a &lt;- a %&gt;% rownames_to_column(&#8220;sample&#8221;)<\/p>\n<p>write.table(a,&#8221;ssGSEA.txt&#8221;,sep = &#8220;\\t&#8221;,row.names = T,col.names = NA,quote = F)<\/p>\n<p>library(ggsci)<\/p>\n<p>library(tidyr)<\/p>\n<p>library(ggpubr)<\/p>\n<p>b &lt;- gather(a,key=ssGSEA,value = Expression,-c(group,sample))<\/p>\n<p>ggboxplot(b, x = &#8220;ssGSEA&#8221;, y = &#8220;Expression&#8221;,<\/p>\n<p>fill = &#8220;group&#8221;, palette = &#8220;lancet&#8221;)+<\/p>\n<p>stat_compare_means(aes(group = group),<\/p>\n<p>method = &#8220;wilcox.test&#8221;,<\/p>\n<p>label = &#8220;p.signif&#8221;,<\/p>\n<p>symnum.args=list(cutpoints = c(0, 0.001, 0.01, 0.05, 1),<\/p>\n<p>symbols = c(&#8220;***&#8221;, &#8220;**&#8221;, &#8220;*&#8221;, &#8220;ns&#8221;)))+<\/p>\n<p>theme(text = element_text(size=10),<\/p>\n<p>axis.text.x = element_text(angle=45, hjust=1))<\/p>\n<p>dev.off() <img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"304\" class=\"wp-image-15930\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-11.png?resize=640%2C304\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-11.png?w=966 966w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-11.png?resize=300%2C143 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-11.png?resize=768%2C365 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2023\/10\/word-image-15919-11.png?resize=600%2C285 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>\u597d\u4e86\uff0c\u5230\u8fd9\u91cc\u5c0f\u82b1\u5c31\u8bb2\u89e3\u5b8c\u6210\u4e86\uff0c\u5c0f\u4f19\u4f34\u6709\u6ca1\u6709\u5b66\u4f1a\u5462\uff0c\u5feb\u53bb\u62ff\u4f60\u7684\u6570\u636e\u53bb\u5206\u6790\u5427\uff0c\u4f46\u662f\u5c0f\u4f19\u4f34\u8981\u7406\u89e3\u56fe\u4e2d\u7684\u542b\u4e49\uff0c\u4e0d\u8981\u76f2\u76ee\u53bb\u505a\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5c0f\u82b1\u5728\u4e0a\u7bc7\u6587\u7ae0\u8bf4\u660e\u4e86\u5355\u57fa\u56e0\u7684\u514d\u75ab\u6d78\u6da6\uff0c\u5c31\u662f\u5bf9\u5206\u6790\u67d0\u4e2a\u57fa\u56e0\u4e0e\u514d\u75ab\u7ec6\u80de\u7684\u76f8\u5173\u6027\uff0c\u8fd9\u79cd\u5206\u6790\u65b9\u6cd5\u867d\u7136\u4e0d\u5e38\u89c1\uff0c\u4f46\u662f\u4e5f\u662f\u5728 [&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\/15919"}],"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=15919"}],"version-history":[{"count":1,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/15919\/revisions"}],"predecessor-version":[{"id":15931,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/15919\/revisions\/15931"}],"wp:attachment":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15919"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}