{"id":29046,"date":"2024-02-20T17:47:32","date_gmt":"2024-02-20T09:47:32","guid":{"rendered":"http:\/\/www.biocloudservice.com\/wordpress\/?p=29046"},"modified":"2024-02-20T17:47:33","modified_gmt":"2024-02-20T09:47:33","slug":"%e5%88%a9%e7%94%a8go%e5%af%8c%e9%9b%86%e5%88%86%e6%9e%90%e7%bb%93%e6%9e%9c%e8%bf%9b%e8%a1%8c%e7%81%ab%e6%9f%b4%e6%9d%86%e5%9b%be%e7%bb%98%e5%88%b6","status":"publish","type":"post","link":"http:\/\/www.biocloudservice.com\/wordpress\/?p=29046","title":{"rendered":"\u5229\u7528GO\u5bcc\u96c6\u5206\u6790\u7ed3\u679c\u8fdb\u884c\u706b\u67f4\u6746\u56fe\u7ed8\u5236"},"content":{"rendered":"<p>\u4eca\u5929\u5c0f\u679c\u770b\u5230\u4e00\u4e2a\u6709\u8da3\u7684GO\u5bcc\u96c6\u5206\u6790\u7ed3\u679c\u7684\u5c55\u793a\u5f62\u5f0f\uff0c\u901a\u8fc7\u706b\u67f4\u6746\u56fe\u6765\u5c55\u793aGO\u5bcc\u96c6\u7ed3\u679c\uff0c\u505a\u4e86\u4e00\u4e0b\u5c1d\u8bd5\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(\u201ccowplot\u201d)<\/p>\n<p>install.packages(\u201ctidyverse\u201d)<\/p>\n<p>install.packages(\u201cggsci\u201d)<\/p>\n<ol>\n<li>\u8f7d\u5165\u9700\u8981\u7684R\u5305<\/li>\n<\/ol>\n<p>library(ggplot2)<\/p>\n<p>library(cowplot)<\/p>\n<p>library(tidyverse)<\/p>\n<p>library(ggsci)<\/p>\n<ol>\n<li>\u4ee3\u7801\u5c55\u793a<\/li>\n<\/ol>\n<p>#\u8bfb\u53d6\u6570\u636e<\/p>\n<p>df&lt;-read.table(&#8220;Go.txt&#8221;,header=T,sep=&#8221;\\t&#8221;)<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"204\" class=\"wp-image-29047\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230217143611.jpeg?resize=640%2C204\" alt=\"Dingtalk_20230217143611\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230217143611.jpeg?w=1204 1204w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230217143611.jpeg?resize=300%2C95 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230217143611.jpeg?resize=1024%2C326 1024w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230217143611.jpeg?resize=768%2C244 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230217143611.jpeg?resize=600%2C191 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>#\u5bf9\u6570\u636e\u901a\u8fc7Ontology\uff0cvalue\u8fdb\u884c\u6392\u5e8f<\/p>\n<p>df&lt;-arrange(df,Ontology,value)<\/p>\n<p>#\u786e\u5b9a\u56e0\u5b50\u987a\u5e8f<\/p>\n<p>df$name&lt;-factor(df$name,levels=df$name,order=T)<\/p>\n<p>#\u5f00\u59cb\u7ed8\u56fe<\/p>\n<p>ggplot(df,aes(x=name,y=value))+<\/p>\n<p>geom_segment(aes(x=name,<\/p>\n<p>xend=name,<\/p>\n<p>y=0,<\/p>\n<p>yend=value))+<\/p>\n<p>geom_point(aes(x=name,y=value,color=Ontology),size=5)+<\/p>\n<p>scale_color_npg()+<\/p>\n<p>labs(x=&#8221;Term_name&#8221;,y=&#8221; Gene count&#8221;,title=&#8221;Matchstick_plot&#8221;)+<\/p>\n<p>scale_y_continuous(expand = c(0,0),<\/p>\n<p>limits = c(0,90),<\/p>\n<p>labels = c(0,25,50,75,90))+<\/p>\n<p>coord_flip()+<\/p>\n<p>theme_classic()+<\/p>\n<p>theme(axis.text.x = element_text(angle=90,hjust=0.9,face=&#8221;bold&#8221;,size=9),<\/p>\n<p>axis.text.y = element_text(face=&#8221;bold&#8221;,size=9),<\/p>\n<p>plot.title = element_text(hjust=0.5))<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"498\" class=\"wp-image-29048\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/rplot.png?resize=640%2C498\" alt=\"Rplot\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/rplot.png?w=900 900w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/rplot.png?resize=300%2C233 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/rplot.png?resize=768%2C597 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/rplot.png?resize=600%2C467 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>ggplot(df,aes(x=name,y=value))+<\/p>\n<p>geom_segment(aes(x=name,<\/p>\n<p>xend=name,<\/p>\n<p>y=0,<\/p>\n<p>yend=value))+<\/p>\n<p>geom_point(aes(x=name,y=value,color=Ontology),size=5)+<\/p>\n<p>scale_color_npg()+<\/p>\n<p>labs(x=&#8221;Term_name&#8221;,y=&#8221; Gene count&#8221;,title = &#8220;Matchstick_plot&#8221;)+<\/p>\n<p>scale_y_continuous(expand = c(0,0),<\/p>\n<p>limits = c(0,90),<\/p>\n<p>labels = c(0,25,50,75,90))+<\/p>\n<p>theme_classic()+<\/p>\n<p>theme(axis.text.x = element_text(angle=90,hjust=0.99,face=&#8221;bold&#8221;,size=9),<\/p>\n<p>axis.text.y = element_text(face=&#8221;bold&#8221;,size=9),<\/p>\n<p>plot.title=element_text(hjust=0.5))<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"498\" class=\"wp-image-29049\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/rplot01.png?resize=640%2C498\" alt=\"Rplot01\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/rplot01.png?w=900 900w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/rplot01.png?resize=300%2C233 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/rplot01.png?resize=768%2C597 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/rplot01.png?resize=600%2C467 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>\u6700\u7ec8\u5c0f\u679c\u8fd8\u662f\u7ed8\u5236\u51fa\u4e86\u706b\u67f4\u6746\u56fe\uff0c\u770b\u8d77\u6765\u6548\u679c\u8fd8\u4e0d\u9519\uff0c\u6709\u9700\u8981\u7684\u53ef\u4ee5\u501f\u9274\u5b66\u4e60\uff0c\u5c0f\u679c\u4eca\u5929\u7684\u5206\u4eab\u5c31\u5230\u8fd9\u91cc\u5965\uff0cGO\u5bcc\u96c6\u5206\u6790\u7684\u7ed3\u679c\u53ef\u4ee5\u901a\u8fc7\u4e0d\u540c\u7684\u65b9\u5f0f\u6765\u5c55\u793a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u5c0f\u679c\u770b\u5230\u4e00\u4e2a\u6709\u8da3\u7684GO\u5bcc\u96c6\u5206\u6790\u7ed3\u679c\u7684\u5c55\u793a\u5f62\u5f0f\uff0c\u901a\u8fc7\u706b\u67f4\u6746\u56fe\u6765\u5c55\u793aGO\u5bcc\u96c6\u7ed3\u679c\uff0c\u505a\u4e86\u4e00\u4e0b\u5c1d\u8bd5\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a \u5b89 [&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\/29046"}],"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=29046"}],"version-history":[{"count":1,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/29046\/revisions"}],"predecessor-version":[{"id":29055,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/29046\/revisions\/29055"}],"wp:attachment":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29046"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=29046"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=29046"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}