DNA/RNA/氨基酸多序列比对图R包ggmsa

数据可视化 数据可视化 447 人阅读 | 0 人回复 | 2024-07-06

R包安装

BiocManager::install("ggplot2")
BiocManager::install("ggmsa")

DNA多序列比对图

# 导入内置核酸序列
nt_sequences <- system.file("extdata", "LeaderRepeat_All.fa", package = "ggmsa")

ggmsa(nt_sequences, color="Chemistry_AA", font = "DroidSansMono", char_width = 0.5, seq_name = TRUE)

RNA多序列比对图

miRNA_sequences <- system.file("extdata", "seedSample.fa", package = "ggmsa")

ggmsa(miRNA_sequences, font = 'DroidSansMono',color = "Chemistry_NT", none_bg = TRUE) +
  geom_seed(seed = "GAGGUAG", star = FALSE)ggmsa(miRNA_sequences, font = 'DroidSansMono',color = "Chemistry_NT") +
  geom_seed(seed = "GAGGUAG", star = TRUE)

蛋白质多序列比对图

protein_sequences <- system.file("extdata", "sample.fasta", package = "ggmsa")

ggmsa(protein_sequences, 221, 280, seq_name = TRUE, char_width = 0.5) + 
  geom_seqlogo(color = "Chemistry_AA") + geom_msaBar()

基因组变异图

fas <- list.files(system.file("extdata", "GVariation", package="ggmsa"), pattern="fas", full.names=TRUE)
x <- seqdiff(fas[1], reference=1)

plot(
  x,
  width = 50,
  title = "auto",
  xlab = "Nucleotide Position",
  by = "bar",
  fill = "firebrick",
  colors = c(A = "#ff6d6d", C = "#769dcc", G = "#f2be3c", T = "#74ce98"),
  xlim = NULL
)

微信扫一扫分享文章

+10
无需登陆也可“点赞”支持作者
分享到:
评论

使用道具 举报

热门推荐