COG功能注释图

在这里插入图片描述

> m <- read.table("cog.class.annot.txt",header = T,sep = "\t")
> head(m)
  Code                                      Functional.Categories Gene.Number
1    A                            RNA processing and modification          90
2    B                           Chromatin structure and dynamics         245
3    C                           Energy production and conversion         523
4    D Cell cycle control, cell division, chromosome partitioning        1034
5    E                        Amino acid transport and metabolism         793
6    F                        Nucleotide transport and metabolism         209
> layout(matrix(c(1,2),nrow = 1),widths = c(20,13))# layout布局,12#
> layout.show(2)#查看

在这里插入图片描述

> par(mar=c(3,4,4,1)+0.1)
> class <- c("J","A","K","L","B","D","Y","V","T","M","N","Z","W","U","O","C","G","E","F","H","I","P","Q","R","S");
> class
 [1] "J" "A" "K" "L" "B" "D" "Y" "V" "T" "M" "N" "Z" "W" "U" "O" "C" "G" "E" "F" "H"
[21] "I" "P" "Q" "R" "S"
> t <- factor(as.character(m$Code),levels = class)
> m[order(t),]
   Code                                         Functional.Categories Gene.Number
10    J               Translation, ribosomal structure and biogenesis        1424
1     A                               RNA processing and modification          90
11    K                                                 Transcription        1367
12    L                         Replication, recombination and repair        1576
2     B                              Chromatin structure and dynamics         245
4     D    Cell cycle control, cell division, chromosome partitioning        1034
24    Y                                             Nuclear structure           5
22    V                                            Defense mechanisms         197
20    T                                Signal transduction mechanisms         891
13    M                        Cell wall/membrane/envelope biogenesis         949
14    N                                                 Cell motility         352
25    Z                                                  Cytoskeleton         417
23    W                                      Extracellular structures          38
21    U Intracellular trafficking, secretion, and vesicular transport         731
15    O  Posttranslational modification, protein turnover, chaperones        1242
3     C                              Energy production and conversion         523
7     G                         Carbohydrate transport and metabolism        1124
5     E                           Amino acid transport and metabolism         793
6     F                           Nucleotide transport and metabolism         209
8     H                             Coenzyme transport and metabolism         195
9     I                                Lipid transport and metabolism         579
16    P                        Inorganic ion transport and metabolism         580
17    Q  Secondary metabolites biosynthesis, transport and catabolism         641
18    R                              General function prediction only        3283
19    S                                              Function unknown        1121
> m <- m[order(t),]
> head(m)
   Code                                      Functional.Categories Gene.Number
10    J            Translation, ribosomal structure and biogenesis        1424
1     A                            RNA processing and modification          90
11    K                                              Transcription        1367
12    L                      Replication, recombination and repair        1576
2     B                           Chromatin structure and dynamics         245
4     D Cell cycle control, cell division, chromosome partitioning        1034
> barplot(m$Gene.Number,space = F,col = rainbow(25),ylab = "Number of Genes",names.arg = m$Code)

在这里插入图片描述

> l <- c(0,5,15,23,25)
> l
[1]  0  5 15 23 25
> id <- c("INFORMATION STORAGE AND PROCESSING","CELLULAR PROCESSES AND SIGNALING","METABOLISM","POORLY CHARACTERIZED")
> id
[1] "INFORMATION STORAGE AND PROCESSING" "CELLULAR PROCESSES AND SIGNALING"  
[3] "METABOLISM"                         "POORLY CHARACTERIZED"     
> abline(v=l[c(-1,-5)])

在这里插入图片描述

> for (i in 2:length(l)) {
   text( (l[i-1]+l[i])/2, max(m[,3])*1.1,id[i-1],cex = 0.8,xpd=T)  
}

在这里插入图片描述

> par(mar= c(2,0,2,1)+0.1)
> plot(0,0,type = "n",xlim = c(0,1),ylim = c(0,26),bty="n",axes = F,xlab = "",ylab = "")
> for(i in 1:length(class)){
 text(0,26-i+0.5,paste(m$Code[i],m$Functional.Categories[i]),pos=4,cex=1,pty=T)
 }

在这里插入图片描述

> title(main = "COG function classfication")

在这里插入图片描述

数据,链接:https://pan.baidu.com/s/1RoT4TxuZ4dKBDw6-kcbnIw
提取码:675p
《R语言与生物信息绘图》课程笔记

  • 1
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

紫霄zixiao

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值