{"id":28893,"date":"2024-02-19T18:02:18","date_gmt":"2024-02-19T10:02:18","guid":{"rendered":"http:\/\/www.biocloudservice.com\/wordpress\/?p=28893"},"modified":"2024-02-19T18:02:19","modified_gmt":"2024-02-19T10:02:19","slug":"%e5%88%a9%e7%94%a8ggcor%e5%8c%85%e7%bb%98%e5%88%b6%e7%9b%b8%e5%85%b3%e6%80%a7%e5%9b%be","status":"publish","type":"post","link":"http:\/\/www.biocloudservice.com\/wordpress\/?p=28893","title":{"rendered":"\u5229\u7528ggcor\u5305\u7ed8\u5236\u76f8\u5173\u6027\u56fe"},"content":{"rendered":"<p>\u4eca\u5929\u5c0f\u679c\u5229\u7528ggcor\u5305\u7ed8\u5236\u597d\u770b\u7684\u76f8\u5173\u6027\u56fe\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\u5b89\u88c5\u9700\u8981\u7684R\u5305<\/li>\n<\/ol>\n<p>install.packages(\u201cggplot2\u201d)<\/p>\n<p>install.packages(\u201cGSVA\u201d)<\/p>\n<p>install.packages(\u201cdata.table\u201d)<\/p>\n<p>install.packages(\u201cggnewscale\u201d)<\/p>\n<p>install.packafes(\u201cade4\u201d)<\/p>\n<p>#\u76f4\u63a5\u4e0b\u8f7d\u5b89\u88c5\u5305\u5b89\u88c5<\/p>\n<p>install.packages(&#8220;ggcor-master.tar.gz&#8221;, repos = NULL, type = &#8220;source&#8221;)<\/p>\n<ol>\n<li>\u5bfc\u5165\u9700\u8981\u7684R\u5305<\/li>\n<\/ol>\n<p>library(ggplot2)<\/p>\n<p>library(ggcor)<\/p>\n<p>library(ggplot2)<\/p>\n<p>library(data.table)<\/p>\n<p>library(GSVA)<\/p>\n<ol>\n<li>\u4ee3\u7801\u5c55\u793a<\/li>\n<\/ol>\n<p>#\u5bfc\u5165\u9700\u8981\u7684\u6570\u636e<\/p>\n<p>#\u52a0\u8f7dTCGA-BLCA\u8868\u8fbe\u8c31FPKM<\/p>\n<p>expr&lt;-read.table(&#8220;tcga_blca_fpkm.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=\"133\" class=\"wp-image-28894\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230209151017.jpeg?resize=640%2C133\" alt=\"Dingtalk_20230209151017\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230209151017.jpeg?w=1078 1078w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230209151017.jpeg?resize=300%2C62 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230209151017.jpeg?resize=1024%2C213 1024w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230209151017.jpeg?resize=768%2C160 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230209151017.jpeg?resize=600%2C125 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>tumsam &lt;- colnames(expr)[substr(colnames(expr),11,13) == &#8220;01A&#8221;] # \u53d6\u51fa\u80bf\u7624\u6837\u672c<\/p>\n<p># \u53d6\u51faSIGLEC15\u8868\u8fbe\u91cf<\/p>\n<p>siglec15 &lt;- log2(expr[&#8220;SIGLEC15&#8221;,tumsam] + 1)<\/p>\n<p>write.csv(siglec15, &#8220;gene.csv&#8221;)<\/p>\n<p># \u52a0\u8f7dimmunotherapy-predicted pathways<\/p>\n<p>immPath &lt;- read.table(&#8220;immunotherapy predicted pathways.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=\"80\" class=\"wp-image-28895\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230209151211.jpeg?resize=640%2C80\" alt=\"Dingtalk_20230209151211\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230209151211.jpeg?w=1267 1267w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230209151211.jpeg?resize=300%2C38 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230209151211.jpeg?resize=1024%2C129 1024w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230209151211.jpeg?resize=768%2C96 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230209151211.jpeg?resize=600%2C75 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>immPath.list &lt;- list()<\/p>\n<p>for (i in rownames(immPath)) {<\/p>\n<p>tmp &lt;- immPath[i,&#8221;Genes&#8221;]<\/p>\n<p>tmp &lt;- toupper(unlist(strsplit(tmp,&#8221;, &#8220;,fixed = T)))<\/p>\n<p>tmp &lt;- gsub(&#8221; &#8220;,&#8221;&#8221;,tmp)<\/p>\n<p>immPath.list[[i]] &lt;- tmp<\/p>\n<p>}<\/p>\n<p># \u8ba1\u7b97immunotherapy-predicted pathways\u7684\u5bcc\u96c6\u5f97\u5206<\/p>\n<p>immPath.score &lt;- gsva(expr = as.matrix(log2(expr[,tumsam] + 1)),<\/p>\n<p>immPath.list,<\/p>\n<p>method = &#8220;ssgsea&#8221;)<\/p>\n<p>write.table(immPath.score, &#8220;immPath.txt&#8221;,sep = &#8220;\\t&#8221;,row.names = T,col.names = NA,quote = F)<\/p>\n<p># \u52a0\u8f7d\u5355\u4e2a\u57fa\u56e0\u7684\u8868\u8fbe\u91cf\uff0c\u4e5f\u5c31\u662f\u201c1\u5bf9\u591a\u201d\u7684\u201c1\u201d<\/p>\n<p>siglec15 &lt;- read.csv(&#8220;gene.csv&#8221;, row.names = 1, check.names = F)<\/p>\n<p># \u52a0\u8f7d\u5bcc\u96c6\u5f97\u5206<\/p>\n<p>immPath.score &lt;- read.table(&#8220;immPath.txt&#8221;, check.names = F)<\/p>\n<p># \u8ddf\u76ee\u6807\u57fa\u56e0SIGLEC15\u7684\u8868\u8fbe\u91cf\u5408\u5e76<\/p>\n<p>immPath.score &lt;- rbind.data.frame(immPath.score,<\/p>\n<p>siglec15)<\/p>\n<p># \u5faa\u73af\u8ba1\u7b97\u76f8\u5173\u6027\u5e76\u7ed8\u5236\u5de6\u4e0b\u89d2<\/p>\n<p>immCorSiglec15 &lt;- NULL<\/p>\n<p>for (i in rownames(immPath.score)) {<\/p>\n<p>cr &lt;- cor.test(as.numeric(immPath.score[i,]),<\/p>\n<p>as.numeric(siglec15),<\/p>\n<p>method = &#8220;pearson&#8221;)<\/p>\n<p>immCorSiglec15 &lt;- rbind.data.frame(immCorSiglec15,<\/p>\n<p>data.frame(gene = &#8220;Siglec15&#8243;,<\/p>\n<p>path = i,<\/p>\n<p>r = cr$estimate,<\/p>\n<p>p = cr$p.value,<\/p>\n<p>stringsAsFactors = F),<\/p>\n<p>stringsAsFactors = F)<\/p>\n<p>}<\/p>\n<p>immCorSiglec15$sign &lt;- ifelse(immCorSiglec15$r &gt; 0,&#8221;pos&#8221;,&#8221;neg&#8221;)<\/p>\n<p>immCorSiglec15$absR &lt;- abs(immCorSiglec15$r)<\/p>\n<p>immCorSiglec15$rSeg &lt;- as.character(cut(immCorSiglec15$absR,c(0,0.25,0.5,0.75,1),labels = c(&#8220;0.25&#8243;,&#8221;0.50&#8243;,&#8221;0.75&#8243;,&#8221;1.00&#8221;),include.lowest = T))<\/p>\n<p>immCorSiglec15$pSeg &lt;- as.character(cut(immCorSiglec15$p,c(0,0.001,0.01,0.05,1),labels = c(&#8220;&lt;0.001&#8243;,&#8221;&lt;0.01&#8243;,&#8221;&lt;0.05&#8243;,&#8221;ns&#8221;),include.lowest = T))<\/p>\n<p>immCorSiglec15[nrow(immCorSiglec15),&#8221;pSeg&#8221;] &lt;- &#8220;Not Applicable&#8221;<\/p>\n<p>immCorSiglec15$rSeg &lt;- factor(immCorSiglec15$rSeg, levels = c(&#8220;0.25&#8243;,&#8221;0.50&#8243;,&#8221;0.75&#8243;,&#8221;1.00&#8221;))<\/p>\n<p>immCorSiglec15$pSeg &lt;- factor(immCorSiglec15$pSeg, levels = c(&#8220;&lt;0.001&#8243;,&#8221;&lt;0.01&#8243;,&#8221;&lt;0.05&#8243;,&#8221;Not Applicable&#8221;,&#8221;ns&#8221;))<\/p>\n<p>immCorSiglec15$sign &lt;- factor(immCorSiglec15$sign, levels = c(&#8220;pos&#8221;,&#8221;neg&#8221;))<\/p>\n<p>p1 &lt;- quickcor(t(immPath.score),<\/p>\n<p>type = &#8220;lower&#8221;,<\/p>\n<p>show.diag = TRUE) +<\/p>\n<p>geom_colour() +<\/p>\n<p>add_link(df = immCorSiglec15,<\/p>\n<p>mapping = aes(colour = pSeg, size = rSeg, linetype = sign),<\/p>\n<p>spec.key = &#8220;gene&#8221;,<\/p>\n<p>env.key = &#8220;path&#8221;,<\/p>\n<p>diag.label = FALSE) +<\/p>\n<p>scale_size_manual(values = c(0.5, 1, 1.5, 2)) +<\/p>\n<p>scale_color_manual(values = c(&#8220;#19A078&#8243;,&#8221;#DA6003&#8243;,&#8221;#7570B4&#8243;,&#8221;#E8288E&#8221;,&#8221;#65A818&#8243;)) +<\/p>\n<p>scale_fill_gradient2(low = &#8220;#9483E1&#8221;,mid = &#8220;white&#8221;,high = &#8220;#E11953&#8221;,midpoint=0) +<\/p>\n<p>remove_axis(&#8220;x&#8221;)<\/p>\n<p>ggsave(filename = &#8220;ggcor.pdf&#8221;, width = 10,height = 8)<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"478\" class=\"wp-image-28896\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230208165553.jpeg?resize=640%2C478\" alt=\"Dingtalk_20230208165553\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230208165553.jpeg?w=855 855w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230208165553.jpeg?resize=300%2C224 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230208165553.jpeg?resize=768%2C573 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230208165553.jpeg?resize=600%2C448 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>#immPath.txt-\u5bcc\u96c6\u5f97\u5206\u6587\u4ef6<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"165\" class=\"wp-image-28897\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230209151416.jpeg?resize=640%2C165\" alt=\"Dingtalk_20230209151416\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230209151416.jpeg?w=1249 1249w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230209151416.jpeg?resize=300%2C77 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230209151416.jpeg?resize=1024%2C264 1024w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230209151416.jpeg?resize=768%2C198 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230209151416.jpeg?resize=600%2C155 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>\u6700\u7ec8\u5c0f\u679c\u6210\u529f\u7684\u753b\u51fa\u4e86\u76f8\u5173\u6027\u7f51\u7edc\u56fe\uff0c\u770b\u8d77\u6765\u5c0f\u679c\u975e\u5e38\u4e0d\u9519\uff0c\u6709\u9700\u8981\u7684\u53ef\u4ee5\u501f\u9274\u5b66\u4e60\u5965\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u5c0f\u679c\u5229\u7528ggcor\u5305\u7ed8\u5236\u597d\u770b\u7684\u76f8\u5173\u6027\u56fe\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a \u5b89\u88c5\u9700\u8981\u7684R\u5305 install.packages(\u201cg [&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\/28893"}],"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=28893"}],"version-history":[{"count":1,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/28893\/revisions"}],"predecessor-version":[{"id":28898,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/28893\/revisions\/28898"}],"wp:attachment":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=28893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=28893"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=28893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}