文章预览
之前有一篇推文记录过画图的代码 R语言ggplot2画堆积柱形图展示密码子偏向性的RSCU值 , R语言ggplot2画分组堆积柱形图展示密码子偏向性的RSCU值 那篇推文里需要借助python区算RSCU值,然后用R语言画图。R语言里有一个R包seqinr也可以计算RSCU值 计算RSCU值的代码 输入数据为多个cds序列 library(tidyverse) seqinr::read.fasta("calculateRSCUexampleCDS.fa") %>% unlist() %>% seqinr::uco(index="rscu") %>% as.data.frame() %>% rownames_to_column() %>% magrittr::set_colnames(c("codon","rscu")) 构造作图数据 data.frame( acids=c("Isoleucine","Leucine","Valine","Phenylalanine", "Methionine","Cysteine","Alanine","Glycine", "Proline","Threonine","Serine", "Tyrosine","Tryptophan","Glutamine", "Asparagine","Histidine","Glutamic acid", "Aspartic acid","Lysine","Arginine","Stop codons"), slc=c("I","L","V","F","M","C","A","G","P","T", "S"
………………………………